Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index bccb449..5ee9cca 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -19,50 +19,51 @@ _;:, .> :=|. This program is free software; you can | |||
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 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | 42 | ||
43 | namespace Opie | 43 | namespace Opie{ |
44 | { | 44 | namespace Core{ |
45 | |||
45 | class ODeviceData; | 46 | class ODeviceData; |
46 | /** | 47 | /** |
47 | * The available devices | 48 | * The available devices |
48 | */ | 49 | */ |
49 | enum OModel { | 50 | enum OModel { |
50 | Model_Unknown, // = 0 | 51 | Model_Unknown, // = 0 |
51 | 52 | ||
52 | Model_Series_Mask = 0xff000000, | 53 | Model_Series_Mask = 0xff000000, |
53 | 54 | ||
54 | Model_iPAQ = ( 1 << 24 ), | 55 | Model_iPAQ = ( 1 << 24 ), |
55 | 56 | ||
56 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
57 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
58 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
59 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
60 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
61 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
62 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), | 63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), |
63 | 64 | ||
64 | Model_Jornada = ( 6 << 24 ), | 65 | Model_Jornada = ( 6 << 24 ), |
65 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 66 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
66 | 67 | ||
67 | Model_Zaurus = ( 2 << 24 ), | 68 | Model_Zaurus = ( 2 << 24 ), |
68 | 69 | ||
@@ -229,49 +230,49 @@ public: | |||
229 | virtual void playAlarmSound(); | 230 | virtual void playAlarmSound(); |
230 | virtual void playKeySound(); | 231 | virtual void playKeySound(); |
231 | virtual void playTouchSound(); | 232 | virtual void playTouchSound(); |
232 | 233 | ||
233 | virtual QValueList <OLed> ledList() const; | 234 | virtual QValueList <OLed> ledList() const; |
234 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 235 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
235 | virtual OLedState ledState ( OLed led ) const; | 236 | virtual OLedState ledState ( OLed led ) const; |
236 | virtual bool setLedState ( OLed led, OLedState st ); | 237 | virtual bool setLedState ( OLed led, OLedState st ); |
237 | 238 | ||
238 | virtual bool hasLightSensor() const; | 239 | virtual bool hasLightSensor() const; |
239 | virtual int readLightSensor(); | 240 | virtual int readLightSensor(); |
240 | virtual int lightSensorResolution() const; | 241 | virtual int lightSensorResolution() const; |
241 | 242 | ||
242 | virtual bool hasHingeSensor() const; | 243 | virtual bool hasHingeSensor() const; |
243 | virtual OHingeStatus readHingeSensor(); | 244 | virtual OHingeStatus readHingeSensor(); |
244 | 245 | ||
245 | const QStrList &allowedCpuFrequencies() const; | 246 | const QStrList &allowedCpuFrequencies() const; |
246 | bool setCurrentCpuFrequency(uint index); | 247 | bool setCurrentCpuFrequency(uint index); |
247 | 248 | ||
248 | /** | 249 | /** |
249 | * Returns the available buttons on this device. The number and location | 250 | * Returns the available buttons on this device. The number and location |
250 | * of buttons will vary depending on the device. Button numbers will be assigned | 251 | * of buttons will vary depending on the device. Button numbers will be assigned |
251 | * by the device manufacturer and will be from most preferred button to least preffered | 252 | * by the device manufacturer and will be from most preferred button to least preffered |
252 | * button. Note that this list only contains "user mappable" buttons. | 253 | * button. Note that this list only contains "user mappable" buttons. |
253 | * | 254 | * |
254 | * @todo Make method const and take care of calling initButtons or make that const too | 255 | * @todo Make method const and take care of calling initButtons or make that const too |
255 | * | 256 | * |
256 | */ | 257 | */ |
257 | const QValueList<ODeviceButton> &buttons(); | 258 | const QValueList<ODeviceButton> &buttons(); |
258 | 259 | ||
259 | /** | 260 | /** |
260 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 261 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
261 | * returns 0L | 262 | * returns 0L |
262 | */ | 263 | */ |
263 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 264 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
264 | 265 | ||
265 | /** | 266 | /** |
266 | * Reassigns the pressed action for \a button. To return to the factory | 267 | * Reassigns the pressed action for \a button. To return to the factory |
267 | * default pass an empty string as \a qcopMessage. | 268 | * default pass an empty string as \a qcopMessage. |
268 | */ | 269 | */ |
269 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 270 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
270 | 271 | ||
271 | /** | 272 | /** |
272 | * Reassigns the held action for \a button. To return to the factory | 273 | * Reassigns the held action for \a button. To return to the factory |
273 | * default pass an empty string as \a qcopMessage. | 274 | * default pass an empty string as \a qcopMessage. |
274 | */ | 275 | */ |
275 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 276 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
276 | 277 | ||
277 | /** | 278 | /** |
@@ -293,40 +294,42 @@ protected: | |||
293 | 294 | ||
294 | class ODeviceData { | 295 | class ODeviceData { |
295 | 296 | ||
296 | public: | 297 | public: |
297 | QString m_vendorstr; | 298 | QString m_vendorstr; |
298 | OVendor m_vendor; | 299 | OVendor m_vendor; |
299 | 300 | ||
300 | QString m_modelstr; | 301 | QString m_modelstr; |
301 | OModel m_model; | 302 | OModel m_model; |
302 | 303 | ||
303 | QString m_systemstr; | 304 | QString m_systemstr; |
304 | OSystem m_system; | 305 | OSystem m_system; |
305 | 306 | ||
306 | QString m_sysverstr; | 307 | QString m_sysverstr; |
307 | 308 | ||
308 | Transformation m_rotation; | 309 | Transformation m_rotation; |
309 | ODirection m_direction; | 310 | ODirection m_direction; |
310 | 311 | ||
311 | QValueList <ODeviceButton> *m_buttons; | 312 | QValueList <ODeviceButton> *m_buttons; |
312 | uint m_holdtime; | 313 | uint m_holdtime; |
313 | QStrList *m_cpu_frequencies; | 314 | QStrList *m_cpu_frequencies; |
314 | }; | 315 | }; |
315 | 316 | ||
316 | } | 317 | } |
318 | } | ||
317 | 319 | ||
318 | static inline bool isQWS() | 320 | static inline bool isQWS() |
319 | { | 321 | { |
320 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; | 322 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; |
321 | } | 323 | } |
322 | 324 | ||
323 | static QCString makeChannel ( const char *str ) | 325 | static QCString makeChannel ( const char *str ) |
324 | { | 326 | { |
325 | if ( str && !::strchr ( str, '/' )) | 327 | if ( str && !::strchr ( str, '/' )) |
326 | return QCString ( "QPE/Application/" ) + str; | 328 | return QCString ( "QPE/Application/" ) + str; |
327 | else | 329 | else |
328 | return str; | 330 | return str; |
329 | } | 331 | } |
330 | 332 | ||
333 | |||
331 | #endif | 334 | #endif |
332 | 335 | ||