summaryrefslogtreecommitdiff
path: root/core/launcher/serverapp.h
Unidiff
Diffstat (limited to 'core/launcher/serverapp.h') (more/less context) (ignore 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
@@ -34,5 +34,24 @@ class 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
@@ -40,4 +59,7 @@ 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
@@ -53,7 +75,10 @@ signals:
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};
@@ -72,2 +97,5 @@ public:
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();
@@ -75,2 +103,3 @@ public:
75signals: 103signals:
104 void menu();
76 void home(); 105 void home();
@@ -83,5 +112,11 @@ signals:
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
@@ -97,3 +132,3 @@ protected slots:
97 void shutdown(ShutdownImpl::Type); 132 void shutdown(ShutdownImpl::Type);
98 void psTimeout(); 133 void apmTimeout();
99 void showSafeMode(); 134 void showSafeMode();
@@ -102,3 +137,8 @@ protected slots:
102 void toggleLight(); 137 void toggleLight();
103 void rereadVolumes(); 138
139private:
140 static ServerApplication *me ();
141 void reloadPowerWarnSettings();
142 KeyFilter *kf;
143
104 144
@@ -106,5 +146,14 @@ 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