-rw-r--r-- | libopie2/opiecore/device/odevice.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index f4b3e0e..6f0d036 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -48,96 +48,97 @@ 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 = 0xff000000, | 59 | Model_Series_Mask = 0xff000000, |
60 | 60 | ||
61 | Model_iPAQ = ( 1 << 24 ), | 61 | Model_iPAQ = ( 1 << 24 ), |
62 | 62 | ||
63 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 63 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
71 | 71 | ||
72 | Model_Jornada = ( 6 << 24 ), | 72 | Model_Jornada = ( 6 << 24 ), |
73 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 73 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
74 | 74 | ||
75 | Model_Zaurus = ( 2 << 24 ), | 75 | Model_Zaurus = ( 2 << 24 ), |
76 | 76 | ||
77 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 77 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
78 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 78 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
79 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 79 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
80 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 80 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
81 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), | 81 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), |
82 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), | 82 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), |
83 | 83 | ||
84 | Model_SIMpad = ( 3 << 24 ), | 84 | Model_SIMpad = ( 3 << 24 ), |
85 | 85 | ||
86 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 86 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
87 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 87 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
88 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 88 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
89 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 89 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
90 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 90 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
91 | 91 | ||
92 | Model_Ramses = ( 4 << 24 ), | 92 | Model_Ramses = ( 4 << 24 ), |
93 | 93 | ||
94 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 94 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
95 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 95 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
96 | Model_Ramses_MNCIRX = ( Model_Ramses | 0x000002 ), | ||
96 | 97 | ||
97 | Model_Yopy = ( 5 << 24 ), | 98 | Model_Yopy = ( 5 << 24 ), |
98 | 99 | ||
99 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), | 100 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), |
100 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), | 101 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), |
101 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), | 102 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), |
102 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), | 103 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), |
103 | 104 | ||
104 | Model_Beagle = ( 6 << 24 ), | 105 | Model_Beagle = ( 6 << 24 ), |
105 | 106 | ||
106 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), | 107 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), |
107 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), | 108 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), |
108 | 109 | ||
109 | }; | 110 | }; |
110 | 111 | ||
111 | /** | 112 | /** |
112 | * The vendor of the device | 113 | * The vendor of the device |
113 | */ | 114 | */ |
114 | enum OVendor { | 115 | enum OVendor { |
115 | Vendor_Unknown, | 116 | Vendor_Unknown, |
116 | 117 | ||
117 | Vendor_HP, | 118 | Vendor_HP, |
118 | Vendor_Sharp, | 119 | Vendor_Sharp, |
119 | Vendor_SIEMENS, | 120 | Vendor_SIEMENS, |
120 | Vendor_MundN, | 121 | Vendor_MundN, |
121 | Vendor_GMate, | 122 | Vendor_GMate, |
122 | Vendor_MasterIA, | 123 | Vendor_MasterIA, |
123 | }; | 124 | }; |
124 | 125 | ||
125 | /** | 126 | /** |
126 | * The System used | 127 | * The System used |
127 | */ | 128 | */ |
128 | enum OSystem { | 129 | enum OSystem { |
129 | System_Unknown, | 130 | System_Unknown, |
130 | 131 | ||
131 | System_Familiar, | 132 | System_Familiar, |
132 | System_Zaurus, | 133 | System_Zaurus, |
133 | System_OpenZaurus, | 134 | System_OpenZaurus, |
134 | System_Linupy, | 135 | System_Linupy, |
135 | System_OpenEmbedded, | 136 | System_OpenEmbedded, |
136 | }; | 137 | }; |
137 | 138 | ||
138 | typedef struct { | 139 | typedef struct { |
139 | OSystem system; | 140 | OSystem system; |
140 | char* sysstr; | 141 | char* sysstr; |
141 | char* sysvfile; | 142 | char* sysvfile; |
142 | } ODistribution; | 143 | } ODistribution; |
143 | 144 | ||
@@ -216,97 +217,97 @@ class ODevice : public QObject | |||
216 | private: | 217 | private: |
217 | /* disable copy */ | 218 | /* disable copy */ |
218 | ODevice ( const ODevice & ); | 219 | ODevice ( const ODevice & ); |
219 | 220 | ||
220 | protected: | 221 | protected: |
221 | ODevice(); | 222 | ODevice(); |
222 | virtual void init(const QString&); | 223 | virtual void init(const QString&); |
223 | virtual void initButtons(); | 224 | virtual void initButtons(); |
224 | static void sendSuspendmsg(); | 225 | static void sendSuspendmsg(); |
225 | 226 | ||
226 | ODeviceData *d; | 227 | ODeviceData *d; |
227 | 228 | ||
228 | public: | 229 | public: |
229 | // sandman do we want to allow destructions? -zecke? | 230 | // sandman do we want to allow destructions? -zecke? |
230 | virtual ~ODevice(); | 231 | virtual ~ODevice(); |
231 | 232 | ||
232 | static ODevice *inst(); | 233 | static ODevice *inst(); |
233 | 234 | ||
234 | // information | 235 | // information |
235 | 236 | ||
236 | QString modelString() const; | 237 | QString modelString() const; |
237 | OModel model() const; | 238 | OModel model() const; |
238 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } | 239 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } |
239 | 240 | ||
240 | QString vendorString() const; | 241 | QString vendorString() const; |
241 | OVendor vendor() const; | 242 | OVendor vendor() const; |
242 | 243 | ||
243 | QString systemString() const; | 244 | QString systemString() const; |
244 | OSystem system() const; | 245 | OSystem system() const; |
245 | 246 | ||
246 | QString systemVersionString() const; | 247 | QString systemVersionString() const; |
247 | 248 | ||
248 | virtual Transformation rotation() const; | 249 | virtual Transformation rotation() const; |
249 | virtual ODirection direction() const; | 250 | virtual ODirection direction() const; |
250 | 251 | ||
251 | // system | 252 | // system |
252 | 253 | ||
253 | virtual bool setSoftSuspend ( bool on ); | 254 | virtual bool setSoftSuspend ( bool on ); |
254 | virtual bool suspend(); | 255 | virtual bool suspend(); |
255 | 256 | ||
256 | virtual bool setDisplayStatus ( bool on ); | 257 | virtual bool setDisplayStatus ( bool on ); |
257 | virtual bool setDisplayBrightness ( int brightness ); | 258 | virtual bool setDisplayBrightness ( int brightness ); |
258 | virtual int displayBrightnessResolution() const; | 259 | virtual int displayBrightnessResolution() const; |
259 | virtual bool setDisplayContrast ( int contrast ); | 260 | virtual bool setDisplayContrast ( int contrast ); |
260 | virtual int displayContrastResolution() const; | 261 | virtual int displayContrastResolution() const; |
261 | 262 | ||
262 | // don't add new virtual methods, use this: | 263 | // don't add new virtual methods, use this: |
263 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 264 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
264 | // and in your subclass do do overwrite | 265 | // and in your subclass do overwrite |
265 | // protected virtual int virtual_hook(int, void *) | 266 | // protected virtual int virtual_hook(int, void *) |
266 | // which is defined below | 267 | // which is defined below |
267 | 268 | ||
268 | // input / output | 269 | // input / output |
269 | virtual void playAlarmSound(); | 270 | virtual void playAlarmSound(); |
270 | virtual void playKeySound(); | 271 | virtual void playKeySound(); |
271 | virtual void playTouchSound(); | 272 | virtual void playTouchSound(); |
272 | 273 | ||
273 | virtual QValueList <OLed> ledList() const; | 274 | virtual QValueList <OLed> ledList() const; |
274 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 275 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
275 | virtual OLedState ledState ( OLed led ) const; | 276 | virtual OLedState ledState ( OLed led ) const; |
276 | virtual bool setLedState ( OLed led, OLedState st ); | 277 | virtual bool setLedState ( OLed led, OLedState st ); |
277 | 278 | ||
278 | virtual bool hasLightSensor() const; | 279 | virtual bool hasLightSensor() const; |
279 | virtual int readLightSensor(); | 280 | virtual int readLightSensor(); |
280 | virtual int lightSensorResolution() const; | 281 | virtual int lightSensorResolution() const; |
281 | 282 | ||
282 | virtual bool hasHingeSensor() const; | 283 | virtual bool hasHingeSensor() const; |
283 | virtual OHingeStatus readHingeSensor(); | 284 | virtual OHingeStatus readHingeSensor(); |
284 | 285 | ||
285 | const QStrList &allowedCpuFrequencies() const; | 286 | const QStrList &allowedCpuFrequencies() const; |
286 | bool setCurrentCpuFrequency(uint index); | 287 | bool setCurrentCpuFrequency(uint index); |
287 | 288 | ||
288 | /** | 289 | /** |
289 | * Returns the available buttons on this device. The number and location | 290 | * Returns the available buttons on this device. The number and location |
290 | * of buttons will vary depending on the device. Button numbers will be assigned | 291 | * of buttons will vary depending on the device. Button numbers will be assigned |
291 | * by the device manufacturer and will be from most preferred button to least preffered | 292 | * by the device manufacturer and will be from most preferred button to least preffered |
292 | * button. Note that this list only contains "user mappable" buttons. | 293 | * button. Note that this list only contains "user mappable" buttons. |
293 | * | 294 | * |
294 | * @todo Make method const and take care of calling initButtons or make that const too | 295 | * @todo Make method const and take care of calling initButtons or make that const too |
295 | * | 296 | * |
296 | */ | 297 | */ |
297 | const QValueList<ODeviceButton> &buttons(); | 298 | const QValueList<ODeviceButton> &buttons(); |
298 | 299 | ||
299 | /** | 300 | /** |
300 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 301 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
301 | * returns 0L | 302 | * returns 0L |
302 | */ | 303 | */ |
303 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 304 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
304 | 305 | ||
305 | /** | 306 | /** |
306 | * Reassigns the pressed action for \a button. To return to the factory | 307 | * Reassigns the pressed action for \a button. To return to the factory |
307 | * default pass an empty string as \a qcopMessage. | 308 | * default pass an empty string as \a qcopMessage. |
308 | */ | 309 | */ |
309 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 310 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
310 | 311 | ||
311 | /** | 312 | /** |
312 | * Reassigns the held action for \a button. To return to the factory | 313 | * Reassigns the held action for \a button. To return to the factory |