Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 2566979..9afb92d 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,397 +1,401 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; version 2 of the License. |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | 41 | ||
42 | 42 | ||
43 | #include <qstrlist.h> | 43 | #include <qstrlist.h> |
44 | #include <qwindowsystem_qws.h> | 44 | #include <qwindowsystem_qws.h> |
45 | 45 | ||
46 | 46 | ||
47 | class Sound; | 47 | class Sound; |
48 | 48 | ||
49 | namespace Opie{ | 49 | namespace Opie{ |
50 | namespace Core{ | 50 | namespace Core{ |
51 | 51 | ||
52 | class ODeviceData; | 52 | class ODeviceData; |
53 | /** | 53 | /** |
54 | * The available devices | 54 | * The available devices |
55 | */ | 55 | */ |
56 | enum OModel { | 56 | enum OModel { |
57 | Model_Unknown, // = 0 | 57 | Model_Unknown, // = 0 |
58 | 58 | ||
59 | Model_Series_Mask = 0xffff0000, | 59 | Model_Series_Mask = 0xffff0000, |
60 | 60 | ||
61 | Model_iPAQ = ( 1 << 16 ), | 61 | Model_iPAQ = ( 1 << 16 ), |
62 | 62 | ||
63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), | 63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), |
64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), | 64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), |
65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), | 65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), |
66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), | 66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), |
67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), | 67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), |
68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), |
69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), |
70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), |
71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), | 71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), |
72 | Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), | 72 | Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), |
73 | Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ), | 73 | Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ), |
74 | Model_Jornada = ( 6 << 16 ), | 74 | Model_Jornada = ( 6 << 16 ), |
75 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), | 75 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), |
76 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), | 76 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), |
77 | 77 | ||
78 | Model_Zaurus = ( 2 << 16 ), | 78 | Model_Zaurus = ( 2 << 16 ), |
79 | 79 | ||
80 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), | 80 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), |
81 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), | 81 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), |
82 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), | 82 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), |
83 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), | 83 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), |
84 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), | 84 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), |
85 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), | 85 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), |
86 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), | 86 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), |
87 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), | 87 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), |
88 | Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), | 88 | Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), |
89 | 89 | ||
90 | Model_SIMpad = ( 3 << 16 ), | 90 | Model_SIMpad = ( 3 << 16 ), |
91 | 91 | ||
92 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), | 92 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), |
93 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), | 93 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), |
94 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), | 94 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), |
95 | Model_SIMpad_SLC = ( Model_SIMpad | 0x0003 ), | 95 | Model_SIMpad_SLC = ( Model_SIMpad | 0x0003 ), |
96 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x0004 ), | 96 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x0004 ), |
97 | 97 | ||
98 | Model_Ramses = ( 4 << 16 ), | 98 | Model_Ramses = ( 4 << 16 ), |
99 | 99 | ||
100 | Model_Ramses_All = ( Model_Ramses | 0xffff ), | 100 | Model_Ramses_All = ( Model_Ramses | 0xffff ), |
101 | Model_Ramses_MNCI = ( Model_Ramses | 0x0001 ), | 101 | Model_Ramses_MNCI = ( Model_Ramses | 0x0001 ), |
102 | Model_Ramses_MNCIRX = ( Model_Ramses | 0x0002 ), | 102 | Model_Ramses_MNCIRX = ( Model_Ramses | 0x0002 ), |
103 | 103 | ||
104 | Model_Yopy = ( 5 << 16 ), | 104 | Model_Yopy = ( 5 << 16 ), |
105 | 105 | ||
106 | Model_Yopy_All = ( Model_Yopy | 0xffff ), | 106 | Model_Yopy_All = ( Model_Yopy | 0xffff ), |
107 | Model_Yopy_3000 = ( Model_Yopy | 0x0001 ), | 107 | Model_Yopy_3000 = ( Model_Yopy | 0x0001 ), |
108 | Model_Yopy_3500 = ( Model_Yopy | 0x0002 ), | 108 | Model_Yopy_3500 = ( Model_Yopy | 0x0002 ), |
109 | Model_Yopy_3700 = ( Model_Yopy | 0x0003 ), | 109 | Model_Yopy_3700 = ( Model_Yopy | 0x0003 ), |
110 | 110 | ||
111 | Model_Beagle = ( 6 << 16 ), | 111 | Model_Beagle = ( 6 << 16 ), |
112 | 112 | ||
113 | Model_Beagle_All = ( Model_Beagle | 0xffff ), | 113 | Model_Beagle_All = ( Model_Beagle | 0xffff ), |
114 | Model_Beagle_PA100 = ( Model_Beagle | 0x0001 ), | 114 | Model_Beagle_PA100 = ( Model_Beagle | 0x0001 ), |
115 | 115 | ||
116 | Model_GenuineIntel = ( 7 << 16 ), | 116 | Model_GenuineIntel = ( 7 << 16 ), |
117 | 117 | ||
118 | Model_MyPal = ( 8 << 16 ), | 118 | Model_MyPal = ( 8 << 16 ), |
119 | 119 | ||
120 | Model_MyPal_All = ( Model_MyPal | 0xffff ), | 120 | Model_MyPal_All = ( Model_MyPal | 0xffff ), |
121 | Model_MyPal_620 = ( Model_MyPal | 0x0001 ), | 121 | Model_MyPal_620 = ( Model_MyPal | 0x0001 ), |
122 | Model_MyPal_716 = ( Model_MyPal | 0x0002 ), | 122 | Model_MyPal_716 = ( Model_MyPal | 0x0002 ), |
123 | Model_MyPal_730 = ( Model_MyPal | 0x0003 ), | 123 | Model_MyPal_730 = ( Model_MyPal | 0x0003 ), |
124 | 124 | ||
125 | Model_HTC = ( 9 << 16 ), | 125 | Model_HTC = ( 9 << 16 ), |
126 | Model_HTC_All = ( Model_HTC | 0xffff ), | 126 | Model_HTC_All = ( Model_HTC | 0xffff ), |
127 | Model_HTC_Universal = ( Model_HTC | 0x0001 ) | 127 | Model_HTC_Universal = ( Model_HTC | 0x0001 ), |
128 | |||
129 | Model_Motorola = ( 9 << 17 ), | ||
130 | Model_Motorola_All = ( Model_Motorola | 0xffff ), | ||
131 | Model_Motorola_EZX = ( Model_Motorola | 0x0001 ), | ||
132 | |||
128 | }; | 133 | }; |
129 | 134 | ||
130 | /** | 135 | /** |
131 | * The vendor of the device | 136 | * The vendor of the device |
132 | */ | 137 | */ |
133 | enum OVendor { | 138 | enum OVendor { |
134 | Vendor_Unknown, | 139 | Vendor_Unknown, |
135 | 140 | ||
136 | Vendor_HP, | 141 | Vendor_HP, |
137 | Vendor_Sharp, | 142 | Vendor_Sharp, |
138 | Vendor_SIEMENS, | 143 | Vendor_SIEMENS, |
139 | Vendor_MundN, | 144 | Vendor_MundN, |
140 | Vendor_GMate, | 145 | Vendor_GMate, |
141 | Vendor_MasterIA, | 146 | Vendor_MasterIA, |
142 | Vendor_GenuineIntel, | 147 | Vendor_GenuineIntel, |
143 | Vendor_Asus, | 148 | Vendor_Asus, |
144 | Vendor_HTC | 149 | Vendor_HTC, |
150 | Vendor_Motorola, | ||
145 | }; | 151 | }; |
146 | 152 | ||
147 | /** | 153 | /** |
148 | * The System used | 154 | * The System used |
149 | */ | 155 | */ |
150 | enum OSystem { | 156 | enum OSystem { |
151 | System_Unknown, | 157 | System_Unknown, |
152 | 158 | ||
153 | System_Familiar, | 159 | System_Familiar, |
154 | System_Zaurus, | 160 | System_Zaurus, |
155 | System_OpenZaurus, | 161 | System_OpenZaurus, |
156 | System_Linupy, | 162 | System_Linupy, |
157 | System_OpenEmbedded, | 163 | System_OpenEmbedded, |
158 | System_PC | 164 | System_PC, |
165 | System_OpenEZX, | ||
166 | System_Angstrom, | ||
159 | }; | 167 | }; |
160 | 168 | ||
161 | typedef struct { | 169 | typedef struct { |
162 | OSystem system; | 170 | OSystem system; |
163 | char* sysstr; | 171 | char* sysstr; |
164 | char* sysvfile; | 172 | char* sysvfile; |
165 | } ODistribution; | 173 | } ODistribution; |
166 | 174 | ||
167 | extern ODistribution distributions[]; | 175 | extern ODistribution distributions[]; |
168 | 176 | ||
169 | 177 | ||
170 | enum OLedState { | 178 | enum OLedState { |
171 | Led_Off, | 179 | Led_Off, |
172 | Led_On, | 180 | Led_On, |
173 | Led_BlinkSlow, | 181 | Led_BlinkSlow, |
174 | Led_BlinkFast | 182 | Led_BlinkFast |
175 | }; | 183 | }; |
176 | 184 | ||
177 | enum OLed { | 185 | enum OLed { |
178 | Led_Mail, | 186 | Led_Mail, |
179 | Led_Power, | 187 | Led_Power, |
180 | Led_BlueTooth | 188 | Led_BlueTooth |
181 | }; | 189 | }; |
182 | 190 | ||
183 | enum OHardKey { | 191 | enum OHardKey { |
184 | HardKey_Datebook = Qt::Key_F9, | 192 | HardKey_Datebook = Qt::Key_F9, |
185 | HardKey_Contacts = Qt::Key_F10, | 193 | HardKey_Contacts = Qt::Key_F10, |
186 | HardKey_Menu = Qt::Key_F11, | 194 | HardKey_Menu = Qt::Key_F11, |
187 | HardKey_Home = Qt::Key_F12, | 195 | HardKey_Home = Qt::Key_F12, |
188 | HardKey_Mail = Qt::Key_F13, | 196 | HardKey_Mail = Qt::Key_F13, |
189 | HardKey_Record = Qt::Key_F24, | 197 | HardKey_Record = Qt::Key_F24, |
190 | HardKey_Suspend = Qt::Key_F34, | 198 | HardKey_Suspend = Qt::Key_F34, |
191 | HardKey_Backlight = Qt::Key_F35, | 199 | HardKey_Backlight = Qt::Key_F35, |
192 | HardKey_Action = Qt::Key_F10, | 200 | HardKey_Action = Qt::Key_F10, |
193 | HardKey_OK = Qt::Key_F11, | 201 | HardKey_OK = Qt::Key_F11, |
194 | HardKey_End = Qt::Key_F12, | 202 | HardKey_End = Qt::Key_F12, |
195 | }; | 203 | }; |
196 | 204 | ||
197 | enum ODirection { | 205 | enum ODirection { |
198 | CW = 0, | 206 | CW = 0, |
199 | CCW = 1, | 207 | CCW = 1, |
200 | Flip = 2, | 208 | Flip = 2, |
201 | }; | 209 | }; |
202 | 210 | ||
203 | enum OHingeStatus { | 211 | enum OHingeStatus { |
204 | CASE_CLOSED = 3, | 212 | CASE_CLOSED = 3, |
205 | CASE_PORTRAIT = 2, | 213 | CASE_PORTRAIT = 2, |
206 | CASE_LANDSCAPE = 0, | 214 | CASE_LANDSCAPE = 0, |
207 | CASE_UNKNOWN = 1, | 215 | CASE_UNKNOWN = 1, |
208 | }; | 216 | }; |
209 | 217 | ||
210 | /* default button for qvfb or such | 218 | /* default button for qvfb or such |
211 | * see odevice.cpp for details. | 219 | * see odevice.cpp for details. |
212 | * hint: manage a user defined button for qvfb? | 220 | * hint: manage a user defined button for qvfb? |
213 | * alwin | 221 | * alwin |
214 | */ | 222 | */ |
215 | struct default_button { | 223 | struct default_button { |
216 | Qt::Key code; | 224 | Qt::Key code; |
217 | char *utext; | 225 | char *utext; |
218 | char *pix; | 226 | char *pix; |
219 | char *fpressedservice; | 227 | char *fpressedservice; |
220 | char *fpressedaction; | 228 | char *fpressedaction; |
221 | char *fheldservice; | 229 | char *fheldservice; |
222 | char *fheldaction; | 230 | char *fheldaction; |
223 | }; | 231 | }; |
224 | 232 | ||
225 | /** | 233 | /** |
226 | * A singleton which gives informations about device specefic option | 234 | * A singleton which gives informations about device specefic option |
227 | * like the Hardware used, LEDs, the Base Distribution and | 235 | * like the Hardware used, LEDs, the Base Distribution and |
228 | * hardware key mappings. | 236 | * hardware key mappings. |
229 | * | 237 | * |
230 | * @short A small class for device specific options | 238 | * @short A small class for device specific options |
231 | * @see QObject | 239 | * @see QObject |
232 | * @author Robert Griebl | 240 | * @author Robert Griebl |
233 | * @version 1.0 | 241 | * @version 1.0 |
234 | */ | 242 | */ |
235 | class ODevice : public QObject | 243 | class ODevice : public QObject |
236 | { | 244 | { |
237 | Q_OBJECT | 245 | Q_OBJECT |
238 | 246 | ||
239 | private: | 247 | private: |
240 | /* disable copy */ | 248 | /* disable copy */ |
241 | ODevice ( const ODevice & ); | 249 | ODevice ( const ODevice & ); |
242 | 250 | ||
243 | protected: | 251 | protected: |
244 | ODevice(); | 252 | ODevice(); |
245 | virtual void init(const QString&); | 253 | virtual void init(const QString&); |
246 | virtual void initButtons(); | 254 | virtual void initButtons(); |
247 | static void sendSuspendmsg(); | 255 | static void sendSuspendmsg(); |
248 | 256 | ||
249 | ODeviceData *d; | 257 | ODeviceData *d; |
250 | 258 | ||
251 | public: | 259 | public: |
252 | // sandman do we want to allow destructions? -zecke? | 260 | // sandman do we want to allow destructions? -zecke? |
253 | virtual ~ODevice(); | 261 | virtual ~ODevice(); |
254 | static ODevice *inst(); | 262 | static ODevice *inst(); |
255 | 263 | ||
256 | // information | 264 | // information |
257 | QString modelString() const; | 265 | QString modelString() const; |
258 | OModel model() const; | 266 | OModel model() const; |
259 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } | 267 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } |
260 | 268 | ||
261 | QString vendorString() const; | 269 | QString vendorString() const; |
262 | OVendor vendor() const; | 270 | OVendor vendor() const; |
263 | 271 | ||
264 | QString systemString() const; | 272 | QString systemString() const; |
265 | OSystem system() const; | 273 | OSystem system() const; |
266 | 274 | ||
267 | QString systemVersionString() const; | 275 | QString systemVersionString() const; |
268 | 276 | ||
269 | virtual Transformation rotation() const; | 277 | virtual Transformation rotation() const; |
270 | virtual ODirection direction() const; | 278 | virtual ODirection direction() const; |
271 | 279 | ||
272 | QString qteDriver() const; | 280 | QString qteDriver() const; |
273 | 281 | ||
274 | // system | 282 | // system |
275 | virtual bool suspend(); | 283 | virtual bool suspend(); |
276 | 284 | ||
277 | virtual bool setDisplayStatus ( bool on ); | 285 | virtual bool setDisplayStatus ( bool on ); |
278 | virtual bool setDisplayBrightness ( int brightness ); | 286 | virtual bool setDisplayBrightness ( int brightness ); |
279 | virtual int displayBrightnessResolution() const; | 287 | virtual int displayBrightnessResolution() const; |
280 | virtual bool setDisplayContrast ( int contrast ); | 288 | virtual bool setDisplayContrast ( int contrast ); |
281 | virtual int displayContrastResolution() const; | 289 | virtual int displayContrastResolution() const; |
282 | 290 | ||
283 | // don't add new virtual methods, use this: | 291 | // don't add new virtual methods, use this: |
284 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 292 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
285 | // and in your subclass do overwrite | 293 | // and in your subclass do overwrite |
286 | // protected virtual int virtual_hook(int, void *) | 294 | // protected virtual int virtual_hook(int, void *) |
287 | // which is defined below | 295 | // which is defined below |
288 | 296 | ||
289 | // input / output | 297 | // input / output |
290 | virtual void playAlarmSound(); | 298 | virtual void playAlarmSound(); |
291 | virtual void playKeySound(); | 299 | virtual void playKeySound(); |
292 | virtual void playTouchSound(); | 300 | virtual void playTouchSound(); |
293 | 301 | ||
294 | virtual QValueList <OLed> ledList() const; | 302 | virtual QValueList <OLed> ledList() const; |
295 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 303 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
296 | virtual OLedState ledState ( OLed led ) const; | 304 | virtual OLedState ledState ( OLed led ) const; |
297 | virtual bool setLedState ( OLed led, OLedState st ); | 305 | virtual bool setLedState ( OLed led, OLedState st ); |
298 | 306 | ||
299 | virtual bool hasLightSensor() const; | 307 | virtual bool hasLightSensor() const; |
300 | virtual int readLightSensor(); | 308 | virtual int readLightSensor(); |
301 | virtual int lightSensorResolution() const; | 309 | virtual int lightSensorResolution() const; |
302 | 310 | ||
303 | virtual bool hasHingeSensor() const; | 311 | virtual bool hasHingeSensor() const; |
304 | virtual OHingeStatus readHingeSensor()const; | 312 | virtual OHingeStatus readHingeSensor()const; |
305 | 313 | ||
306 | const QStrList &allowedCpuFrequencies() const; | 314 | const QStrList &allowedCpuFrequencies() const; |
307 | bool setCurrentCpuFrequency(uint index); | 315 | bool setCurrentCpuFrequency(uint index); |
308 | 316 | ||
309 | /** | 317 | /** |
310 | * Returns the available buttons on this device. The number and location | 318 | * Returns the available buttons on this device. The number and location |
311 | * of buttons will vary depending on the device. Button numbers will be assigned | 319 | * of buttons will vary depending on the device. Button numbers will be assigned |
312 | * by the device manufacturer and will be from most preferred button to least preffered | 320 | * by the device manufacturer and will be from most preferred button to least preffered |
313 | * button. Note that this list only contains "user mappable" buttons. | 321 | * button. Note that this list only contains "user mappable" buttons. |
314 | * | 322 | * |
315 | * @todo Make method const and take care of calling initButtons or make that const too | 323 | * @todo Make method const and take care of calling initButtons or make that const too |
316 | * | 324 | * |
317 | */ | 325 | */ |
318 | const QValueList<ODeviceButton> &buttons(); | 326 | const QValueList<ODeviceButton> &buttons(); |
319 | 327 | ||
320 | /** | 328 | /** |
321 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 329 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
322 | * returns 0L | 330 | * returns 0L |
323 | */ | 331 | */ |
324 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 332 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
325 | 333 | ||
326 | /** | 334 | /** |
327 | * Reassigns the pressed action for \a button. To return to the factory | 335 | * Reassigns the pressed action for \a button. To return to the factory |
328 | * default pass an empty string as \a qcopMessage. | 336 | * default pass an empty string as \a qcopMessage. |
329 | */ | 337 | */ |
330 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 338 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
331 | 339 | ||
332 | /** | 340 | /** |
333 | * Reassigns the held action for \a button. To return to the factory | 341 | * Reassigns the held action for \a button. To return to the factory |
334 | * default pass an empty string as \a qcopMessage. | 342 | * default pass an empty string as \a qcopMessage. |
335 | */ | 343 | */ |
336 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 344 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
337 | 345 | ||
338 | /** | 346 | /** |
339 | * How long (in ms) you have to press a button for a "hold" action | 347 | * How long (in ms) you have to press a button for a "hold" action |
340 | */ | 348 | */ |
341 | uint buttonHoldTime() const; | 349 | uint buttonHoldTime() const; |
342 | 350 | ||
343 | signals: | 351 | signals: |
344 | void buttonMappingChanged(); | 352 | void buttonMappingChanged(); |
345 | 353 | ||
346 | private slots: | 354 | private slots: |
347 | void systemMessage ( const QCString &, const QByteArray & ); | 355 | void systemMessage ( const QCString &, const QByteArray & ); |
348 | void playingStopped(); | 356 | void playingStopped(); |
349 | 357 | ||
350 | protected: | 358 | protected: |
351 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); | 359 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); |
352 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); | 360 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); |
353 | void reloadButtonMapping(); | 361 | void reloadButtonMapping(); |
354 | void changeMixerForAlarm( int mixer, const char* file, Sound *snd); | 362 | void changeMixerForAlarm( int mixer, const char* file, Sound *snd); |
355 | 363 | ||
356 | /* ugly virtual hook */ | 364 | /* ugly virtual hook */ |
357 | virtual void virtual_hook( int id, void* data ); | 365 | virtual void virtual_hook( int id, void* data ); |
358 | }; | 366 | }; |
359 | 367 | ||
360 | class ODeviceData { | 368 | class ODeviceData { |
361 | 369 | ||
362 | public: | 370 | public: |
363 | QString m_vendorstr; | 371 | QString m_vendorstr; |
364 | OVendor m_vendor; | 372 | OVendor m_vendor; |
365 | 373 | ||
366 | QString m_modelstr; | 374 | QString m_modelstr; |
367 | OModel m_model; | 375 | OModel m_model; |
368 | 376 | ||
369 | QString m_systemstr; | 377 | QString m_systemstr; |
370 | OSystem m_system; | 378 | OSystem m_system; |
371 | 379 | ||
372 | QString m_sysverstr; | 380 | QString m_sysverstr; |
373 | 381 | ||
374 | Transformation m_rotation; | 382 | Transformation m_rotation; |
375 | ODirection m_direction; | 383 | ODirection m_direction; |
376 | 384 | ||
377 | QString m_qteDriver; | 385 | QString m_qteDriver; |
378 | 386 | ||
379 | QValueList <ODeviceButton> *m_buttons; | 387 | QValueList <ODeviceButton> *m_buttons; |
380 | uint m_holdtime; | 388 | uint m_holdtime; |
381 | QStrList *m_cpu_frequencies; | 389 | QStrList *m_cpu_frequencies; |
382 | bool m_initializedButtonQcop : 1; | 390 | bool m_initializedButtonQcop : 1; |
383 | 391 | ||
384 | /* values for changeMixerForAlarm */ | 392 | /* values for changeMixerForAlarm */ |
385 | int m_sound, m_vol, m_mixer; | 393 | int m_sound, m_vol, m_mixer; |
386 | }; | 394 | }; |
387 | 395 | ||
388 | extern bool isQWS(); | 396 | extern bool isQWS(); |
389 | extern QCString makeChannel ( const char *str ); | 397 | extern QCString makeChannel ( const char *str ); |
390 | } | 398 | } |
391 | } | 399 | } |
392 | 400 | ||
393 | |||
394 | |||
395 | |||
396 | #endif | 401 | #endif |
397 | |||