Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 8ae7ffa..791ccb3 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -180,123 +180,125 @@ private: | |||
180 | protected: | 180 | protected: |
181 | ODevice(); | 181 | ODevice(); |
182 | virtual void init(); | 182 | virtual void init(); |
183 | virtual void initButtons(); | 183 | virtual void initButtons(); |
184 | 184 | ||
185 | ODeviceData *d; | 185 | ODeviceData *d; |
186 | 186 | ||
187 | public: | 187 | public: |
188 | // sandman do we want to allow destructions? -zecke? | 188 | // sandman do we want to allow destructions? -zecke? |
189 | virtual ~ODevice(); | 189 | virtual ~ODevice(); |
190 | 190 | ||
191 | static ODevice *inst(); | 191 | static ODevice *inst(); |
192 | 192 | ||
193 | // information | 193 | // information |
194 | 194 | ||
195 | QString modelString() const; | 195 | QString modelString() const; |
196 | OModel model() const; | 196 | OModel model() const; |
197 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } | 197 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } |
198 | 198 | ||
199 | QString vendorString() const; | 199 | QString vendorString() const; |
200 | OVendor vendor() const; | 200 | OVendor vendor() const; |
201 | 201 | ||
202 | QString systemString() const; | 202 | QString systemString() const; |
203 | OSystem system() const; | 203 | OSystem system() const; |
204 | 204 | ||
205 | QString systemVersionString() const; | 205 | QString systemVersionString() const; |
206 | 206 | ||
207 | virtual Transformation rotation() const; | 207 | virtual Transformation rotation() const; |
208 | virtual ODirection direction() const; | 208 | virtual ODirection direction() const; |
209 | 209 | ||
210 | // system | 210 | // system |
211 | 211 | ||
212 | virtual bool setSoftSuspend ( bool on ); | 212 | virtual bool setSoftSuspend ( bool on ); |
213 | virtual bool suspend(); | 213 | virtual bool suspend(); |
214 | 214 | ||
215 | virtual bool setDisplayStatus ( bool on ); | 215 | virtual bool setDisplayStatus ( bool on ); |
216 | virtual bool setDisplayBrightness ( int brightness ); | 216 | virtual bool setDisplayBrightness ( int brightness ); |
217 | virtual int displayBrightnessResolution() const; | 217 | virtual int displayBrightnessResolution() const; |
218 | virtual bool setDisplayContrast ( int contrast ); | 218 | virtual bool setDisplayContrast ( int contrast ); |
219 | virtual int displayContrastResolution() const; | 219 | virtual int displayContrastResolution() const; |
220 | 220 | ||
221 | // don't add new virtual methods, use this: | 221 | // don't add new virtual methods, use this: |
222 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 222 | ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
223 | // and in your subclass do do overwrite | 223 | // and in your subclass do do overwrite |
224 | //protected virtual int virtual_hook(int, void *) | 224 | //protected virtual int virtual_hook(int, void *) |
225 | // which is defined below | 225 | // which is defined below |
226 | 226 | ||
227 | // input / output | 227 | // input / output |
228 | //FIXME playAlarmSound and al might be better -zecke | 228 | virtual void playAlarmSound(); |
229 | virtual void alarmSound(); | 229 | virtual void playKeySound(); |
230 | virtual void keySound(); | 230 | virtual void playTouchSound(); |
231 | virtual void touchSound(); | ||
232 | 231 | ||
233 | virtual QValueList <OLed> ledList() const; | 232 | virtual QValueList <OLed> ledList() const; |
234 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 233 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
235 | virtual OLedState ledState ( OLed led ) const; | 234 | virtual OLedState ledState ( OLed led ) const; |
236 | virtual bool setLedState ( OLed led, OLedState st ); | 235 | virtual bool setLedState ( OLed led, OLedState st ); |
237 | 236 | ||
238 | virtual bool hasLightSensor() const; | 237 | virtual bool hasLightSensor() const; |
239 | virtual int readLightSensor(); | 238 | virtual int readLightSensor(); |
240 | virtual int lightSensorResolution() const; | 239 | virtual int lightSensorResolution() const; |
241 | 240 | ||
242 | virtual bool hasHingeSensor() const; | 241 | virtual bool hasHingeSensor() const; |
243 | virtual OHingeStatus readHingeSensor(); | 242 | virtual OHingeStatus readHingeSensor(); |
244 | 243 | ||
245 | const QStrList &allowedCpuFrequencies() const; | 244 | const QStrList &allowedCpuFrequencies() const; |
246 | bool setCurrentCpuFrequency(uint index); | 245 | bool setCurrentCpuFrequency(uint index); |
247 | 246 | ||
248 | /** | 247 | /** |
249 | * Returns the available buttons on this device. The number and location | 248 | * Returns the available buttons on this device. The number and location |
250 | * of buttons will vary depending on the device. Button numbers will be assigned | 249 | * of buttons will vary depending on the device. Button numbers will be assigned |
251 | * by the device manufacturer and will be from most preferred button to least preffered | 250 | * by the device manufacturer and will be from most preferred button to least preffered |
252 | * button. Note that this list only contains "user mappable" buttons. | 251 | * button. Note that this list only contains "user mappable" buttons. |
252 | * | ||
253 | * @todo Make method const and take care of calling initButtons or make that const too | ||
254 | * | ||
253 | */ | 255 | */ |
254 | const QValueList<ODeviceButton> &buttons() /* ### make const */; | 256 | const QValueList<ODeviceButton> &buttons(); |
255 | 257 | ||
256 | /** | 258 | /** |
257 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 259 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
258 | * returns 0L | 260 | * returns 0L |
259 | */ | 261 | */ |
260 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 262 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
261 | 263 | ||
262 | /** | 264 | /** |
263 | * Reassigns the pressed action for \a button. To return to the factory | 265 | * Reassigns the pressed action for \a button. To return to the factory |
264 | * default pass an empty string as \a qcopMessage. | 266 | * default pass an empty string as \a qcopMessage. |
265 | */ | 267 | */ |
266 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 268 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
267 | 269 | ||
268 | /** | 270 | /** |
269 | * Reassigns the held action for \a button. To return to the factory | 271 | * Reassigns the held action for \a button. To return to the factory |
270 | * default pass an empty string as \a qcopMessage. | 272 | * default pass an empty string as \a qcopMessage. |
271 | */ | 273 | */ |
272 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 274 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
273 | 275 | ||
274 | /** | 276 | /** |
275 | * How long (in ms) you have to press a button for a "hold" action | 277 | * How long (in ms) you have to press a button for a "hold" action |
276 | */ | 278 | */ |
277 | uint buttonHoldTime() const; | 279 | uint buttonHoldTime() const; |
278 | 280 | ||
279 | signals: | 281 | signals: |
280 | void buttonMappingChanged(); | 282 | void buttonMappingChanged(); |
281 | 283 | ||
282 | private slots: | 284 | private slots: |
283 | void systemMessage ( const QCString &, const QByteArray & ); | 285 | void systemMessage ( const QCString &, const QByteArray & ); |
284 | 286 | ||
285 | protected: | 287 | protected: |
286 | void reloadButtonMapping(); | 288 | void reloadButtonMapping(); |
287 | /* ugly virtual hook */ | 289 | /* ugly virtual hook */ |
288 | virtual void virtual_hook( int id, void* data ); | 290 | virtual void virtual_hook( int id, void* data ); |
289 | }; | 291 | }; |
290 | 292 | ||
291 | class ODeviceData { | 293 | class ODeviceData { |
292 | 294 | ||
293 | public: | 295 | public: |
294 | QString m_vendorstr; | 296 | QString m_vendorstr; |
295 | OVendor m_vendor; | 297 | OVendor m_vendor; |
296 | 298 | ||
297 | QString m_modelstr; | 299 | QString m_modelstr; |
298 | OModel m_model; | 300 | OModel m_model; |
299 | 301 | ||
300 | QString m_systemstr; | 302 | QString m_systemstr; |
301 | OSystem m_system; | 303 | OSystem m_system; |
302 | 304 | ||