summaryrefslogtreecommitdiff
path: root/libopie2/opiecore
Unidiff
Diffstat (limited to 'libopie2/opiecore') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oapplication.cpp2
-rw-r--r--libopie2/opiecore/oapplication.h6
-rw-r--r--libopie2/opiecore/oglobal.h3
-rw-r--r--libopie2/opiecore/oglobalsettings.h5
4 files changed, 13 insertions, 3 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index d3e04ba..ce26420 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -90,35 +90,35 @@ void OApplication::init()
90 { 90 {
91 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); 91 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." );
92 } 92 }
93} 93}
94 94
95 95
96void OApplication::setMainWidget( QWidget* widget ) 96void OApplication::setMainWidget( QWidget* widget )
97{ 97{
98 showMainWidget( widget ); 98 showMainWidget( widget );
99} 99}
100 100
101 101
102void OApplication::showMainWidget( QWidget* widget, bool nomax ) 102void OApplication::showMainWidget( QWidget* widget, bool nomax )
103{ 103{
104 #ifdef Q_WS_QWS 104 #ifdef Q_WS_QWS
105 QPEApplication::showMainWidget( widget, nomax ); 105 QPEApplication::showMainWidget( widget, nomax );
106 #else 106 #else
107 QApplication::setMainWidget( widget ); 107 QApplication::setMainWidget( widget );
108 widget->show(); 108 widget->show();
109 #endif 109 #endif
110 widget->setCaption( _appname ); 110 widget->setCaption( _appname );
111} 111}
112 112
113 113
114void OApplication::setTitle( QString title ) const 114void OApplication::setTitle( const QString& title ) const
115{ 115{
116 if ( mainWidget() ) 116 if ( mainWidget() )
117 { 117 {
118 if ( !title.isNull() ) 118 if ( !title.isNull() )
119 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); 119 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
120 else 120 else
121 mainWidget()->setCaption( _appname ); 121 mainWidget()->setCaption( _appname );
122 } 122 }
123} 123}
124 124
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h
index 4d25202..8326847 100644
--- a/libopie2/opiecore/oapplication.h
+++ b/libopie2/opiecore/oapplication.h
@@ -12,61 +12,65 @@
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#ifndef OAPPLICATION_H 31#ifndef OAPPLICATION_H
32#define OAPPLICATION_H 32#define OAPPLICATION_H
33 33
34#define oApp OApplication::oApplication() 34#define oApp OApplication::oApplication()
35 35
36// the below stuff will fail with moc because moc does not pre process headers
37// This will make usage of signal and slots hard inside QPEApplication -zecke
38
36#ifdef QWS 39#ifdef QWS
37 #include <qpe/qpeapplication.h> 40 #include <qpe/qpeapplication.h>
38 #define OApplicationBaseClass QPEApplication 41 #define OApplicationBaseClass QPEApplication
39#else 42#else
40 #include <qapplication.h> 43 #include <qapplication.h>
41 #define OApplicationBaseClass QApplication 44 #define OApplicationBaseClass QApplication
42#endif 45#endif
43 46
44class OApplicationPrivate; 47class OApplicationPrivate;
45class OConfig; 48class OConfig;
46 49
47class OApplication: public OApplicationBaseClass 50class OApplication: public OApplicationBaseClass
48{ 51{
52// Q_OBJECT would fail -zecke
49 public: 53 public:
50 54
51 /** 55 /**
52 * Constructor. Parses command-line arguments and sets the window caption. 56 * Constructor. Parses command-line arguments and sets the window caption.
53 * 57 *
54 * @param rAppName application name. Will be used for finding the 58 * @param rAppName application name. Will be used for finding the
55 * associated message, icon and configuration files 59 * associated message, icon and configuration files
56 * 60 *
57 */ 61 */
58 OApplication( int& argc, char** argv, const QCString& rAppName ); 62 OApplication( int& argc, char** argv, const QCString& rAppName );
59 /** 63 /**
60 * Destructor. Destroys the application object and its children. 64 * Destructor. Destroys the application object and its children.
61 */ 65 */
62 virtual ~OApplication(); 66 virtual ~OApplication();
63 67
64 /** 68 /**
65 * Returns the current application object. 69 * Returns the current application object.
66 * 70 *
67 * This is similar to the global @ref QApplication pointer qApp. It 71 * This is similar to the global @ref QApplication pointer qApp. It
68 * allows access to the single global OApplication object, since 72 * allows access to the single global OApplication object, since
69 * more than one cannot be created in the same application. It 73 * more than one cannot be created in the same application. It
70 * saves you the trouble of having to pass the pointer explicitly 74 * saves you the trouble of having to pass the pointer explicitly
71 * to every function that may require it. 75 * to every function that may require it.
72 * 76 *
@@ -93,38 +97,38 @@ class OApplication: public OApplicationBaseClass
93 /** 97 /**
94 * Sets the main widget - reimplemented to call showMainWidget() 98 * Sets the main widget - reimplemented to call showMainWidget()
95 * on Qt/Embedded. 99 * on Qt/Embedded.
96 * 100 *
97 * @param mainWidget the widget to become the main widget 101 * @param mainWidget the widget to become the main widget
98 * @see QWidget object 102 * @see QWidget object
99 */ 103 */
100 virtual void setMainWidget( QWidget *mainWidget ); 104 virtual void setMainWidget( QWidget *mainWidget );
101 105
102 /** 106 /**
103 * Shows the main widget - reimplemented to call setMainWidget() 107 * Shows the main widget - reimplemented to call setMainWidget()
104 * on platforms other than Qt/Embedded. 108 * on platforms other than Qt/Embedded.
105 * 109 *
106 * @param mainWidget the widget to become the main widget 110 * @param mainWidget the widget to become the main widget
107 * @see QWidget object 111 * @see QWidget object
108 */ 112 */
109 virtual void showMainWidget( QWidget* widget, bool nomax = false ); 113 virtual void showMainWidget( QWidget* widget, bool nomax = false );
110 114
111 /** 115 /**
112 * Set the application title. The application title will be concatenated 116 * Set the application title. The application title will be concatenated
113 * to the application name given in the constructor. 117 * to the application name given in the constructor.
114 * 118 *
115 * @param title the title. If not given, resets caption to appname 119 * @param title the title. If not given, resets caption to appname
116 */ 120 */
117 virtual void setTitle( QString title = QString::null ) const; 121 virtual void setTitle( const QString& title = QString::null ) const;
118 //virtual void setTitle() const; 122 //virtual void setTitle() const;
119 123
120 protected: 124 protected:
121 void init(); 125 void init();
122 126
123 private: 127 private:
124 const QCString _appname; 128 const QCString _appname;
125 static OApplication* _instance; 129 static OApplication* _instance;
126 OConfig* _config; 130 OConfig* _config;
127 OApplicationPrivate* d; 131 OApplicationPrivate* d;
128}; 132};
129 133
130#endif // OAPPLICATION_H 134#endif // OAPPLICATION_H
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h
index 8345c6a..34f211e 100644
--- a/libopie2/opiecore/oglobal.h
+++ b/libopie2/opiecore/oglobal.h
@@ -16,33 +16,34 @@
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#ifndef OGLOBAL_H 31#ifndef OGLOBAL_H
32#define OGLOBAL_H 32#define OGLOBAL_H
33 33
34#include <qpe/global.h> 34#include <qpe/global.h>
35#include <opie2/oconfig.h> 35#include <opie2/oconfig.h>
36 36
37static OConfig globalconfig = OConfig( "global" ); 37static OConfig globalconfig = OConfig( "global" );
38 38
39//FIXME: Is it wise or even necessary to inherit OGlobal from Global? 39//FIXME: Is it wise or even necessary to inherit OGlobal from Global?
40// once we totally skip libqpe it should ideally swallow Global -zecke
40 41
41class OGlobal : public Global 42class OGlobal : public Global
42{ 43{
43 public: 44 public:
44 45 // do we want to put that into OApplication as in KApplication -zecke
45 static OConfig* config(); 46 static OConfig* config();
46}; 47};
47 48
48#endif // OGLOBAL_H 49#endif // OGLOBAL_H
diff --git a/libopie2/opiecore/oglobalsettings.h b/libopie2/opiecore/oglobalsettings.h
index 6481251..d3f357e 100644
--- a/libopie2/opiecore/oglobalsettings.h
+++ b/libopie2/opiecore/oglobalsettings.h
@@ -26,48 +26,49 @@
26    --        :-=` this library; see the file COPYING.LIB. 26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation, 27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, 28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA. 29 Boston, MA 02111-1307, USA.
30*/ 30*/
31 31
32#ifndef OGLOBALSETTINGS_H 32#ifndef OGLOBALSETTINGS_H
33#define OGLOBALSETTINGS_H 33#define OGLOBALSETTINGS_H
34 34
35#include <qstring.h> 35#include <qstring.h>
36#include <qcolor.h> 36#include <qcolor.h>
37#include <qfont.h> 37#include <qfont.h>
38 38
39#define OPIE_DEFAULT_SINGLECLICK true 39#define OPIE_DEFAULT_SINGLECLICK true
40#define OPIE_DEFAULT_INSERTTEAROFFHANDLES true 40#define OPIE_DEFAULT_INSERTTEAROFFHANDLES true
41#define OPIE_DEFAULT_AUTOSELECTDELAY -1 41#define OPIE_DEFAULT_AUTOSELECTDELAY -1
42#define OPIE_DEFAULT_CHANGECURSOR true 42#define OPIE_DEFAULT_CHANGECURSOR true
43#define OPIE_DEFAULT_LARGE_CURSOR false 43#define OPIE_DEFAULT_LARGE_CURSOR false
44#define OPIE_DEFAULT_VISUAL_ACTIVATE true 44#define OPIE_DEFAULT_VISUAL_ACTIVATE true
45#define OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED 50 45#define OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED 50
46 46
47//FIXME: There's still a whole lot of stuff in here which has to be revised 47//FIXME: There's still a whole lot of stuff in here which has to be revised
48//FIXME: before public usage... lack of time to do it at once - so it will 48//FIXME: before public usage... lack of time to do it at once - so it will
49//FIXME: happen step-by-step. ML. 49//FIXME: happen step-by-step. ML.
50// we should not habe too much configure options!!!!!! -zecke
50 51
51/** 52/**
52 * Access the OPIE global configuration settings. 53 * Access the OPIE global configuration settings.
53 * 54 *
54 */ 55 */
55class OGlobalSettings 56class OGlobalSettings
56{ 57{
57 public: 58 public:
58 59
59 /** 60 /**
60 * Returns a threshold in pixels for drag & drop operations. 61 * Returns a threshold in pixels for drag & drop operations.
61 * As long as the mouse movement has not exceeded this number 62 * As long as the mouse movement has not exceeded this number
62 * of pixels in either X or Y direction no drag operation may 63 * of pixels in either X or Y direction no drag operation may
63 * be started. This prevents spurious drags when the user intended 64 * be started. This prevents spurious drags when the user intended
64 * to click on something but moved the mouse a bit while doing so. 65 * to click on something but moved the mouse a bit while doing so.
65 * 66 *
66 * For this to work you must save the position of the mouse (oldPos) 67 * For this to work you must save the position of the mouse (oldPos)
67 * in the @ref QWidget::mousePressEvent(). 68 * in the @ref QWidget::mousePressEvent().
68 * When the position of the mouse (newPos) 69 * When the position of the mouse (newPos)
69 * in a @ref QWidget::mouseMoveEvent() exceeds this threshold 70 * in a @ref QWidget::mouseMoveEvent() exceeds this threshold
70 * you may start a drag 71 * you may start a drag
71 * which should originate from oldPos. 72 * which should originate from oldPos.
72 * 73 *
73 * Example code: 74 * Example code:
@@ -78,63 +79,65 @@ class OGlobalSettings
78 * } 79 * }
79 * 80 *
80 * void OColorCells::mouseMoveEvent( QMouseEvent *e ) 81 * void OColorCells::mouseMoveEvent( QMouseEvent *e )
81 * { 82 * {
82 * if( !(e->state() && LeftButton)) return; 83 * if( !(e->state() && LeftButton)) return;
83 * 84 *
84 * int delay = OGlobalSettings::dndEventDelay(); 85 * int delay = OGlobalSettings::dndEventDelay();
85 * QPoint newPos = e->pos(); 86 * QPoint newPos = e->pos();
86 * if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay || 87 * if(newPos.x() > mOldPos.x()+delay || newPos.x() < mOldPos.x()-delay ||
87 * newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay) 88 * newPos.y() > mOldPos.y()+delay || newPos.y() < mOldPos.y()-delay)
88 * { 89 * {
89 * // Drag color object 90 * // Drag color object
90 * int cell = posToCell(mOldPos); // Find color at mOldPos 91 * int cell = posToCell(mOldPos); // Find color at mOldPos
91 * if ((cell != -1) && colors[cell].isValid()) 92 * if ((cell != -1) && colors[cell].isValid())
92 * { 93 * {
93 * OColorDrag *d = OColorDrag::makeDrag( colors[cell], this); 94 * OColorDrag *d = OColorDrag::makeDrag( colors[cell], this);
94 * d->dragCopy(); 95 * d->dragCopy();
95 * } 96 * }
96 * } 97 * }
97 * } 98 * }
98 * </pre> 99 * </pre>
99 * 100 *
100 */ 101 */
101 102
103 // we do not support DND at the momemt -zecke
102 static int dndEventDelay(); 104 static int dndEventDelay();
103 105
104 /** 106 /**
105 * Returns whether OPIE runs in single (default) or double click 107 * Returns whether OPIE runs in single (default) or double click
106 * mode. 108 * mode.
107 * 109 *
108 * @return @p true if single click mode, or @p false if double click mode. 110 * @return @p true if single click mode, or @p false if double click mode.
109 * 111 *
110 * see @ref http://opie.handhelds.org/documentation/standards/opie/style/mouse/index.html 112 * see @ref http://opie.handhelds.org/documentation/standards/opie/style/mouse/index.html
111 **/ 113 **/
112 static bool singleClick(); 114 static bool singleClick();
113 115
114 /** 116 /**
115 * Returns whether tear-off handles are inserted in OPopupMenus. 117 * Returns whether tear-off handles are inserted in OPopupMenus.
116 **/ 118 **/
119 // would clutter the small screen -zecke
117 static bool insertTearOffHandle(); 120 static bool insertTearOffHandle();
118 121
119 /** 122 /**
120 * @return the OPIE setting for "change cursor over icon" 123 * @return the OPIE setting for "change cursor over icon"
121 */ 124 */
122 static bool changeCursorOverIcon(); 125 static bool changeCursorOverIcon();
123 126
124 /** 127 /**
125 * @return whether to show some feedback when an item (specifically an 128 * @return whether to show some feedback when an item (specifically an
126 * icon) is activated. 129 * icon) is activated.
127 */ 130 */
128 static bool visualActivate(); 131 static bool visualActivate();
129 static unsigned int visualActivateSpeed(); 132 static unsigned int visualActivateSpeed();
130 133
131 /** 134 /**
132 * Returns the OPIE setting for the auto-select option 135 * Returns the OPIE setting for the auto-select option
133 * 136 *
134 * @return the auto-select delay or -1 if auto-select is disabled. 137 * @return the auto-select delay or -1 if auto-select is disabled.
135 */ 138 */
136 static int autoSelectDelay(); 139 static int autoSelectDelay();
137 140
138 /** 141 /**
139 * Returns the OPIE setting for the shortcut key to open 142 * Returns the OPIE setting for the shortcut key to open
140 * context menus. 143 * context menus.
@@ -230,58 +233,60 @@ class OGlobalSettings
230 233
231 /** 234 /**
232 * Returns additional information for debug output (dependent on the debug mode). 235 * Returns additional information for debug output (dependent on the debug mode).
233 * 236 *
234 * @return Additional debug output information. 237 * @return Additional debug output information.
235 */ 238 */
236 static QString debugOutput(); 239 static QString debugOutput();
237 /** 240 /**
238 * This is a structure containing the possible mouse settings. 241 * This is a structure containing the possible mouse settings.
239 */ 242 */
240 struct OMouseSettings 243 struct OMouseSettings
241 { 244 {
242 enum { RightHanded = 0, LeftHanded = 1 }; 245 enum { RightHanded = 0, LeftHanded = 1 };
243 int handed; // left or right 246 int handed; // left or right
244 }; 247 };
245 248
246 /** 249 /**
247 * This returns the current mouse settings. 250 * This returns the current mouse settings.
248 */ 251 */
249 static OMouseSettings & mouseSettings(); 252 static OMouseSettings & mouseSettings();
250 253
251 /** 254 /**
252 * The path to the desktop directory of the current user. 255 * The path to the desktop directory of the current user.
253 */ 256 */
257 // below handled by Global stuff and QPEApplication
254 static QString desktopPath() { initStatic(); return *s_desktopPath; } 258 static QString desktopPath() { initStatic(); return *s_desktopPath; }
255 259
256 /** 260 /**
257 * The path to the autostart directory of the current user. 261 * The path to the autostart directory of the current user.
258 */ 262 */
259 static QString autostartPath() { initStatic(); return *s_autostartPath; } 263 static QString autostartPath() { initStatic(); return *s_autostartPath; }
260 264
261 /** 265 /**
262 * The path to the trash directory of the current user. 266 * The path to the trash directory of the current user.
263 */ 267 */
268 // we do not have that concept -zecke
264 static QString trashPath() { initStatic(); return *s_trashPath; } 269 static QString trashPath() { initStatic(); return *s_trashPath; }
265 270
266 /** 271 /**
267 * The path where documents are stored of the current user. 272 * The path where documents are stored of the current user.
268 */ 273 */
269 static QString documentPath() { initStatic(); return *s_documentPath; } 274 static QString documentPath() { initStatic(); return *s_documentPath; }
270 275
271 276
272 /** 277 /**
273 * The default color to use when highlighting toolbar buttons 278 * The default color to use when highlighting toolbar buttons
274 */ 279 */
275 static QColor toolBarHighlightColor(); 280 static QColor toolBarHighlightColor();
276 static QColor inactiveTitleColor(); 281 static QColor inactiveTitleColor();
277 static QColor inactiveTextColor(); 282 static QColor inactiveTextColor();
278 static QColor activeTitleColor(); 283 static QColor activeTitleColor();
279 static QColor activeTextColor(); 284 static QColor activeTextColor();
280 static int contrast(); 285 static int contrast();
281 286
282 /** 287 /**
283 * The default colors to use for text and links. 288 * The default colors to use for text and links.
284 */ 289 */
285 static QColor baseColor(); // Similair to QColorGroup::base() 290 static QColor baseColor(); // Similair to QColorGroup::base()
286 static QColor textColor(); // Similair to QColorGroup::text() 291 static QColor textColor(); // Similair to QColorGroup::text()
287 static QColor linkColor(); 292 static QColor linkColor();