author | sandman <sandman> | 2002-12-23 00:07:32 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-23 00:07:32 (UTC) |
commit | 6f82a7bad0746d37ff1545717be3fe67e2eed17c (patch) (unidiff) | |
tree | eaf5e6b6d7e7fcc648d25ae7021d1785b80122f2 /core/launcher/desktop.h | |
parent | c513f413c7d901cc9945714c8e7eb47292f63306 (diff) | |
download | opie-6f82a7bad0746d37ff1545717be3fe67e2eed17c.zip opie-6f82a7bad0746d37ff1545717be3fe67e2eed17c.tar.gz opie-6f82a7bad0746d37ff1545717be3fe67e2eed17c.tar.bz2 |
- ported the device button handling to the new ODevice based framework
- removed the key re-grabbing in runningsappbar (not necessary anymore)
- added a few new QCops to make all "special" launcher functions available
via qcop
- added the devicebuttons to the opie-taskbar ipk
-rw-r--r-- | core/launcher/desktop.h | 149 |
1 files changed, 76 insertions, 73 deletions
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index 1f8daa0..6cb7ab2 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -20,11 +20,12 @@ | |||
20 | 20 | ||
21 | #ifndef __DESKTOP_H__ | 21 | #ifndef __DESKTOP_H__ |
22 | #define __DESKTOP_H__ | 22 | #define __DESKTOP_H__ |
23 | 23 | ||
24 | 24 | ||
25 | #include "shutdownimpl.h" | 25 | #include "shutdownimpl.h" |
26 | 26 | ||
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <opie/odevicebutton.h> | ||
28 | 29 | ||
29 | #include <qwidget.h> | 30 | #include <qwidget.h> |
30 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
@@ -41,110 +42,112 @@ class OpieScreenSaver; | |||
41 | 42 | ||
42 | class DesktopApplication : public QPEApplication | 43 | class DesktopApplication : public QPEApplication |
43 | { | 44 | { |
44 | Q_OBJECT | 45 | Q_OBJECT |
45 | public: | 46 | public: |
46 | DesktopApplication( int& argc, char **argv, Type t ); | 47 | DesktopApplication( int& argc, char **argv, Type t ); |
47 | ~DesktopApplication(); | 48 | ~DesktopApplication(); |
49 | |||
50 | static void switchLCD ( bool on ); // only for togglePower in Desktop | ||
48 | 51 | ||
49 | static void switchLCD ( bool on ); // only for togglePower in Desktop | 52 | static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar |
50 | 53 | ||
51 | signals: | 54 | signals: |
52 | void menu(); | 55 | void menu(); |
53 | void home(); | 56 | void home(); |
54 | void datebook(); | 57 | void launch(); |
55 | void contacts(); | 58 | void backlight(); |
56 | void launch(); | 59 | void power(); |
57 | void email(); | 60 | void symbol(); |
58 | void backlight(); | 61 | void numLockStateToggle(); |
59 | void power(); | 62 | void capsLockStateToggle(); |
60 | void symbol(); | 63 | void prepareForRestart(); |
61 | void numLockStateToggle(); | ||
62 | void capsLockStateToggle(); | ||
63 | void prepareForRestart(); | ||
64 | 64 | ||
65 | protected: | 65 | protected: |
66 | #ifdef Q_WS_QWS | 66 | #ifdef Q_WS_QWS |
67 | 67 | ||
68 | bool qwsEventFilter( QWSEvent * ); | 68 | bool qwsEventFilter( QWSEvent * ); |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | void shutdown(); | 71 | void shutdown(); |
72 | void restart(); | 72 | void restart(); |
73 | 73 | ||
74 | public slots: | 74 | public slots: |
75 | virtual void desktopMessage ( const QCString &msg, const QByteArray &data ); | 75 | virtual void systemMessage ( const QCString &msg, const QByteArray &data ); |
76 | virtual void systemMessage ( const QCString &msg, const QByteArray &data ); | 76 | virtual void launcherMessage ( const QCString &msg, const QByteArray &data ); |
77 | void rereadVolumes(); | ||
77 | 78 | ||
78 | protected slots: | 79 | protected slots: |
79 | void shutdown( ShutdownImpl::Type ); | 80 | void shutdown ( ShutdownImpl::Type ); |
80 | void apmTimeout(); | 81 | void apmTimeout ( ); |
81 | void sendCard(); | 82 | void sendHeldAction ( ); |
83 | |||
84 | protected: | ||
85 | virtual bool eventFilter ( QObject *o, QEvent *e ); | ||
86 | void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); | ||
87 | |||
88 | private: | ||
89 | static DesktopApplication *me ( ); | ||
90 | |||
82 | private: | 91 | private: |
83 | void reloadPowerWarnSettings(); | 92 | void reloadPowerWarnSettings(); |
84 | DesktopPowerAlerter *pa; | 93 | DesktopPowerAlerter *pa; |
85 | PowerStatus *m_ps, *m_ps_last; | 94 | PowerStatus *m_ps, *m_ps_last; |
86 | QTimer *cardSendTimer; | 95 | QTimer *cardSendTimer; |
87 | QCopChannel *channel; | 96 | QCopChannel *channel; |
88 | OpieScreenSaver *m_screensaver; | 97 | OpieScreenSaver *m_screensaver; |
89 | QTimer * m_timer; | 98 | QTimer * m_timer; |
90 | int m_powerVeryLow; | 99 | int m_powerVeryLow; |
91 | int m_powerCritical; | 100 | int m_powerCritical; |
92 | int m_currentPowerLevel; | 101 | int m_currentPowerLevel; |
102 | |||
103 | const Opie::ODeviceButton *m_last_button; | ||
104 | QTimer *m_button_timer; | ||
105 | |||
106 | bool m_keyclick_sound : 1; | ||
107 | bool m_screentap_sound : 1; | ||
108 | bool m_alarm_sound : 1; | ||
93 | }; | 109 | }; |
94 | 110 | ||
95 | 111 | ||
96 | class Desktop : public QWidget | 112 | class Desktop : public QWidget |
97 | { | 113 | { |
98 | Q_OBJECT | 114 | Q_OBJECT |
99 | public: | 115 | public: |
100 | Desktop(); | 116 | Desktop(); |
101 | ~Desktop(); | 117 | ~Desktop(); |
102 | |||
103 | static bool screenLocked(); | ||
104 | 118 | ||
105 | void show(); | 119 | static bool screenLocked(); |
106 | void checkMemory(); | ||
107 | 120 | ||
108 | void keyClick(); | 121 | void show(); |
109 | void screenClick(); | 122 | void checkMemory(); |
110 | static void soundAlarm(); | ||
111 | 123 | ||
112 | public slots: | 124 | public slots: |
113 | void raiseDatebook(); | 125 | void execAutoStart(); |
114 | void raiseContacts(); | 126 | void togglePower(); |
115 | void raiseMenu(); | 127 | void toggleLight(); |
116 | void raiseLauncher(); | 128 | void toggleNumLockState(); |
117 | void raiseEmail(); | 129 | void toggleCapsLockState(); |
118 | void execAutoStart(); | 130 | void toggleSymbolInput(); |
119 | void togglePower(); | 131 | void terminateServers(); |
120 | void toggleLight(); | ||
121 | void toggleNumLockState(); | ||
122 | void toggleCapsLockState(); | ||
123 | void toggleSymbolInput(); | ||
124 | void terminateServers(); | ||
125 | void rereadVolumes(); | ||
126 | |||
127 | void home ( ); | ||
128 | 132 | ||
129 | protected: | 133 | protected: |
130 | void executeOrModify( const QString& appLnkFile ); | 134 | void executeOrModify( const QString& appLnkFile ); |
131 | void styleChange( QStyle & ); | 135 | void styleChange( QStyle & ); |
132 | void timerEvent( QTimerEvent *e ); | 136 | void timerEvent( QTimerEvent *e ); |
133 | 137 | ||
134 | QWidget *bg; | 138 | QWidget *bg; |
135 | Launcher *launcher; | 139 | Launcher *launcher; |
136 | TaskBar *tb; | 140 | TaskBar *tb; |
137 | 141 | ||
138 | private: | 142 | private: |
139 | void startTransferServer(); | 143 | void startTransferServer(); |
140 | bool recoverMemory(); | 144 | bool recoverMemory(); |
141 | 145 | ||
142 | QCopBridge *qcopBridge; | 146 | QCopBridge *qcopBridge; |
143 | TransferServer *transferServer; | 147 | TransferServer *transferServer; |
144 | PackageSlave *packageSlave; | 148 | PackageSlave *packageSlave; |
145 | 149 | ||
146 | QDateTime suspendTime; | 150 | QDateTime suspendTime; |
147 | bool keyclick, touchclick, alarmsound; | ||
148 | }; | 151 | }; |
149 | 152 | ||
150 | 153 | ||