-rw-r--r-- | libopie/odevice.h | 121 |
1 files changed, 71 insertions, 50 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index 2f676ff..38f3787 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -18,100 +18,121 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _LIBOPIE_ODEVICE_H_ | 20 | #ifndef _LIBOPIE_ODEVICE_H_ |
21 | #define _LIBOPIE_ODEVICE_H_ | 21 | #define _LIBOPIE_ODEVICE_H_ |
22 | 22 | ||
23 | #include <qstring.h> | 23 | #include <qstring.h> |
24 | 24 | #include <qnamespace.h> | |
25 | 25 | ||
26 | class ODeviceData; | 26 | class ODeviceData; |
27 | 27 | ||
28 | namespace Opie { | ||
29 | |||
28 | enum OModel { | 30 | enum OModel { |
29 | OMODEL_Unknown, | 31 | Model_Unknown, |
30 | 32 | ||
31 | OMODEL_iPAQ_H31xx, | 33 | Model_iPAQ_H31xx, |
32 | OMODEL_iPAQ_H36xx, | 34 | Model_iPAQ_H36xx, |
33 | OMODEL_iPAQ_H37xx, | 35 | Model_iPAQ_H37xx, |
34 | OMODEL_iPAQ_H38xx, | 36 | Model_iPAQ_H38xx, |
35 | 37 | ||
36 | OMODEL_Zaurus_SL5000 | 38 | Model_Zaurus_SL5000 |
37 | }; | 39 | }; |
38 | 40 | ||
39 | enum OVendor { | 41 | enum OVendor { |
40 | OVENDOR_Unknown, | 42 | Vendor_Unknown, |
41 | 43 | ||
42 | OVENDOR_HP, | 44 | Vendor_HP, |
43 | OVENDOR_Sharp | 45 | Vendor_Sharp |
44 | }; | 46 | }; |
45 | 47 | ||
46 | enum OSystem { | 48 | enum OSystem { |
47 | OSYSTEM_Unknown, | 49 | System_Unknown, |
48 | 50 | ||
49 | OSYSTEM_Familiar, | 51 | System_Familiar, |
50 | OSYSTEM_Zaurus, | 52 | System_Zaurus, |
51 | OSYSTEM_OpenZaurus | 53 | System_OpenZaurus |
52 | }; | 54 | }; |
53 | 55 | ||
54 | enum OLedState { | 56 | enum OLedState { |
55 | OLED_Off, | 57 | Led_Off, |
56 | OLED_On, | 58 | Led_On, |
57 | OLED_BlinkSlow, | 59 | Led_BlinkSlow, |
58 | OLED_BlinkFast | 60 | Led_BlinkFast |
61 | }; | ||
62 | |||
63 | enum OLed { | ||
64 | Led_Mail, | ||
65 | Led_Power, | ||
66 | Led_BlueTooth | ||
67 | }; | ||
68 | |||
69 | enum OHardKey { | ||
70 | HardKey_Datebook = Qt::Key_F9, | ||
71 | HardKey_Contacts = Qt::Key_F10, | ||
72 | HardKey_Menu = Qt::Key_F11, | ||
73 | HardKey_Home = Qt::Key_F12, | ||
74 | HardKey_Mail = Qt::Key_F14, | ||
75 | HardKey_Record = Qt::Key_F24, | ||
76 | HardKey_Suspend = Qt::Key_F34, | ||
77 | HardKey_Backlight = Qt::Key_F35, | ||
59 | }; | 78 | }; |
60 | 79 | ||
61 | 80 | ||
62 | class ODevice | 81 | class ODevice |
63 | { | 82 | { |
83 | private: | ||
84 | ODevice ( const ODevice & ); | ||
85 | |||
86 | protected: | ||
87 | ODevice ( ); | ||
88 | virtual void init ( ); | ||
89 | |||
90 | ODeviceData *d; | ||
91 | |||
64 | public: | 92 | public: |
65 | static ODevice *inst ( ); | 93 | virtual ~ODevice ( ); |
66 | 94 | ||
67 | // system | 95 | static ODevice *inst ( ); |
68 | enum PowerButtonHandler { | ||
69 | KERNEL, | ||
70 | OPIE | ||
71 | }; | ||
72 | 96 | ||
73 | virtual bool setPowerButtonHandler ( PowerButtonHandler h ); | ||
74 | virtual bool suspend ( ); | ||
75 | 97 | ||
76 | virtual bool setDisplayStatus ( bool on ); | ||
77 | virtual bool setDisplayBrightness ( int brightness ); | ||
78 | virtual int displayBrightnessResolution ( ) const; | ||
79 | 98 | ||
80 | // information | 99 | // information |
81 | 100 | ||
82 | QString modelString ( ); | 101 | QString modelString ( ) const; |
83 | OModel model ( ); | 102 | OModel model ( ) const; |
103 | |||
104 | QString vendorString ( ) const; | ||
105 | OVendor vendor ( ) const; | ||
84 | 106 | ||
85 | QString vendorString ( ); | 107 | QString systemString ( ) const; |
86 | OVendor vendor ( ); | 108 | OSystem system ( ) const; |
87 | 109 | ||
88 | QString systemString ( ); | 110 | QString systemVersionString ( ) const; |
89 | OSystem system ( ); | ||
90 | 111 | ||
91 | QString systemVersionString ( ); | 112 | // system |
113 | |||
114 | virtual bool setSoftSuspend ( bool on ); | ||
115 | virtual bool suspend ( ); | ||
116 | |||
117 | virtual bool setDisplayStatus ( bool on ); | ||
118 | virtual bool setDisplayBrightness ( int brightness ); | ||
119 | virtual int displayBrightnessResolution ( ) const; | ||
92 | 120 | ||
93 | // input / output | 121 | // input / output |
94 | 122 | ||
95 | virtual void alarmSound ( ); | 123 | virtual void alarmSound ( ); |
96 | virtual void keySound ( ); | 124 | virtual void keySound ( ); |
97 | virtual void touchSound ( ); | 125 | virtual void touchSound ( ); |
98 | 126 | ||
99 | virtual uint hasLeds ( ) const; | 127 | virtual QValueList <OLed> ledList ( ) const; |
100 | virtual OLedState led ( uint which ) const; | 128 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
101 | virtual bool setLed ( uint which, OLedState st ); | 129 | virtual OLedState ledState ( OLed led ) const; |
102 | 130 | virtual bool setLedState ( OLed led, OLedState st ); | |
103 | virtual ~ODevice ( ); | ||
104 | |||
105 | protected: | ||
106 | ODevice ( ); | ||
107 | virtual void init ( ); | ||
108 | 131 | ||
109 | ODeviceData *d; | 132 | //virtual QValueList <int> keyList ( ) const; |
110 | |||
111 | private: | ||
112 | ODevice ( const ODevice & ); | ||
113 | }; | 133 | }; |
114 | 134 | ||
115 | #endif | 135 | } |
116 | 136 | ||
137 | #endif | ||
117 | 138 | ||