-rw-r--r-- | libopie/odevice.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index 650a2da..d8ad135 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -1,66 +1,67 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) | 2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) |
3 | Copyright (C) 2003 Holger 'zecke' Freyther (zecke@handhelds.org) | ||
3 | 4 | ||
4 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
8 | 9 | ||
9 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 13 | Library General Public License for more details. |
13 | 14 | ||
14 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
18 | */ | 19 | */ |
19 | 20 | ||
20 | #ifndef _LIBOPIE_ODEVICE_H_ | 21 | #ifndef _LIBOPIE_ODEVICE_H_ |
21 | #define _LIBOPIE_ODEVICE_H_ | 22 | #define _LIBOPIE_ODEVICE_H_ |
22 | 23 | ||
23 | #include <qobject.h> | 24 | #include <qobject.h> |
24 | #include <qstring.h> | 25 | #include <qstring.h> |
25 | #include <qnamespace.h> | 26 | #include <qnamespace.h> |
26 | #include <qstrlist.h> | 27 | #include <qstrlist.h> |
27 | 28 | ||
28 | #include <opie/odevicebutton.h> | 29 | #include <opie/odevicebutton.h> |
29 | 30 | ||
30 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 31 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
31 | 32 | ||
32 | class ODeviceData; | 33 | class ODeviceData; |
33 | 34 | ||
34 | namespace Opie { | 35 | namespace Opie { |
35 | 36 | ||
36 | /** | 37 | /** |
37 | * The available devices | 38 | * The available devices |
38 | */ | 39 | */ |
39 | enum OModel { | 40 | enum OModel { |
40 | Model_Unknown, // = 0 | 41 | Model_Unknown, // = 0 |
41 | 42 | ||
42 | Model_Series_Mask = 0xff000000, | 43 | Model_Series_Mask = 0xff000000, |
43 | 44 | ||
44 | Model_iPAQ = ( 1 << 24 ), | 45 | Model_iPAQ = ( 1 << 24 ), |
45 | 46 | ||
46 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 47 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
47 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 48 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
48 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 49 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
49 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 50 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
50 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 51 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
51 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 52 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
52 | 53 | ||
53 | Model_Zaurus = ( 2 << 24 ), | 54 | Model_Zaurus = ( 2 << 24 ), |
54 | 55 | ||
55 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 56 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
56 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 57 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
57 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 58 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
58 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 59 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
59 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), | 60 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), |
60 | 61 | ||
61 | Model_SIMpad = ( 3 << 24 ), | 62 | Model_SIMpad = ( 3 << 24 ), |
62 | 63 | ||
63 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 64 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
64 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 65 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
65 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 66 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
66 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 67 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
@@ -152,105 +153,105 @@ protected: | |||
152 | public: | 153 | public: |
153 | // sandman do we want to allow destructions? -zecke? | 154 | // sandman do we want to allow destructions? -zecke? |
154 | virtual ~ODevice ( ); | 155 | virtual ~ODevice ( ); |
155 | 156 | ||
156 | static ODevice *inst ( ); | 157 | static ODevice *inst ( ); |
157 | 158 | ||
158 | // information | 159 | // information |
159 | 160 | ||
160 | QString modelString ( ) const; | 161 | QString modelString ( ) const; |
161 | OModel model ( ) const; | 162 | OModel model ( ) const; |
162 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } | 163 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } |
163 | 164 | ||
164 | QString vendorString ( ) const; | 165 | QString vendorString ( ) const; |
165 | OVendor vendor ( ) const; | 166 | OVendor vendor ( ) const; |
166 | 167 | ||
167 | QString systemString ( ) const; | 168 | QString systemString ( ) const; |
168 | OSystem system ( ) const; | 169 | OSystem system ( ) const; |
169 | 170 | ||
170 | QString systemVersionString ( ) const; | 171 | QString systemVersionString ( ) const; |
171 | 172 | ||
172 | Transformation rotation ( ) const; | 173 | Transformation rotation ( ) const; |
173 | ODirection direction ( ) const; | 174 | ODirection direction ( ) const; |
174 | 175 | ||
175 | // system | 176 | // system |
176 | 177 | ||
177 | virtual bool setSoftSuspend ( bool on ); | 178 | virtual bool setSoftSuspend ( bool on ); |
178 | virtual bool suspend ( ); | 179 | virtual bool suspend ( ); |
179 | 180 | ||
180 | virtual bool setDisplayStatus ( bool on ); | 181 | virtual bool setDisplayStatus ( bool on ); |
181 | virtual bool setDisplayBrightness ( int brightness ); | 182 | virtual bool setDisplayBrightness ( int brightness ); |
182 | virtual int displayBrightnessResolution ( ) const; | 183 | virtual int displayBrightnessResolution ( ) const; |
183 | virtual bool setDisplayContrast ( int contrast ); | 184 | virtual bool setDisplayContrast ( int contrast ); |
184 | virtual int displayContrastResolution ( ) const; | 185 | virtual int displayContrastResolution ( ) const; |
185 | 186 | ||
186 | // don't add new virtual methods, use this: | 187 | // don't add new virtual methods, use this: |
187 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 188 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
188 | // and in your subclass do do overwrite | 189 | // and in your subclass do do overwrite |
189 | //protected virtual int virtual_hook(int, void *) | 190 | //protected virtual int virtual_hook(int, void *) |
190 | // which is defined below | 191 | // which is defined below |
191 | 192 | ||
192 | // input / output | 193 | // input / output |
193 | //FIXME playAlarmSound and al might be better -zecke | 194 | //FIXME playAlarmSound and al might be better -zecke |
194 | virtual void alarmSound ( ); | 195 | virtual void alarmSound ( ); |
195 | virtual void keySound ( ); | 196 | virtual void keySound ( ); |
196 | virtual void touchSound ( ); | 197 | virtual void touchSound ( ); |
197 | 198 | ||
198 | virtual QValueList <OLed> ledList ( ) const; | 199 | virtual QValueList <OLed> ledList ( ) const; |
199 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 200 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
200 | virtual OLedState ledState ( OLed led ) const; | 201 | virtual OLedState ledState ( OLed led ) const; |
201 | virtual bool setLedState ( OLed led, OLedState st ); | 202 | virtual bool setLedState ( OLed led, OLedState st ); |
202 | 203 | ||
203 | virtual bool hasLightSensor ( ) const; | 204 | virtual bool hasLightSensor ( ) const; |
204 | virtual int readLightSensor ( ); | 205 | virtual int readLightSensor ( ); |
205 | virtual int lightSensorResolution ( ) const; | 206 | virtual int lightSensorResolution ( ) const; |
206 | 207 | ||
207 | const QStrList &allowedCpuFrequencies() const; | 208 | const QStrList &allowedCpuFrequencies() const; |
208 | bool setCurrentCpuFrequency(uint index); | 209 | bool setCurrentCpuFrequency(uint index); |
209 | 210 | ||
210 | /** | 211 | /** |
211 | * Returns the available buttons on this device. The number and location | 212 | * Returns the available buttons on this device. The number and location |
212 | * of buttons will vary depending on the device. Button numbers will be assigned | 213 | * of buttons will vary depending on the device. Button numbers will be assigned |
213 | * by the device manufacturer and will be from most preferred button to least preffered | 214 | * by the device manufacturer and will be from most preferred button to least preffered |
214 | * button. Note that this list only contains "user mappable" buttons. | 215 | * button. Note that this list only contains "user mappable" buttons. |
215 | */ | 216 | */ |
216 | const QValueList<ODeviceButton> &buttons ( ); | 217 | const QValueList<ODeviceButton> &buttons ( ) /* ### make const */; |
217 | 218 | ||
218 | /** | 219 | /** |
219 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 220 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
220 | * returns 0L | 221 | * returns 0L |
221 | */ | 222 | */ |
222 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 223 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
223 | 224 | ||
224 | /** | 225 | /** |
225 | * Reassigns the pressed action for \a button. To return to the factory | 226 | * Reassigns the pressed action for \a button. To return to the factory |
226 | * default pass an empty string as \a qcopMessage. | 227 | * default pass an empty string as \a qcopMessage. |
227 | */ | 228 | */ |
228 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 229 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
229 | 230 | ||
230 | /** | 231 | /** |
231 | * Reassigns the held action for \a button. To return to the factory | 232 | * Reassigns the held action for \a button. To return to the factory |
232 | * default pass an empty string as \a qcopMessage. | 233 | * default pass an empty string as \a qcopMessage. |
233 | */ | 234 | */ |
234 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 235 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
235 | 236 | ||
236 | /** | 237 | /** |
237 | * How long (in ms) you have to press a button for a "hold" action | 238 | * How long (in ms) you have to press a button for a "hold" action |
238 | */ | 239 | */ |
239 | uint buttonHoldTime ( ) const; | 240 | uint buttonHoldTime ( ) const; |
240 | 241 | ||
241 | signals: | 242 | signals: |
242 | void buttonMappingChanged ( ); | 243 | void buttonMappingChanged ( ); |
243 | 244 | ||
244 | private slots: | 245 | private slots: |
245 | void systemMessage ( const QCString &, const QByteArray & ); | 246 | void systemMessage ( const QCString &, const QByteArray & ); |
246 | 247 | ||
247 | protected: | 248 | protected: |
248 | void reloadButtonMapping ( ); | 249 | void reloadButtonMapping ( ); |
249 | /* ugly virtual hook */ | 250 | /* ugly virtual hook */ |
250 | virtual void virtual_hook( int id, void* data ); | 251 | virtual void virtual_hook( int id, void* data ); |
251 | }; | 252 | }; |
252 | 253 | ||
253 | } | 254 | } |
254 | 255 | ||
255 | #endif | 256 | #endif |
256 | 257 | ||