summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h
index 0a3259a..fe3f24a 100644
--- a/core/launcher/serverapp.h
+++ b/core/launcher/serverapp.h
@@ -1,165 +1,165 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef SERVERAPP_H 21#ifndef SERVERAPP_H
22#define SERVERAPP_H 22#define SERVERAPP_H
23 23
24#include <qtopia/qpeapplication.h> 24#include <qtopia/qpeapplication.h>
25 25
26#include <qwidget.h> 26#include <qwidget.h>
27#ifdef QWS 27#ifdef QWS
28#include <qwindowsystem_qws.h> 28#include <qwindowsystem_qws.h>
29#endif 29#endif
30 30
31#include "shutdownimpl.h" 31#include "shutdownimpl.h"
32 32
33class PowerStatus; 33class PowerStatus;
34class DesktopPowerAlerter; 34class DesktopPowerAlerter;
35 35
36class OpieScreenSaver; 36class OpieScreenSaver;
37namespace Opie { 37namespace Opie {
38 class ODeviceButton; 38 class ODeviceButton;
39} 39}
40 40
41struct QCopKeyRegister { 41struct QCopKeyRegister {
42 QCopKeyRegister(); 42 QCopKeyRegister();
43 QCopKeyRegister( int k, const QCString&, const QCString& ); 43 QCopKeyRegister( int k, const QCString&, const QCString& );
44 int keyCode()const; 44 int keyCode()const;
45 QCString channel()const; 45 QCString channel()const;
46 QCString message()const; 46 QCString message()const;
47 inline bool send(); 47 inline bool send();
48 48
49private: 49private:
50 int m_keyCode; 50 int m_keyCode;
51 QCString m_channel, m_message; 51 QCString m_channel, m_message;
52}; 52};
53 53
54typedef QMap<int, QCopKeyRegister> KeyRegisterList; 54typedef QMap<int, QCopKeyRegister> KeyRegisterList;
55 55
56class KeyFilter : public QObject { 56class KeyFilter : public QObject {
57 Q_OBJECT 57 Q_OBJECT
58public: 58public:
59 KeyFilter(QObject* parent); 59 KeyFilter(QObject* parent);
60 void registerKey( const QCopKeyRegister& ); 60 void registerKey( const QCopKeyRegister& );
61 void unregisterKey( const QCopKeyRegister& ); 61 void unregisterKey( const QCopKeyRegister& );
62 bool checkButtonAction( bool, int, int, int ); 62 bool checkButtonAction( bool, int, int, int );
63 63
64 64
65 65
66protected: 66protected:
67 void timerEvent(QTimerEvent*); 67 void timerEvent(QTimerEvent*);
68 68
69signals: 69signals:
70 void launch(); 70 void launch();
71 void power(); 71 void power();
72 void backlight(); 72 void backlight();
73 void symbol(); 73 void symbol();
74 void numLockStateToggle(); 74 void numLockStateToggle();
75 void capsLockStateToggle(); 75 void capsLockStateToggle();
76 void activate(const Opie::ODeviceButton*,bool); 76 void activate(const Opie::ODeviceButton*,bool);
77 77
78 78
79private: 79private:
80 inline bool keyRegistered( int key ); 80 bool keyRegistered( int key );
81 int held_tid; 81 int held_tid;
82 const Opie::ODeviceButton* heldButton; 82 const Opie::ODeviceButton* heldButton;
83 KeyRegisterList m_keys; 83 KeyRegisterList m_keys;
84}; 84};
85 85
86class ServerApplication : public QPEApplication 86class ServerApplication : public QPEApplication
87{ 87{
88 Q_OBJECT 88 Q_OBJECT
89public: 89public:
90 ServerApplication( int& argc, char **argv, Type t ); 90 ServerApplication( int& argc, char **argv, Type t );
91 ~ServerApplication(); 91 ~ServerApplication();
92 92
93 static bool doRestart; 93 static bool doRestart;
94 static bool allowRestart; 94 static bool allowRestart;
95 static bool screenLocked(); 95 static bool screenLocked();
96 static void login(bool at_poweron); 96 static void login(bool at_poweron);
97 97
98 static void switchLCD ( bool on ); // only for togglePower in Desktop 98 static void switchLCD ( bool on ); // only for togglePower in Desktop
99 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar 99 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar
100 100
101 void restart(); 101 void restart();
102 102
103signals: 103signals:
104 void menu(); 104 void menu();
105 void home(); 105 void home();
106 void launch(); 106 void launch();
107 void power(); 107 void power();
108 void backlight(); 108 void backlight();
109 void symbol(); 109 void symbol();
110 void numLockStateToggle(); 110 void numLockStateToggle();
111 void capsLockStateToggle(); 111 void capsLockStateToggle();
112 void prepareForRestart(); 112 void prepareForRestart();
113 void activate(const Opie::ODeviceButton*,bool); 113 void activate(const Opie::ODeviceButton*,bool);
114 114
115public slots: 115public slots:
116 virtual void systemMessage( const QCString& msg, const QByteArray& ); 116 virtual void systemMessage( const QCString& msg, const QByteArray& );
117 virtual void launcherMessage( const QCString& msg, const QByteArray& ); 117 virtual void launcherMessage( const QCString& msg, const QByteArray& );
118 void rereadVolumes(); 118 void rereadVolumes();
119 119
120protected: 120protected:
121 bool eventFilter( QObject*, QEvent* ); 121 bool eventFilter( QObject*, QEvent* );
122#ifdef Q_WS_QWS 122#ifdef Q_WS_QWS
123 bool qwsEventFilter( QWSEvent * ); 123 bool qwsEventFilter( QWSEvent * );
124#endif 124#endif
125 void shutdown(); 125 void shutdown();
126 void checkMemory(); 126 void checkMemory();
127 bool recoverMemory(); 127 bool recoverMemory();
128 void keyClick(int keycode, bool press, bool repeat); 128 void keyClick(int keycode, bool press, bool repeat);
129 void screenClick(bool press); 129 void screenClick(bool press);
130 130
131protected slots: 131protected slots:
132 void shutdown(ShutdownImpl::Type); 132 void shutdown(ShutdownImpl::Type);
133 void apmTimeout(); 133 void apmTimeout();
134 void showSafeMode(); 134 void showSafeMode();
135 void clearSafeMode(); 135 void clearSafeMode();
136 void togglePower(); 136 void togglePower();
137 void toggleLight(); 137 void toggleLight();
138 138
139private: 139private:
140 static ServerApplication *me (); 140 static ServerApplication *me ();
141 void reloadPowerWarnSettings(); 141 void reloadPowerWarnSettings();
142 KeyFilter *kf; 142 KeyFilter *kf;
143 143
144 144
145private: 145private:
146 DesktopPowerAlerter *pa; 146 DesktopPowerAlerter *pa;
147 PowerStatus *m_ps, *m_ps_last; 147 PowerStatus *m_ps, *m_ps_last;
148 OpieScreenSaver *m_screensaver; 148 OpieScreenSaver *m_screensaver;
149 QTimer *m_apm_timer; 149 QTimer *m_apm_timer;
150 QDateTime m_suspendTime; 150 QDateTime m_suspendTime;
151 int m_powerVeryLow; 151 int m_powerVeryLow;
152 int m_powerCritical; 152 int m_powerCritical;
153 int m_currentPowerLevel; 153 int m_currentPowerLevel;
154 154
155 bool m_keyclick_sound : 1; 155 bool m_keyclick_sound : 1;
156 bool m_screentap_sound : 1; 156 bool m_screentap_sound : 1;
157 bool m_alarm_sound : 1; 157 bool m_alarm_sound : 1;
158 158
159 159
160 friend class KeyFilter; 160 friend class KeyFilter;
161}; 161};
162 162
163 163
164#endif // SERVERAPP_H 164#endif // SERVERAPP_H
165 165