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