summaryrefslogtreecommitdiff
path: root/core/launcher/serverapp.h
Unidiff
Diffstat (limited to 'core/launcher/serverapp.h') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/serverapp.h73
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
33class PowerStatus; 33class PowerStatus;
34class DesktopPowerAlerter; 34class DesktopPowerAlerter;
35class DeviceButton;
36 35
37class KeyFilter : public QObject, public QWSServer::KeyboardFilter { 36class OpieScreenSaver;
37namespace Opie {
38 class ODeviceButton;
39}
40
41struct 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
49private:
50 int m_keyCode;
51 QCString m_channel, m_message;
52};
53
54typedef QMap<int, QCopKeyRegister> KeyRegisterList;
55
56class KeyFilter : public QObject {
38 Q_OBJECT 57 Q_OBJECT
39public: 58public:
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
44protected: 66protected:
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
56private: 79private:
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
61class ServerApplication : public QPEApplication 86class 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
75signals: 103signals:
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
115public slots:
116 virtual void systemMessage( const QCString& msg, const QByteArray& );
117 virtual void launcherMessage( const QCString& msg, const QByteArray& );
118 void rereadVolumes();
85 119
86protected: 120protected:
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
96protected slots: 131protected 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
139private:
140 static ServerApplication *me ();
141 void reloadPowerWarnSettings();
142 KeyFilter *kf;
143
104 144
105private: 145private:
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};