-rw-r--r-- | libopie/odevice.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index 25910b5..8273761 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -94,181 +94,181 @@ enum OVendor { | |||
94 | Vendor_HP, | 94 | Vendor_HP, |
95 | Vendor_Sharp, | 95 | Vendor_Sharp, |
96 | Vendor_SIEMENS, | 96 | Vendor_SIEMENS, |
97 | Vendor_MundN, | 97 | Vendor_MundN, |
98 | Vendor_GMate, | 98 | Vendor_GMate, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * The System used | 102 | * The System used |
103 | */ | 103 | */ |
104 | enum OSystem { | 104 | enum OSystem { |
105 | System_Unknown, | 105 | System_Unknown, |
106 | 106 | ||
107 | System_Familiar, | 107 | System_Familiar, |
108 | System_Zaurus, | 108 | System_Zaurus, |
109 | System_OpenZaurus, | 109 | System_OpenZaurus, |
110 | System_Linupy, | 110 | System_Linupy, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | enum OLedState { | 113 | enum OLedState { |
114 | Led_Off, | 114 | Led_Off, |
115 | Led_On, | 115 | Led_On, |
116 | Led_BlinkSlow, | 116 | Led_BlinkSlow, |
117 | Led_BlinkFast | 117 | Led_BlinkFast |
118 | }; | 118 | }; |
119 | 119 | ||
120 | enum OLed { | 120 | enum OLed { |
121 | Led_Mail, | 121 | Led_Mail, |
122 | Led_Power, | 122 | Led_Power, |
123 | Led_BlueTooth | 123 | Led_BlueTooth |
124 | }; | 124 | }; |
125 | 125 | ||
126 | enum OHardKey { | 126 | enum OHardKey { |
127 | HardKey_Datebook = Qt::Key_F9, | 127 | HardKey_Datebook = Qt::Key_F9, |
128 | HardKey_Contacts = Qt::Key_F10, | 128 | HardKey_Contacts = Qt::Key_F10, |
129 | HardKey_Menu = Qt::Key_F11, | 129 | HardKey_Menu = Qt::Key_F11, |
130 | HardKey_Home = Qt::Key_F12, | 130 | HardKey_Home = Qt::Key_F12, |
131 | HardKey_Mail = Qt::Key_F13, | 131 | HardKey_Mail = Qt::Key_F13, |
132 | HardKey_Record = Qt::Key_F24, | 132 | HardKey_Record = Qt::Key_F24, |
133 | HardKey_Suspend = Qt::Key_F34, | 133 | HardKey_Suspend = Qt::Key_F34, |
134 | HardKey_Backlight = Qt::Key_F35, | 134 | HardKey_Backlight = Qt::Key_F35, |
135 | HardKey_Action = Qt::Key_F10, | 135 | HardKey_Action = Qt::Key_F10, |
136 | HardKey_OK = Qt::Key_F11, | 136 | HardKey_OK = Qt::Key_F11, |
137 | HardKey_End = Qt::Key_F12, | 137 | HardKey_End = Qt::Key_F12, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | enum ODirection { | 140 | enum ODirection { |
141 | CW = 0, | 141 | CW = 0, |
142 | CCW = 1, | 142 | CCW = 1, |
143 | Flip = 2, | 143 | Flip = 2, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * A singleton which gives informations about device specefic option | 147 | * A singleton which gives informations about device specefic option |
148 | * like the Hardware used, LEDs, the Base Distribution and | 148 | * like the Hardware used, LEDs, the Base Distribution and |
149 | * hardware key mappings. | 149 | * hardware key mappings. |
150 | * | 150 | * |
151 | * @short A small class for device specefic options | 151 | * @short A small class for device specefic options |
152 | * @see QObject | 152 | * @see QObject |
153 | * @author Robert Griebl | 153 | * @author Robert Griebl |
154 | * @version 1.0 | 154 | * @version 1.0 |
155 | */ | 155 | */ |
156 | class ODevice : public QObject { | 156 | class ODevice : public QObject { |
157 | Q_OBJECT | 157 | Q_OBJECT |
158 | 158 | ||
159 | private: | 159 | private: |
160 | /* disable copy */ | 160 | /* disable copy */ |
161 | ODevice ( const ODevice & ); | 161 | ODevice ( const ODevice & ); |
162 | 162 | ||
163 | protected: | 163 | protected: |
164 | ODevice ( ); | 164 | ODevice ( ); |
165 | virtual void init ( ); | 165 | virtual void init ( ); |
166 | virtual void initButtons ( ); | 166 | virtual void initButtons ( ); |
167 | 167 | ||
168 | ODeviceData *d; | 168 | ODeviceData *d; |
169 | 169 | ||
170 | public: | 170 | public: |
171 | // sandman do we want to allow destructions? -zecke? | 171 | // sandman do we want to allow destructions? -zecke? |
172 | virtual ~ODevice ( ); | 172 | virtual ~ODevice ( ); |
173 | 173 | ||
174 | static ODevice *inst ( ); | 174 | static ODevice *inst ( ); |
175 | 175 | ||
176 | // information | 176 | // information |
177 | 177 | ||
178 | QString modelString ( ) const; | 178 | QString modelString ( ) const; |
179 | OModel model ( ) const; | 179 | OModel model ( ) const; |
180 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } | 180 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } |
181 | 181 | ||
182 | QString vendorString ( ) const; | 182 | QString vendorString ( ) const; |
183 | OVendor vendor ( ) const; | 183 | OVendor vendor ( ) const; |
184 | 184 | ||
185 | QString systemString ( ) const; | 185 | QString systemString ( ) const; |
186 | OSystem system ( ) const; | 186 | OSystem system ( ) const; |
187 | 187 | ||
188 | QString systemVersionString ( ) const; | 188 | QString systemVersionString ( ) const; |
189 | 189 | ||
190 | Transformation rotation ( ) const; | 190 | virtual Transformation rotation ( ) const; |
191 | ODirection direction ( ) const; | 191 | virtual ODirection direction ( ) const; |
192 | 192 | ||
193 | // system | 193 | // system |
194 | 194 | ||
195 | virtual bool setSoftSuspend ( bool on ); | 195 | virtual bool setSoftSuspend ( bool on ); |
196 | virtual bool suspend ( ); | 196 | virtual bool suspend ( ); |
197 | 197 | ||
198 | virtual bool setDisplayStatus ( bool on ); | 198 | virtual bool setDisplayStatus ( bool on ); |
199 | virtual bool setDisplayBrightness ( int brightness ); | 199 | virtual bool setDisplayBrightness ( int brightness ); |
200 | virtual int displayBrightnessResolution ( ) const; | 200 | virtual int displayBrightnessResolution ( ) const; |
201 | virtual bool setDisplayContrast ( int contrast ); | 201 | virtual bool setDisplayContrast ( int contrast ); |
202 | virtual int displayContrastResolution ( ) const; | 202 | virtual int displayContrastResolution ( ) const; |
203 | 203 | ||
204 | // don't add new virtual methods, use this: | 204 | // don't add new virtual methods, use this: |
205 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 205 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
206 | // and in your subclass do do overwrite | 206 | // and in your subclass do do overwrite |
207 | //protected virtual int virtual_hook(int, void *) | 207 | //protected virtual int virtual_hook(int, void *) |
208 | // which is defined below | 208 | // which is defined below |
209 | 209 | ||
210 | // input / output | 210 | // input / output |
211 | //FIXME playAlarmSound and al might be better -zecke | 211 | //FIXME playAlarmSound and al might be better -zecke |
212 | virtual void alarmSound ( ); | 212 | virtual void alarmSound ( ); |
213 | virtual void keySound ( ); | 213 | virtual void keySound ( ); |
214 | virtual void touchSound ( ); | 214 | virtual void touchSound ( ); |
215 | 215 | ||
216 | virtual QValueList <OLed> ledList ( ) const; | 216 | virtual QValueList <OLed> ledList ( ) const; |
217 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 217 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
218 | virtual OLedState ledState ( OLed led ) const; | 218 | virtual OLedState ledState ( OLed led ) const; |
219 | virtual bool setLedState ( OLed led, OLedState st ); | 219 | virtual bool setLedState ( OLed led, OLedState st ); |
220 | 220 | ||
221 | virtual bool hasLightSensor ( ) const; | 221 | virtual bool hasLightSensor ( ) const; |
222 | virtual int readLightSensor ( ); | 222 | virtual int readLightSensor ( ); |
223 | virtual int lightSensorResolution ( ) const; | 223 | virtual int lightSensorResolution ( ) const; |
224 | 224 | ||
225 | const QStrList &allowedCpuFrequencies() const; | 225 | const QStrList &allowedCpuFrequencies() const; |
226 | bool setCurrentCpuFrequency(uint index); | 226 | bool setCurrentCpuFrequency(uint index); |
227 | 227 | ||
228 | /** | 228 | /** |
229 | * Returns the available buttons on this device. The number and location | 229 | * Returns the available buttons on this device. The number and location |
230 | * of buttons will vary depending on the device. Button numbers will be assigned | 230 | * of buttons will vary depending on the device. Button numbers will be assigned |
231 | * by the device manufacturer and will be from most preferred button to least preffered | 231 | * by the device manufacturer and will be from most preferred button to least preffered |
232 | * button. Note that this list only contains "user mappable" buttons. | 232 | * button. Note that this list only contains "user mappable" buttons. |
233 | */ | 233 | */ |
234 | const QValueList<ODeviceButton> &buttons ( ) /* ### make const */; | 234 | const QValueList<ODeviceButton> &buttons ( ) /* ### make const */; |
235 | 235 | ||
236 | /** | 236 | /** |
237 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 237 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
238 | * returns 0L | 238 | * returns 0L |
239 | */ | 239 | */ |
240 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 240 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
241 | 241 | ||
242 | /** | 242 | /** |
243 | * Reassigns the pressed action for \a button. To return to the factory | 243 | * Reassigns the pressed action for \a button. To return to the factory |
244 | * default pass an empty string as \a qcopMessage. | 244 | * default pass an empty string as \a qcopMessage. |
245 | */ | 245 | */ |
246 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 246 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
247 | 247 | ||
248 | /** | 248 | /** |
249 | * Reassigns the held action for \a button. To return to the factory | 249 | * Reassigns the held action for \a button. To return to the factory |
250 | * default pass an empty string as \a qcopMessage. | 250 | * default pass an empty string as \a qcopMessage. |
251 | */ | 251 | */ |
252 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 252 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * How long (in ms) you have to press a button for a "hold" action | 255 | * How long (in ms) you have to press a button for a "hold" action |
256 | */ | 256 | */ |
257 | uint buttonHoldTime ( ) const; | 257 | uint buttonHoldTime ( ) const; |
258 | 258 | ||
259 | signals: | 259 | signals: |
260 | void buttonMappingChanged ( ); | 260 | void buttonMappingChanged ( ); |
261 | 261 | ||
262 | private slots: | 262 | private slots: |
263 | void systemMessage ( const QCString &, const QByteArray & ); | 263 | void systemMessage ( const QCString &, const QByteArray & ); |
264 | 264 | ||
265 | protected: | 265 | protected: |
266 | void reloadButtonMapping ( ); | 266 | void reloadButtonMapping ( ); |
267 | /* ugly virtual hook */ | 267 | /* ugly virtual hook */ |
268 | virtual void virtual_hook( int id, void* data ); | 268 | virtual void virtual_hook( int id, void* data ); |
269 | }; | 269 | }; |
270 | 270 | ||
271 | } | 271 | } |
272 | 272 | ||
273 | #endif | 273 | #endif |
274 | 274 | ||