-rw-r--r-- | library/qpeapplication.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h new file mode 100644 index 0000000..fd5e57d --- a/dev/null +++ b/library/qpeapplication.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef __QPE_APPLICATION_H__ | ||
21 | #define __QPE_APPLICATION_H__ | ||
22 | |||
23 | |||
24 | #include <qapplication.h> | ||
25 | #if defined(_WS_QWS_) && !defined(Q_WS_QWS) | ||
26 | #define Q_WS_QWS | ||
27 | #endif | ||
28 | #include "qpedecoration_qws.h" | ||
29 | #include "timestring.h" | ||
30 | |||
31 | class QCopChannel; | ||
32 | class QPEApplicationData; | ||
33 | class QWSEvent; | ||
34 | class QWSKeyEvent; | ||
35 | |||
36 | class QPEApplication : public QApplication | ||
37 | { | ||
38 | Q_OBJECT | ||
39 | public: | ||
40 | QPEApplication( int& argc, char **argv, Type=GuiClient ); | ||
41 | ~QPEApplication(); | ||
42 | |||
43 | static QString qpeDir(); | ||
44 | static QString documentDir(); | ||
45 | void applyStyle(); | ||
46 | static int defaultRotation(); | ||
47 | static void setDefaultRotation(int r); | ||
48 | static void grabKeyboard(); | ||
49 | static void ungrabKeyboard(); | ||
50 | |||
51 | enum StylusMode { | ||
52 | LeftOnly, | ||
53 | RightOnHold | ||
54 | // RightOnHoldLeftDelayed, etc. | ||
55 | }; | ||
56 | static void setStylusOperation( QWidget*, StylusMode ); | ||
57 | static StylusMode stylusOperation( QWidget* ); | ||
58 | |||
59 | enum InputMethodHint { | ||
60 | Normal, | ||
61 | AlwaysOff, | ||
62 | AlwaysOn | ||
63 | }; | ||
64 | |||
65 | enum screenSaverHint { | ||
66 | Disable = 0, | ||
67 | DisableLightOff = 1, | ||
68 | DisableSuspend = 2, | ||
69 | Enable = 100 | ||
70 | }; | ||
71 | |||
72 | static void setInputMethodHint( QWidget *, InputMethodHint ); | ||
73 | static InputMethodHint inputMethodHint( QWidget * ); | ||
74 | |||
75 | void showMainWidget( QWidget*, bool nomax=FALSE ); | ||
76 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); | ||
77 | |||
78 | static void setKeepRunning(); | ||
79 | bool keepRunning() const; | ||
80 | |||
81 | int exec(); | ||
82 | |||
83 | signals: | ||
84 | void clientMoused(); | ||
85 | void timeChanged(); | ||
86 | void clockChanged( bool pm ); | ||
87 | void volumeChanged( bool muted ); | ||
88 | void appMessage( const QCString& msg, const QByteArray& data); | ||
89 | void weekChanged( bool startOnMonday ); | ||
90 | void dateFormatChanged( DateFormat ); | ||
91 | void flush(); | ||
92 | void reload(); | ||
93 | |||
94 | private slots: | ||
95 | void systemMessage( const QCString &msg, const QByteArray &data ); | ||
96 | void pidMessage( const QCString &msg, const QByteArray &data ); | ||
97 | void removeSenderFromStylusDict(); | ||
98 | void hideOrQuit(); | ||
99 | |||
100 | protected: | ||
101 | bool qwsEventFilter( QWSEvent * ); | ||
102 | void internalSetStyle( const QString &style ); | ||
103 | void prepareForTermination(bool willrestart); | ||
104 | virtual void restart(); | ||
105 | virtual void shutdown(); | ||
106 | bool eventFilter( QObject *, QEvent * ); | ||
107 | void timerEvent( QTimerEvent * ); | ||
108 | bool keyboardGrabbed() const; | ||
109 | bool raiseAppropriateWindow(); | ||
110 | virtual void tryQuit(); | ||
111 | |||
112 | private: | ||
113 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); | ||
114 | |||
115 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
116 | QCopChannel *sysChannel; | ||
117 | QCopChannel *pidChannel; | ||
118 | #endif | ||
119 | QPEApplicationData *d; | ||
120 | }; | ||
121 | |||
122 | |||
123 | #endif | ||
124 | |||