Diffstat (limited to 'libopie2/opiecore/oapplication.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/oapplication.h | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index 8326847..94ac488 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h | |||
@@ -30,99 +30,67 @@ | |||
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 | |||
39 | #ifdef QWS | ||
40 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
41 | #define OApplicationBaseClass QPEApplication | ||
42 | #else | ||
43 | #include <qapplication.h> | ||
44 | #define OApplicationBaseClass QApplication | ||
45 | #endif | ||
46 | 37 | ||
47 | class OApplicationPrivate; | 38 | class OApplicationPrivate; |
48 | class OConfig; | 39 | class OConfig; |
49 | 40 | ||
50 | class OApplication: public OApplicationBaseClass | 41 | class OApplication: public QPEApplication |
51 | { | 42 | { |
52 | // Q_OBJECT would fail -zecke | 43 | Q_OBJECT |
53 | public: | ||
54 | 44 | ||
45 | public: | ||
55 | /** | 46 | /** |
56 | * Constructor. Parses command-line arguments and sets the window caption. | 47 | * Constructor. Parses command-line arguments and sets the window caption. |
57 | * | 48 | * |
58 | * @param rAppName application name. Will be used for finding the | 49 | * @param rAppName application name. Will be used for finding the |
59 | * associated message, icon and configuration files | 50 | * associated message, icon and configuration files |
60 | * | 51 | * |
61 | */ | 52 | */ |
62 | OApplication( int& argc, char** argv, const QCString& rAppName ); | 53 | OApplication( int& argc, char** argv, const QCString& rAppName ); |
63 | /** | 54 | /** |
64 | * Destructor. Destroys the application object and its children. | 55 | * Destructor. Destroys the application object and its children. |
65 | */ | 56 | */ |
66 | virtual ~OApplication(); | 57 | virtual ~OApplication(); |
67 | |||
68 | /** | 58 | /** |
69 | * Returns the current application object. | 59 | * @returns the process-wide application object |
70 | * | 60 | * |
71 | * This is similar to the global @ref QApplication pointer qApp. It | 61 | * This is similar to the global @ref QApplication pointer qApp. It |
72 | * allows access to the single global OApplication object, since | 62 | * allows access to the single global OApplication object, since |
73 | * more than one cannot be created in the same application. It | 63 | * more than one cannot be created in the same application. It |
74 | * saves you the trouble of having to pass the pointer explicitly | 64 | * saves you the trouble of having to pass the pointer explicitly |
75 | * to every function that may require it. | 65 | * to every function that may require it. |
76 | * | ||
77 | * @return the current application object | ||
78 | */ | 66 | */ |
79 | static const OApplication* oApplication() { return _instance; }; | 67 | static const OApplication* oApplication() { return _instance; }; |
80 | |||
81 | /** | 68 | /** |
82 | * Returns the application name as given during creation. | 69 | * Returns the application name as given during creation. |
83 | * | 70 | * |
84 | * @return A reference to the application name | 71 | * @returns a reference to the application name |
85 | */ | 72 | */ |
86 | const QCString& appName() const { return _appname; }; | 73 | const QCString& appName() const { return _appname; }; |
87 | |||
88 | /** | 74 | /** |
89 | * Returns the application session config object. | 75 | * @returns the application session config object. |
90 | * | 76 | * |
91 | * @return A pointer to the application's instance specific | ||
92 | * @ref OConfig object. | ||
93 | * @see OConfig | 77 | * @see OConfig |
94 | */ | 78 | */ |
95 | OConfig* config(); | 79 | OConfig* config(); |
96 | |||
97 | /** | 80 | /** |
98 | * Sets the main widget - reimplemented to call showMainWidget() | 81 | * Shows the main @a widget and sets the name of the application as window caption. |
99 | * on Qt/Embedded. | ||
100 | * | ||
101 | * @param mainWidget the widget to become the main widget | ||
102 | * @see QWidget object | ||
103 | */ | ||
104 | virtual void setMainWidget( QWidget *mainWidget ); | ||
105 | |||
106 | /** | ||
107 | * Shows the main widget - reimplemented to call setMainWidget() | ||
108 | * on platforms other than Qt/Embedded. | ||
109 | * | ||
110 | * @param mainWidget the widget to become the main widget | ||
111 | * @see QWidget object | ||
112 | */ | 82 | */ |
113 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); | 83 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); |
114 | |||
115 | /** | 84 | /** |
116 | * Set the application title. The application title will be concatenated | 85 | * Set the application title. The application title will be concatenated |
117 | * to the application name given in the constructor. | 86 | * to the application name given in the constructor. |
118 | * | 87 | * |
119 | * @param title the title. If not given, resets caption to appname | 88 | * @param title the title. If not given, resets caption to appname |
120 | */ | 89 | */ |
121 | virtual void setTitle( const QString& title = QString::null ) const; | 90 | virtual void setTitle( const QString& title = QString::null ) const; |
122 | //virtual void setTitle() const; | ||
123 | 91 | ||
124 | protected: | 92 | protected: |
125 | void init(); | 93 | void init(); |
126 | 94 | ||
127 | private: | 95 | private: |
128 | const QCString _appname; | 96 | const QCString _appname; |