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) (side-by-side diff)
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 @@
+/**********************************************************************
+** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SERVERAPP_H
+#define SERVERAPP_H
+
+#include <qtopia/qpeapplication.h>
+
+#include <qwidget.h>
+#ifdef QWS
+#include <qwindowsystem_qws.h>
+#endif
+
+#include "shutdownimpl.h"
+
+class PowerStatus;
+class DesktopPowerAlerter;
+class DeviceButton;
+
+class KeyFilter : public QObject, public QWSServer::KeyboardFilter {
+ Q_OBJECT
+public:
+ KeyFilter(QObject* parent);
+ bool filter(int unicode, int keycode, int modifiers, bool press,
+ bool autoRepeat);
+
+protected:
+ void timerEvent(QTimerEvent*);
+
+signals:
+ void launch();
+ void power();
+ void backlight();
+ void symbol();
+ void numLockStateToggle();
+ void capsLockStateToggle();
+ void activate(const DeviceButton*,bool);
+
+private:
+ int held_tid;
+ const DeviceButton* heldButton;
+};
+
+class ServerApplication : public QPEApplication
+{
+ Q_OBJECT
+public:
+ ServerApplication( int& argc, char **argv, Type t );
+ ~ServerApplication();
+
+ static bool doRestart;
+ static bool allowRestart;
+ static bool screenLocked();
+ static void login(bool at_poweron);
+
+ void restart();
+
+signals:
+ void home();
+ void launch();
+ void power();
+ void backlight();
+ void symbol();
+ void numLockStateToggle();
+ void capsLockStateToggle();
+ void prepareForRestart();
+ void activate(const DeviceButton*,bool);
+
+protected:
+#ifdef Q_WS_QWS
+ bool qwsEventFilter( QWSEvent * );
+#endif
+ void shutdown();
+ void checkMemory();
+ bool recoverMemory();
+ void keyClick(int keycode, bool press, bool repeat);
+ void screenClick(bool press);
+
+protected slots:
+ void shutdown(ShutdownImpl::Type);
+ void psTimeout();
+ void showSafeMode();
+ void clearSafeMode();
+ void togglePower();
+ void toggleLight();
+ void rereadVolumes();
+
+private:
+ DesktopPowerAlerter *pa;
+ PowerStatus *ps;
+ bool keyclick;
+ bool touchclick;
+
+ friend class KeyFilter;
+};
+
+
+#endif // SERVERAPP_H
+