summaryrefslogtreecommitdiff
path: root/core/launcher/serverapp.h
authorzecke <zecke>2003-08-25 15:00:50 (UTC)
committer zecke <zecke>2003-08-25 15:00:50 (UTC)
commitbf3c4abb9dff716e098f05852d9a3d8ac8cbcb44 (patch) (unidiff)
treef74d4765868000d27c45771573032515ac8db8be /core/launcher/serverapp.h
parent292b097e7db25dd231381c5b09307a1fbe81a492 (diff)
downloadopie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.zip
opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.gz
opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.bz2
Initial revision
Diffstat (limited to 'core/launcher/serverapp.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/serverapp.h116
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
33class PowerStatus;
34class DesktopPowerAlerter;
35class DeviceButton;
36
37class KeyFilter : public QObject, public QWSServer::KeyboardFilter {
38 Q_OBJECT
39public:
40 KeyFilter(QObject* parent);
41 bool filter(int unicode, int keycode, int modifiers, bool press,
42 bool autoRepeat);
43
44protected:
45 void timerEvent(QTimerEvent*);
46
47signals:
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
56private:
57 int held_tid;
58 const DeviceButton* heldButton;
59};
60
61class ServerApplication : public QPEApplication
62{
63 Q_OBJECT
64public:
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
75signals:
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
86protected:
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
96protected 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
105private:
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