Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index cb7a83f..f4b3e0e 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,71 +1,76 @@ | |||
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 | |||
42 | |||
41 | #include <qstrlist.h> | 43 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | 44 | #include <qwindowsystem_qws.h> |
43 | 45 | ||
46 | |||
47 | class Sound; | ||
48 | |||
44 | namespace Opie{ | 49 | namespace Opie{ |
45 | namespace Core{ | 50 | namespace Core{ |
46 | 51 | ||
47 | class ODeviceData; | 52 | class ODeviceData; |
48 | /** | 53 | /** |
49 | * The available devices | 54 | * The available devices |
50 | */ | 55 | */ |
51 | enum OModel { | 56 | enum OModel { |
52 | Model_Unknown, // = 0 | 57 | Model_Unknown, // = 0 |
53 | 58 | ||
54 | Model_Series_Mask = 0xff000000, | 59 | Model_Series_Mask = 0xff000000, |
55 | 60 | ||
56 | Model_iPAQ = ( 1 << 24 ), | 61 | Model_iPAQ = ( 1 << 24 ), |
57 | 62 | ||
58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 63 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
66 | 71 | ||
67 | Model_Jornada = ( 6 << 24 ), | 72 | Model_Jornada = ( 6 << 24 ), |
68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 73 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
69 | 74 | ||
70 | Model_Zaurus = ( 2 << 24 ), | 75 | Model_Zaurus = ( 2 << 24 ), |
71 | 76 | ||
@@ -298,65 +303,71 @@ public: | |||
298 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 303 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
299 | 304 | ||
300 | /** | 305 | /** |
301 | * Reassigns the pressed action for \a button. To return to the factory | 306 | * Reassigns the pressed action for \a button. To return to the factory |
302 | * default pass an empty string as \a qcopMessage. | 307 | * default pass an empty string as \a qcopMessage. |
303 | */ | 308 | */ |
304 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 309 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
305 | 310 | ||
306 | /** | 311 | /** |
307 | * Reassigns the held action for \a button. To return to the factory | 312 | * Reassigns the held action for \a button. To return to the factory |
308 | * default pass an empty string as \a qcopMessage. | 313 | * default pass an empty string as \a qcopMessage. |
309 | */ | 314 | */ |
310 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 315 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
311 | 316 | ||
312 | /** | 317 | /** |
313 | * How long (in ms) you have to press a button for a "hold" action | 318 | * How long (in ms) you have to press a button for a "hold" action |
314 | */ | 319 | */ |
315 | uint buttonHoldTime() const; | 320 | uint buttonHoldTime() const; |
316 | 321 | ||
317 | signals: | 322 | signals: |
318 | void buttonMappingChanged(); | 323 | void buttonMappingChanged(); |
319 | 324 | ||
320 | private slots: | 325 | private slots: |
321 | void systemMessage ( const QCString &, const QByteArray & ); | 326 | void systemMessage ( const QCString &, const QByteArray & ); |
327 | void playingStopped(); | ||
322 | 328 | ||
323 | protected: | 329 | protected: |
324 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); | 330 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); |
325 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); | 331 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); |
326 | void reloadButtonMapping(); | 332 | void reloadButtonMapping(); |
333 | void changeMixerForAlarm( int mixer, const char* file, Sound *snd); | ||
334 | |||
327 | /* ugly virtual hook */ | 335 | /* ugly virtual hook */ |
328 | virtual void virtual_hook( int id, void* data ); | 336 | virtual void virtual_hook( int id, void* data ); |
329 | }; | 337 | }; |
330 | 338 | ||
331 | class ODeviceData { | 339 | class ODeviceData { |
332 | 340 | ||
333 | public: | 341 | public: |
334 | QString m_vendorstr; | 342 | QString m_vendorstr; |
335 | OVendor m_vendor; | 343 | OVendor m_vendor; |
336 | 344 | ||
337 | QString m_modelstr; | 345 | QString m_modelstr; |
338 | OModel m_model; | 346 | OModel m_model; |
339 | 347 | ||
340 | QString m_systemstr; | 348 | QString m_systemstr; |
341 | OSystem m_system; | 349 | OSystem m_system; |
342 | 350 | ||
343 | QString m_sysverstr; | 351 | QString m_sysverstr; |
344 | 352 | ||
345 | Transformation m_rotation; | 353 | Transformation m_rotation; |
346 | ODirection m_direction; | 354 | ODirection m_direction; |
347 | 355 | ||
348 | QValueList <ODeviceButton> *m_buttons; | 356 | QValueList <ODeviceButton> *m_buttons; |
349 | uint m_holdtime; | 357 | uint m_holdtime; |
350 | QStrList *m_cpu_frequencies; | 358 | QStrList *m_cpu_frequencies; |
359 | |||
360 | /* values for changeMixerForAlarm */ | ||
361 | int m_sound, m_vol, m_mixer; | ||
351 | }; | 362 | }; |
352 | 363 | ||
353 | extern bool isQWS(); | 364 | extern bool isQWS(); |
354 | extern QCString makeChannel ( const char *str ); | 365 | extern QCString makeChannel ( const char *str ); |
355 | } | 366 | } |
356 | } | 367 | } |
357 | 368 | ||
358 | 369 | ||
359 | 370 | ||
360 | 371 | ||
361 | #endif | 372 | #endif |
362 | 373 | ||