-rw-r--r-- | core/launcher/serverapp.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h new file mode 100644 index 0000000..60d9c41 --- a/dev/null +++ b/core/launcher/serverapp.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the 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 | |||
21 | #ifndef SERVERAPP_H | ||
22 | #define SERVERAPP_H | ||
23 | |||
24 | #include <qtopia/qpeapplication.h> | ||
25 | |||
26 | #include <qwidget.h> | ||
27 | #ifdef QWS | ||
28 | #include <qwindowsystem_qws.h> | ||
29 | #endif | ||
30 | |||
31 | #include "shutdownimpl.h" | ||
32 | |||
33 | class PowerStatus; | ||
34 | class DesktopPowerAlerter; | ||
35 | class DeviceButton; | ||
36 | |||
37 | class KeyFilter : public QObject, public QWSServer::KeyboardFilter { | ||
38 | Q_OBJECT | ||
39 | public: | ||
40 | KeyFilter(QObject* parent); | ||
41 | bool filter(int unicode, int keycode, int modifiers, bool press, | ||
42 | bool autoRepeat); | ||
43 | |||
44 | protected: | ||
45 | void timerEvent(QTimerEvent*); | ||
46 | |||
47 | signals: | ||
48 | void launch(); | ||
49 | void power(); | ||
50 | void backlight(); | ||
51 | void symbol(); | ||
52 | void numLockStateToggle(); | ||
53 | void capsLockStateToggle(); | ||
54 | void activate(const DeviceButton*,bool); | ||
55 | |||
56 | private: | ||
57 | int held_tid; | ||
58 | const DeviceButton* heldButton; | ||
59 | }; | ||
60 | |||
61 | class ServerApplication : public QPEApplication | ||
62 | { | ||
63 | Q_OBJECT | ||
64 | public: | ||
65 | ServerApplication( int& argc, char **argv, Type t ); | ||
66 | ~ServerApplication(); | ||
67 | |||
68 | static bool doRestart; | ||
69 | static bool allowRestart; | ||
70 | static bool screenLocked(); | ||
71 | static void login(bool at_poweron); | ||
72 | |||
73 | void restart(); | ||
74 | |||
75 | signals: | ||
76 | void home(); | ||
77 | void launch(); | ||
78 | void power(); | ||
79 | void backlight(); | ||
80 | void symbol(); | ||
81 | void numLockStateToggle(); | ||
82 | void capsLockStateToggle(); | ||
83 | void prepareForRestart(); | ||
84 | void activate(const DeviceButton*,bool); | ||
85 | |||
86 | protected: | ||
87 | #ifdef Q_WS_QWS | ||
88 | bool qwsEventFilter( QWSEvent * ); | ||
89 | #endif | ||
90 | void shutdown(); | ||
91 | void checkMemory(); | ||
92 | bool recoverMemory(); | ||
93 | void keyClick(int keycode, bool press, bool repeat); | ||
94 | void screenClick(bool press); | ||
95 | |||
96 | protected slots: | ||
97 | void shutdown(ShutdownImpl::Type); | ||
98 | void psTimeout(); | ||
99 | void showSafeMode(); | ||
100 | void clearSafeMode(); | ||
101 | void togglePower(); | ||
102 | void toggleLight(); | ||
103 | void rereadVolumes(); | ||
104 | |||
105 | private: | ||
106 | DesktopPowerAlerter *pa; | ||
107 | PowerStatus *ps; | ||
108 | bool keyclick; | ||
109 | bool touchclick; | ||
110 | |||
111 | friend class KeyFilter; | ||
112 | }; | ||
113 | |||
114 | |||
115 | #endif // SERVERAPP_H | ||
116 | |||