author | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
commit | 9084969d2d4fa39d4d2c185695f0c88739a0f95c (patch) (unidiff) | |
tree | 4c76ee5bf61e9f0a883381d2ac68291075cfd541 /libopie2/opiecore/device/odevice.h | |
parent | 3d67a6ef781f59f9db936442a5b44329a0d5c70b (diff) | |
download | opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.zip opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.gz opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.bz2 |
cleanup - odevice is now and for future the one and only friend class
Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 0465d7e..762d3f1 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,89 +1,90 @@ | |||
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 | Copyright (C) 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; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
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 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | ||
42 | 43 | ||
43 | namespace Opie{ | 44 | namespace Opie{ |
44 | namespace Core{ | 45 | namespace Core{ |
45 | 46 | ||
46 | class ODeviceData; | 47 | class ODeviceData; |
47 | /** | 48 | /** |
48 | * The available devices | 49 | * The available devices |
49 | */ | 50 | */ |
50 | enum OModel { | 51 | enum OModel { |
51 | Model_Unknown, // = 0 | 52 | Model_Unknown, // = 0 |
52 | 53 | ||
53 | Model_Series_Mask = 0xff000000, | 54 | Model_Series_Mask = 0xff000000, |
54 | 55 | ||
55 | Model_iPAQ = ( 1 << 24 ), | 56 | Model_iPAQ = ( 1 << 24 ), |
56 | 57 | ||
57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
64 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
65 | 66 | ||
66 | Model_Jornada = ( 6 << 24 ), | 67 | Model_Jornada = ( 6 << 24 ), |
67 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
68 | 69 | ||
69 | Model_Zaurus = ( 2 << 24 ), | 70 | Model_Zaurus = ( 2 << 24 ), |
70 | 71 | ||
71 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 72 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
72 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 73 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
73 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 74 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
74 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 75 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
75 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), | 76 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), |
76 | 77 | ||
77 | Model_SIMpad = ( 3 << 24 ), | 78 | Model_SIMpad = ( 3 << 24 ), |
78 | 79 | ||
79 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 80 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
80 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 81 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
81 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 82 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
82 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 83 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
83 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 84 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
84 | 85 | ||
85 | Model_Ramses = ( 4 << 24 ), | 86 | Model_Ramses = ( 4 << 24 ), |
86 | 87 | ||
87 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 88 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
88 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 89 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
89 | 90 | ||
@@ -274,85 +275,87 @@ public: | |||
274 | 275 | ||
275 | virtual bool hasHingeSensor() const; | 276 | virtual bool hasHingeSensor() const; |
276 | virtual OHingeStatus readHingeSensor(); | 277 | virtual OHingeStatus readHingeSensor(); |
277 | 278 | ||
278 | const QStrList &allowedCpuFrequencies() const; | 279 | const QStrList &allowedCpuFrequencies() const; |
279 | bool setCurrentCpuFrequency(uint index); | 280 | bool setCurrentCpuFrequency(uint index); |
280 | 281 | ||
281 | /** | 282 | /** |
282 | * Returns the available buttons on this device. The number and location | 283 | * Returns the available buttons on this device. The number and location |
283 | * of buttons will vary depending on the device. Button numbers will be assigned | 284 | * of buttons will vary depending on the device. Button numbers will be assigned |
284 | * by the device manufacturer and will be from most preferred button to least preffered | 285 | * by the device manufacturer and will be from most preferred button to least preffered |
285 | * button. Note that this list only contains "user mappable" buttons. | 286 | * button. Note that this list only contains "user mappable" buttons. |
286 | * | 287 | * |
287 | * @todo Make method const and take care of calling initButtons or make that const too | 288 | * @todo Make method const and take care of calling initButtons or make that const too |
288 | * | 289 | * |
289 | */ | 290 | */ |
290 | const QValueList<ODeviceButton> &buttons(); | 291 | const QValueList<ODeviceButton> &buttons(); |
291 | 292 | ||
292 | /** | 293 | /** |
293 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 294 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
294 | * returns 0L | 295 | * returns 0L |
295 | */ | 296 | */ |
296 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 297 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
297 | 298 | ||
298 | /** | 299 | /** |
299 | * Reassigns the pressed action for \a button. To return to the factory | 300 | * Reassigns the pressed action for \a button. To return to the factory |
300 | * default pass an empty string as \a qcopMessage. | 301 | * default pass an empty string as \a qcopMessage. |
301 | */ | 302 | */ |
302 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 303 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
303 | 304 | ||
304 | /** | 305 | /** |
305 | * Reassigns the held action for \a button. To return to the factory | 306 | * Reassigns the held action for \a button. To return to the factory |
306 | * default pass an empty string as \a qcopMessage. | 307 | * default pass an empty string as \a qcopMessage. |
307 | */ | 308 | */ |
308 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 309 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
309 | 310 | ||
310 | /** | 311 | /** |
311 | * How long (in ms) you have to press a button for a "hold" action | 312 | * How long (in ms) you have to press a button for a "hold" action |
312 | */ | 313 | */ |
313 | uint buttonHoldTime() const; | 314 | uint buttonHoldTime() const; |
314 | 315 | ||
315 | signals: | 316 | signals: |
316 | void buttonMappingChanged(); | 317 | void buttonMappingChanged(); |
317 | 318 | ||
318 | private slots: | 319 | private slots: |
319 | void systemMessage ( const QCString &, const QByteArray & ); | 320 | void systemMessage ( const QCString &, const QByteArray & ); |
320 | 321 | ||
321 | protected: | 322 | protected: |
323 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
324 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
322 | void reloadButtonMapping(); | 325 | void reloadButtonMapping(); |
323 | /* ugly virtual hook */ | 326 | /* ugly virtual hook */ |
324 | virtual void virtual_hook( int id, void* data ); | 327 | virtual void virtual_hook( int id, void* data ); |
325 | }; | 328 | }; |
326 | 329 | ||
327 | class ODeviceData { | 330 | class ODeviceData { |
328 | 331 | ||
329 | public: | 332 | public: |
330 | QString m_vendorstr; | 333 | QString m_vendorstr; |
331 | OVendor m_vendor; | 334 | OVendor m_vendor; |
332 | 335 | ||
333 | QString m_modelstr; | 336 | QString m_modelstr; |
334 | OModel m_model; | 337 | OModel m_model; |
335 | 338 | ||
336 | QString m_systemstr; | 339 | QString m_systemstr; |
337 | OSystem m_system; | 340 | OSystem m_system; |
338 | 341 | ||
339 | QString m_sysverstr; | 342 | QString m_sysverstr; |
340 | 343 | ||
341 | Transformation m_rotation; | 344 | Transformation m_rotation; |
342 | ODirection m_direction; | 345 | ODirection m_direction; |
343 | 346 | ||
344 | QValueList <ODeviceButton> *m_buttons; | 347 | QValueList <ODeviceButton> *m_buttons; |
345 | uint m_holdtime; | 348 | uint m_holdtime; |
346 | QStrList *m_cpu_frequencies; | 349 | QStrList *m_cpu_frequencies; |
347 | }; | 350 | }; |
348 | 351 | ||
349 | extern bool isQWS(); | 352 | extern bool isQWS(); |
350 | extern QCString makeChannel ( const char *str ); | 353 | extern QCString makeChannel ( const char *str ); |
351 | } | 354 | } |
352 | } | 355 | } |
353 | 356 | ||
354 | 357 | ||
355 | 358 | ||
356 | 359 | ||
357 | #endif | 360 | #endif |
358 | 361 | ||