author | zecke <zecke> | 2003-08-28 14:44:12 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-28 14:44:12 (UTC) |
commit | 20c41310c4669bb0e349dc14745f42a9241a7f1c (patch) (unidiff) | |
tree | 4012e806780606e1a7a3ba9118339650602f248c /core/launcher/serverapp.h | |
parent | e654779ad1aebe1a1c2afa4be9d29cabfd10e143 (diff) | |
download | opie-20c41310c4669bb0e349dc14745f42a9241a7f1c.zip opie-20c41310c4669bb0e349dc14745f42a9241a7f1c.tar.gz opie-20c41310c4669bb0e349dc14745f42a9241a7f1c.tar.bz2 |
Rework to use ODevice for various parts
addition of QCOP messages
New Keyfilter ( ODeviceButton )
keyFilter Fix
togglePower
suspend fixes
-rw-r--r-- | core/launcher/serverapp.h | 73 |
1 files changed, 61 insertions, 12 deletions
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h index 60d9c41..0a3259a 100644 --- a/core/launcher/serverapp.h +++ b/core/launcher/serverapp.h | |||
@@ -32,14 +32,36 @@ | |||
32 | 32 | ||
33 | class PowerStatus; | 33 | class PowerStatus; |
34 | class DesktopPowerAlerter; | 34 | class DesktopPowerAlerter; |
35 | class DeviceButton; | ||
36 | 35 | ||
37 | class KeyFilter : public QObject, public QWSServer::KeyboardFilter { | 36 | class OpieScreenSaver; |
37 | namespace Opie { | ||
38 | class ODeviceButton; | ||
39 | } | ||
40 | |||
41 | struct QCopKeyRegister { | ||
42 | QCopKeyRegister(); | ||
43 | QCopKeyRegister( int k, const QCString&, const QCString& ); | ||
44 | int keyCode()const; | ||
45 | QCString channel()const; | ||
46 | QCString message()const; | ||
47 | inline bool send(); | ||
48 | |||
49 | private: | ||
50 | int m_keyCode; | ||
51 | QCString m_channel, m_message; | ||
52 | }; | ||
53 | |||
54 | typedef QMap<int, QCopKeyRegister> KeyRegisterList; | ||
55 | |||
56 | class KeyFilter : public QObject { | ||
38 | Q_OBJECT | 57 | Q_OBJECT |
39 | public: | 58 | public: |
40 | KeyFilter(QObject* parent); | 59 | KeyFilter(QObject* parent); |
41 | bool filter(int unicode, int keycode, int modifiers, bool press, | 60 | void registerKey( const QCopKeyRegister& ); |
42 | bool autoRepeat); | 61 | void unregisterKey( const QCopKeyRegister& ); |
62 | bool checkButtonAction( bool, int, int, int ); | ||
63 | |||
64 | |||
43 | 65 | ||
44 | protected: | 66 | protected: |
45 | void timerEvent(QTimerEvent*); | 67 | void timerEvent(QTimerEvent*); |
@@ -51,11 +73,14 @@ signals: | |||
51 | void symbol(); | 73 | void symbol(); |
52 | void numLockStateToggle(); | 74 | void numLockStateToggle(); |
53 | void capsLockStateToggle(); | 75 | void capsLockStateToggle(); |
54 | void activate(const DeviceButton*,bool); | 76 | void activate(const Opie::ODeviceButton*,bool); |
77 | |||
55 | 78 | ||
56 | private: | 79 | private: |
80 | inline bool keyRegistered( int key ); | ||
57 | int held_tid; | 81 | int held_tid; |
58 | const DeviceButton* heldButton; | 82 | const Opie::ODeviceButton* heldButton; |
83 | KeyRegisterList m_keys; | ||
59 | }; | 84 | }; |
60 | 85 | ||
61 | class ServerApplication : public QPEApplication | 86 | class ServerApplication : public QPEApplication |
@@ -70,9 +95,13 @@ public: | |||
70 | static bool screenLocked(); | 95 | static bool screenLocked(); |
71 | static void login(bool at_poweron); | 96 | static void login(bool at_poweron); |
72 | 97 | ||
98 | static void switchLCD ( bool on ); // only for togglePower in Desktop | ||
99 | static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar | ||
100 | |||
73 | void restart(); | 101 | void restart(); |
74 | 102 | ||
75 | signals: | 103 | signals: |
104 | void menu(); | ||
76 | void home(); | 105 | void home(); |
77 | void launch(); | 106 | void launch(); |
78 | void power(); | 107 | void power(); |
@@ -81,9 +110,15 @@ signals: | |||
81 | void numLockStateToggle(); | 110 | void numLockStateToggle(); |
82 | void capsLockStateToggle(); | 111 | void capsLockStateToggle(); |
83 | void prepareForRestart(); | 112 | void prepareForRestart(); |
84 | void activate(const DeviceButton*,bool); | 113 | void activate(const Opie::ODeviceButton*,bool); |
114 | |||
115 | public slots: | ||
116 | virtual void systemMessage( const QCString& msg, const QByteArray& ); | ||
117 | virtual void launcherMessage( const QCString& msg, const QByteArray& ); | ||
118 | void rereadVolumes(); | ||
85 | 119 | ||
86 | protected: | 120 | protected: |
121 | bool eventFilter( QObject*, QEvent* ); | ||
87 | #ifdef Q_WS_QWS | 122 | #ifdef Q_WS_QWS |
88 | bool qwsEventFilter( QWSEvent * ); | 123 | bool qwsEventFilter( QWSEvent * ); |
89 | #endif | 124 | #endif |
@@ -95,18 +130,32 @@ protected: | |||
95 | 130 | ||
96 | protected slots: | 131 | protected slots: |
97 | void shutdown(ShutdownImpl::Type); | 132 | void shutdown(ShutdownImpl::Type); |
98 | void psTimeout(); | 133 | void apmTimeout(); |
99 | void showSafeMode(); | 134 | void showSafeMode(); |
100 | void clearSafeMode(); | 135 | void clearSafeMode(); |
101 | void togglePower(); | 136 | void togglePower(); |
102 | void toggleLight(); | 137 | void toggleLight(); |
103 | void rereadVolumes(); | 138 | |
139 | private: | ||
140 | static ServerApplication *me (); | ||
141 | void reloadPowerWarnSettings(); | ||
142 | KeyFilter *kf; | ||
143 | |||
104 | 144 | ||
105 | private: | 145 | private: |
106 | DesktopPowerAlerter *pa; | 146 | DesktopPowerAlerter *pa; |
107 | PowerStatus *ps; | 147 | PowerStatus *m_ps, *m_ps_last; |
108 | bool keyclick; | 148 | OpieScreenSaver *m_screensaver; |
109 | bool touchclick; | 149 | QTimer *m_apm_timer; |
150 | QDateTime m_suspendTime; | ||
151 | int m_powerVeryLow; | ||
152 | int m_powerCritical; | ||
153 | int m_currentPowerLevel; | ||
154 | |||
155 | bool m_keyclick_sound : 1; | ||
156 | bool m_screentap_sound : 1; | ||
157 | bool m_alarm_sound : 1; | ||
158 | |||
110 | 159 | ||
111 | friend class KeyFilter; | 160 | friend class KeyFilter; |
112 | }; | 161 | }; |