author | schurig <schurig> | 2003-06-06 13:19:33 (UTC) |
---|---|---|
committer | schurig <schurig> | 2003-06-06 13:19:33 (UTC) |
commit | 78a5ebf10450a99211a5e86be1abc0397b749db3 (patch) (unidiff) | |
tree | b23ff8714bf718cefd1360525fce8a32e688611b /libopie/odevice.h | |
parent | fdab8e90076ead49141ed13300e0996ab8dce7da (diff) | |
download | opie-78a5ebf10450a99211a5e86be1abc0397b749db3.zip opie-78a5ebf10450a99211a5e86be1abc0397b749db3.tar.gz opie-78a5ebf10450a99211a5e86be1abc0397b749db3.tar.bz2 |
beginnings of cpu frequency changes
-rw-r--r-- | libopie/odevice.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index 0974e8d..7f6f856 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -1,245 +1,249 @@ | |||
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 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | 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 | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
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 <qobject.h> | 23 | #include <qobject.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qnamespace.h> | 25 | #include <qnamespace.h> |
26 | #include <qstrlist.h> | ||
26 | 27 | ||
27 | #include <opie/odevicebutton.h> | 28 | #include <opie/odevicebutton.h> |
28 | 29 | ||
29 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 30 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
30 | 31 | ||
31 | class ODeviceData; | 32 | class ODeviceData; |
32 | 33 | ||
33 | namespace Opie { | 34 | namespace Opie { |
34 | 35 | ||
35 | /** | 36 | /** |
36 | * The available devices | 37 | * The available devices |
37 | */ | 38 | */ |
38 | enum OModel { | 39 | enum OModel { |
39 | Model_Unknown, // = 0 | 40 | Model_Unknown, // = 0 |
40 | 41 | ||
41 | Model_Series_Mask = 0xff000000, | 42 | Model_Series_Mask = 0xff000000, |
42 | 43 | ||
43 | Model_iPAQ = ( 1 << 24 ), | 44 | Model_iPAQ = ( 1 << 24 ), |
44 | 45 | ||
45 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 46 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
46 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 47 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
47 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 48 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
48 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 49 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
49 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 50 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
50 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 51 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
51 | 52 | ||
52 | Model_Zaurus = ( 2 << 24 ), | 53 | Model_Zaurus = ( 2 << 24 ), |
53 | 54 | ||
54 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 55 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
55 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 56 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
56 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 57 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
57 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 58 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
58 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), | 59 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), |
59 | 60 | ||
60 | Model_SIMpad = ( 3 << 24 ), | 61 | Model_SIMpad = ( 3 << 24 ), |
61 | 62 | ||
62 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 63 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
63 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 64 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
64 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 65 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
65 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 66 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
66 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 67 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
67 | 68 | ||
68 | Model_Ramses = ( 4 << 24 ), | 69 | Model_Ramses = ( 4 << 24 ), |
69 | 70 | ||
70 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 71 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
71 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 72 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
72 | }; | 73 | }; |
73 | 74 | ||
74 | /** | 75 | /** |
75 | * The vendor of the device | 76 | * The vendor of the device |
76 | */ | 77 | */ |
77 | enum OVendor { | 78 | enum OVendor { |
78 | Vendor_Unknown, | 79 | Vendor_Unknown, |
79 | 80 | ||
80 | Vendor_HP, | 81 | Vendor_HP, |
81 | Vendor_Sharp, | 82 | Vendor_Sharp, |
82 | Vendor_SIEMENS, | 83 | Vendor_SIEMENS, |
83 | Vendor_MundN, | 84 | Vendor_MundN, |
84 | }; | 85 | }; |
85 | 86 | ||
86 | /** | 87 | /** |
87 | * The System used | 88 | * The System used |
88 | */ | 89 | */ |
89 | enum OSystem { | 90 | enum OSystem { |
90 | System_Unknown, | 91 | System_Unknown, |
91 | 92 | ||
92 | System_Familiar, | 93 | System_Familiar, |
93 | System_Zaurus, | 94 | System_Zaurus, |
94 | System_OpenZaurus | 95 | System_OpenZaurus |
95 | }; | 96 | }; |
96 | 97 | ||
97 | enum OLedState { | 98 | enum OLedState { |
98 | Led_Off, | 99 | Led_Off, |
99 | Led_On, | 100 | Led_On, |
100 | Led_BlinkSlow, | 101 | Led_BlinkSlow, |
101 | Led_BlinkFast | 102 | Led_BlinkFast |
102 | }; | 103 | }; |
103 | 104 | ||
104 | enum OLed { | 105 | enum OLed { |
105 | Led_Mail, | 106 | Led_Mail, |
106 | Led_Power, | 107 | Led_Power, |
107 | Led_BlueTooth | 108 | Led_BlueTooth |
108 | }; | 109 | }; |
109 | 110 | ||
110 | enum OHardKey { | 111 | enum OHardKey { |
111 | HardKey_Datebook = Qt::Key_F9, | 112 | HardKey_Datebook = Qt::Key_F9, |
112 | HardKey_Contacts = Qt::Key_F10, | 113 | HardKey_Contacts = Qt::Key_F10, |
113 | HardKey_Menu = Qt::Key_F11, | 114 | HardKey_Menu = Qt::Key_F11, |
114 | HardKey_Home = Qt::Key_F12, | 115 | HardKey_Home = Qt::Key_F12, |
115 | HardKey_Mail = Qt::Key_F13, | 116 | HardKey_Mail = Qt::Key_F13, |
116 | HardKey_Record = Qt::Key_F24, | 117 | HardKey_Record = Qt::Key_F24, |
117 | HardKey_Suspend = Qt::Key_F34, | 118 | HardKey_Suspend = Qt::Key_F34, |
118 | HardKey_Backlight = Qt::Key_F35, | 119 | HardKey_Backlight = Qt::Key_F35, |
119 | }; | 120 | }; |
120 | 121 | ||
121 | enum ODirection { | 122 | enum ODirection { |
122 | CW = 0, | 123 | CW = 0, |
123 | CCW = 1, | 124 | CCW = 1, |
124 | Flip = 2, | 125 | Flip = 2, |
125 | }; | 126 | }; |
126 | 127 | ||
127 | /** | 128 | /** |
128 | * A singleton which gives informations about device specefic option | 129 | * A singleton which gives informations about device specefic option |
129 | * like the Hardware used, LEDs, the Base Distribution and | 130 | * like the Hardware used, LEDs, the Base Distribution and |
130 | * hardware key mappings. | 131 | * hardware key mappings. |
131 | * | 132 | * |
132 | * @short A small class for device specefic options | 133 | * @short A small class for device specefic options |
133 | * @see QObject | 134 | * @see QObject |
134 | * @author Robert Griebl | 135 | * @author Robert Griebl |
135 | * @version 1.0 | 136 | * @version 1.0 |
136 | */ | 137 | */ |
137 | class ODevice : public QObject { | 138 | class ODevice : public QObject { |
138 | Q_OBJECT | 139 | Q_OBJECT |
139 | 140 | ||
140 | private: | 141 | private: |
141 | /* disable copy */ | 142 | /* disable copy */ |
142 | ODevice ( const ODevice & ); | 143 | ODevice ( const ODevice & ); |
143 | 144 | ||
144 | protected: | 145 | protected: |
145 | ODevice ( ); | 146 | ODevice ( ); |
146 | virtual void init ( ); | 147 | virtual void init ( ); |
147 | virtual void initButtons ( ); | 148 | virtual void initButtons ( ); |
148 | 149 | ||
149 | ODeviceData *d; | 150 | ODeviceData *d; |
150 | 151 | ||
151 | public: | 152 | public: |
152 | // sandman do we want to allow destructions? -zecke? | 153 | // sandman do we want to allow destructions? -zecke? |
153 | virtual ~ODevice ( ); | 154 | virtual ~ODevice ( ); |
154 | 155 | ||
155 | |||
156 | static ODevice *inst ( ); | 156 | static ODevice *inst ( ); |
157 | 157 | ||
158 | // information | 158 | // information |
159 | 159 | ||
160 | QString modelString ( ) const; | 160 | QString modelString ( ) const; |
161 | OModel model ( ) const; | 161 | OModel model ( ) const; |
162 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } | 162 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } |
163 | 163 | ||
164 | QString vendorString ( ) const; | 164 | QString vendorString ( ) const; |
165 | OVendor vendor ( ) const; | 165 | OVendor vendor ( ) const; |
166 | 166 | ||
167 | QString systemString ( ) const; | 167 | QString systemString ( ) const; |
168 | OSystem system ( ) const; | 168 | OSystem system ( ) const; |
169 | 169 | ||
170 | QString systemVersionString ( ) const; | 170 | QString systemVersionString ( ) const; |
171 | 171 | ||
172 | Transformation rotation ( ) const; | 172 | Transformation rotation ( ) const; |
173 | ODirection direction ( ) const; | 173 | ODirection direction ( ) const; |
174 | 174 | ||
175 | // system | 175 | // system |
176 | 176 | ||
177 | virtual bool setSoftSuspend ( bool on ); | 177 | virtual bool setSoftSuspend ( bool on ); |
178 | virtual bool suspend ( ); | 178 | virtual bool suspend ( ); |
179 | 179 | ||
180 | virtual bool setDisplayStatus ( bool on ); | 180 | virtual bool setDisplayStatus ( bool on ); |
181 | virtual bool setDisplayBrightness ( int brightness ); | 181 | virtual bool setDisplayBrightness ( int brightness ); |
182 | virtual int displayBrightnessResolution ( ) const; | 182 | virtual int displayBrightnessResolution ( ) const; |
183 | virtual bool setDisplayContrast ( int contrast ); | 183 | virtual bool setDisplayContrast ( int contrast ); |
184 | virtual int displayContrastResolution ( ) const; | 184 | virtual int displayContrastResolution ( ) const; |
185 | 185 | ||
186 | // input / output | 186 | // input / output |
187 | //FIXME playAlarmSound and al might be better -zecke | 187 | //FIXME playAlarmSound and al might be better -zecke |
188 | virtual void alarmSound ( ); | 188 | virtual void alarmSound ( ); |
189 | virtual void keySound ( ); | 189 | virtual void keySound ( ); |
190 | virtual void touchSound ( ); | 190 | virtual void touchSound ( ); |
191 | 191 | ||
192 | virtual QValueList <OLed> ledList ( ) const; | 192 | virtual QValueList <OLed> ledList ( ) const; |
193 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 193 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
194 | virtual OLedState ledState ( OLed led ) const; | 194 | virtual OLedState ledState ( OLed led ) const; |
195 | virtual bool setLedState ( OLed led, OLedState st ); | 195 | virtual bool setLedState ( OLed led, OLedState st ); |
196 | 196 | ||
197 | virtual bool hasLightSensor ( ) const; | 197 | virtual bool hasLightSensor ( ) const; |
198 | virtual int readLightSensor ( ); | 198 | virtual int readLightSensor ( ); |
199 | virtual int lightSensorResolution ( ) const; | 199 | virtual int lightSensorResolution ( ) const; |
200 | 200 | ||
201 | QStrList &cpuFrequencies() const; | ||
202 | bool setCpuFrequency(uint index); | ||
203 | uint cpuFrequency() const; | ||
204 | |||
201 | /** | 205 | /** |
202 | * Returns the available buttons on this device. The number and location | 206 | * Returns the available buttons on this device. The number and location |
203 | * of buttons will vary depending on the device. Button numbers will be assigned | 207 | * of buttons will vary depending on the device. Button numbers will be assigned |
204 | * by the device manufacturer and will be from most preferred button to least preffered | 208 | * by the device manufacturer and will be from most preferred button to least preffered |
205 | * button. Note that this list only contains "user mappable" buttons. | 209 | * button. Note that this list only contains "user mappable" buttons. |
206 | */ | 210 | */ |
207 | const QValueList<ODeviceButton> &buttons ( ); | 211 | const QValueList<ODeviceButton> &buttons ( ); |
208 | 212 | ||
209 | /** | 213 | /** |
210 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 214 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
211 | * returns 0L | 215 | * returns 0L |
212 | */ | 216 | */ |
213 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 217 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
214 | 218 | ||
215 | /** | 219 | /** |
216 | * Reassigns the pressed action for \a button. To return to the factory | 220 | * Reassigns the pressed action for \a button. To return to the factory |
217 | * default pass an empty string as \a qcopMessage. | 221 | * default pass an empty string as \a qcopMessage. |
218 | */ | 222 | */ |
219 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 223 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
220 | 224 | ||
221 | /** | 225 | /** |
222 | * Reassigns the held action for \a button. To return to the factory | 226 | * Reassigns the held action for \a button. To return to the factory |
223 | * default pass an empty string as \a qcopMessage. | 227 | * default pass an empty string as \a qcopMessage. |
224 | */ | 228 | */ |
225 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 229 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
226 | 230 | ||
227 | /** | 231 | /** |
228 | * How long (in ms) you have to press a button for a "hold" action | 232 | * How long (in ms) you have to press a button for a "hold" action |
229 | */ | 233 | */ |
230 | uint buttonHoldTime ( ) const; | 234 | uint buttonHoldTime ( ) const; |
231 | 235 | ||
232 | signals: | 236 | signals: |
233 | void buttonMappingChanged ( ); | 237 | void buttonMappingChanged ( ); |
234 | 238 | ||
235 | private slots: | 239 | private slots: |
236 | void systemMessage ( const QCString &, const QByteArray & ); | 240 | void systemMessage ( const QCString &, const QByteArray & ); |
237 | 241 | ||
238 | protected: | 242 | protected: |
239 | void reloadButtonMapping ( ); | 243 | void reloadButtonMapping ( ); |
240 | }; | 244 | }; |
241 | 245 | ||
242 | } | 246 | } |
243 | 247 | ||
244 | #endif | 248 | #endif |
245 | 249 | ||