summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
Unidiff
Diffstat (limited to 'libopie/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 35e3eff..46f1614 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -1,273 +1,274 @@
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 Copyright (C) 2003 Holger 'zecke' Freyther (zecke@handhelds.org)
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 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.
9 9
10 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,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 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
16 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
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#ifndef _LIBOPIE_ODEVICE_H_ 21#ifndef _LIBOPIE_ODEVICE_H_
22#define _LIBOPIE_ODEVICE_H_ 22#define _LIBOPIE_ODEVICE_H_
23 23
24#include <qobject.h> 24#include <qobject.h>
25#include <qstring.h> 25#include <qstring.h>
26#include <qnamespace.h> 26#include <qnamespace.h>
27#include <qstrlist.h> 27#include <qstrlist.h>
28 28
29#include <opie/odevicebutton.h> 29#include <opie/odevicebutton.h>
30 30
31#include <qpe/qpeapplication.h> /* for Transformation enum.. */ 31#include <qpe/qpeapplication.h> /* for Transformation enum.. */
32 32
33class ODeviceData; 33class ODeviceData;
34 34
35namespace Opie { 35namespace Opie {
36 36
37/** 37/**
38 * The available devices 38 * The available devices
39 */ 39 */
40enum OModel { 40enum OModel {
41 Model_Unknown, // = 0 41 Model_Unknown, // = 0
42 42
43 Model_Series_Mask = 0xff000000, 43 Model_Series_Mask = 0xff000000,
44 44
45 Model_iPAQ = ( 1 << 24 ), 45 Model_iPAQ = ( 1 << 24 ),
46 46
47 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), 47 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
48 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), 48 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ),
49 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), 49 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
50 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), 50 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
51 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), 51 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
52 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), 52 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
53 Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ),
53 54
54 Model_Jornada = ( 6 << 24 ), 55 Model_Jornada = ( 6 << 24 ),
55 Model_Jornada_56x = ( Model_Jornada | 0x000001 ), 56 Model_Jornada_56x = ( Model_Jornada | 0x000001 ),
56 57
57 Model_Zaurus = ( 2 << 24 ), 58 Model_Zaurus = ( 2 << 24 ),
58 59
59 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), 60 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
60 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), 61 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ),
61 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), 62 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ),
62 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), 63 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ),
63 Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), 64 Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ),
64 65
65 Model_SIMpad = ( 3 << 24 ), 66 Model_SIMpad = ( 3 << 24 ),
66 67
67 Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), 68 Model_SIMpad_All = ( Model_SIMpad | 0xffffff ),
68 Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), 69 Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ),
69 Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), 70 Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ),
70 Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), 71 Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ),
71 Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), 72 Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ),
72 73
73 Model_Ramses = ( 4 << 24 ), 74 Model_Ramses = ( 4 << 24 ),
74 75
75 Model_Ramses_All = ( Model_Ramses | 0xffffff ), 76 Model_Ramses_All = ( Model_Ramses | 0xffffff ),
76 Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), 77 Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ),
77 78
78 Model_Yopy = ( 5 << 24 ), 79 Model_Yopy = ( 5 << 24 ),
79 80
80 Model_Yopy_All = ( Model_Yopy | 0xffffff ), 81 Model_Yopy_All = ( Model_Yopy | 0xffffff ),
81 Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), 82 Model_Yopy_3000 = ( Model_Yopy | 0x000001 ),
82 Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), 83 Model_Yopy_3500 = ( Model_Yopy | 0x000002 ),
83 Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), 84 Model_Yopy_3700 = ( Model_Yopy | 0x000003 ),
84 85
85}; 86};
86 87
87/** 88/**
88 * The vendor of the device 89 * The vendor of the device
89 */ 90 */
90enum OVendor { 91enum OVendor {
91 Vendor_Unknown, 92 Vendor_Unknown,
92 93
93 Vendor_HP, 94 Vendor_HP,
94 Vendor_Sharp, 95 Vendor_Sharp,
95 Vendor_SIEMENS, 96 Vendor_SIEMENS,
96 Vendor_MundN, 97 Vendor_MundN,
97 Vendor_GMate, 98 Vendor_GMate,
98}; 99};
99 100
100/** 101/**
101 * The System used 102 * The System used
102 */ 103 */
103enum OSystem { 104enum OSystem {
104 System_Unknown, 105 System_Unknown,
105 106
106 System_Familiar, 107 System_Familiar,
107 System_Zaurus, 108 System_Zaurus,
108 System_OpenZaurus, 109 System_OpenZaurus,
109 System_Linupy, 110 System_Linupy,
110}; 111};
111 112
112enum OLedState { 113enum OLedState {
113 Led_Off, 114 Led_Off,
114 Led_On, 115 Led_On,
115 Led_BlinkSlow, 116 Led_BlinkSlow,
116 Led_BlinkFast 117 Led_BlinkFast
117}; 118};
118 119
119enum OLed { 120enum OLed {
120 Led_Mail, 121 Led_Mail,
121 Led_Power, 122 Led_Power,
122 Led_BlueTooth 123 Led_BlueTooth
123}; 124};
124 125
125enum OHardKey { 126enum OHardKey {
126 HardKey_Datebook = Qt::Key_F9, 127 HardKey_Datebook = Qt::Key_F9,
127 HardKey_Contacts = Qt::Key_F10, 128 HardKey_Contacts = Qt::Key_F10,
128 HardKey_Menu = Qt::Key_F11, 129 HardKey_Menu = Qt::Key_F11,
129 HardKey_Home = Qt::Key_F12, 130 HardKey_Home = Qt::Key_F12,
130 HardKey_Mail = Qt::Key_F13, 131 HardKey_Mail = Qt::Key_F13,
131 HardKey_Record = Qt::Key_F24, 132 HardKey_Record = Qt::Key_F24,
132 HardKey_Suspend = Qt::Key_F34, 133 HardKey_Suspend = Qt::Key_F34,
133 HardKey_Backlight = Qt::Key_F35, 134 HardKey_Backlight = Qt::Key_F35,
134 HardKey_Action = Qt::Key_F10, 135 HardKey_Action = Qt::Key_F10,
135 HardKey_OK = Qt::Key_F11, 136 HardKey_OK = Qt::Key_F11,
136 HardKey_End = Qt::Key_F12, 137 HardKey_End = Qt::Key_F12,
137}; 138};
138 139
139enum ODirection { 140enum ODirection {
140 CW = 0, 141 CW = 0,
141 CCW = 1, 142 CCW = 1,
142 Flip = 2, 143 Flip = 2,
143}; 144};
144 145
145/** 146/**
146 * A singleton which gives informations about device specefic option 147 * A singleton which gives informations about device specefic option
147 * like the Hardware used, LEDs, the Base Distribution and 148 * like the Hardware used, LEDs, the Base Distribution and
148 * hardware key mappings. 149 * hardware key mappings.
149 * 150 *
150 * @short A small class for device specefic options 151 * @short A small class for device specefic options
151 * @see QObject 152 * @see QObject
152 * @author Robert Griebl 153 * @author Robert Griebl
153 * @version 1.0 154 * @version 1.0
154 */ 155 */
155class ODevice : public QObject { 156class ODevice : public QObject {
156 Q_OBJECT 157 Q_OBJECT
157 158
158private: 159private:
159 /* disable copy */ 160 /* disable copy */
160 ODevice ( const ODevice & ); 161 ODevice ( const ODevice & );
161 162
162protected: 163protected:
163 ODevice ( ); 164 ODevice ( );
164 virtual void init ( ); 165 virtual void init ( );
165 virtual void initButtons ( ); 166 virtual void initButtons ( );
166 167
167 ODeviceData *d; 168 ODeviceData *d;
168 169
169public: 170public:
170 // sandman do we want to allow destructions? -zecke? 171 // sandman do we want to allow destructions? -zecke?
171 virtual ~ODevice ( ); 172 virtual ~ODevice ( );
172 173
173 static ODevice *inst ( ); 174 static ODevice *inst ( );
174 175
175 // information 176 // information
176 177
177 QString modelString ( ) const; 178 QString modelString ( ) const;
178 OModel model ( ) const; 179 OModel model ( ) const;
179 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } 180 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); }
180 181
181 QString vendorString ( ) const; 182 QString vendorString ( ) const;
182 OVendor vendor ( ) const; 183 OVendor vendor ( ) const;
183 184
184 QString systemString ( ) const; 185 QString systemString ( ) const;
185 OSystem system ( ) const; 186 OSystem system ( ) const;
186 187
187 QString systemVersionString ( ) const; 188 QString systemVersionString ( ) const;
188 189
189 Transformation rotation ( ) const; 190 Transformation rotation ( ) const;
190 ODirection direction ( ) const; 191 ODirection direction ( ) const;
191 192
192// system 193// system
193 194
194 virtual bool setSoftSuspend ( bool on ); 195 virtual bool setSoftSuspend ( bool on );
195 virtual bool suspend ( ); 196 virtual bool suspend ( );
196 197
197 virtual bool setDisplayStatus ( bool on ); 198 virtual bool setDisplayStatus ( bool on );
198 virtual bool setDisplayBrightness ( int brightness ); 199 virtual bool setDisplayBrightness ( int brightness );
199 virtual int displayBrightnessResolution ( ) const; 200 virtual int displayBrightnessResolution ( ) const;
200 virtual bool setDisplayContrast ( int contrast ); 201 virtual bool setDisplayContrast ( int contrast );
201 virtual int displayContrastResolution ( ) const; 202 virtual int displayContrastResolution ( ) const;
202 203
203 // don't add new virtual methods, use this: 204 // don't add new virtual methods, use this:
204 ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; 205 ///*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
205 // and in your subclass do do overwrite 206 // and in your subclass do do overwrite
206 //protected virtual int virtual_hook(int, void *) 207 //protected virtual int virtual_hook(int, void *)
207 // which is defined below 208 // which is defined below
208 209
209// input / output 210// input / output
210 //FIXME playAlarmSound and al might be better -zecke 211 //FIXME playAlarmSound and al might be better -zecke
211 virtual void alarmSound ( ); 212 virtual void alarmSound ( );
212 virtual void keySound ( ); 213 virtual void keySound ( );
213 virtual void touchSound ( ); 214 virtual void touchSound ( );
214 215
215 virtual QValueList <OLed> ledList ( ) const; 216 virtual QValueList <OLed> ledList ( ) const;
216 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 217 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
217 virtual OLedState ledState ( OLed led ) const; 218 virtual OLedState ledState ( OLed led ) const;
218 virtual bool setLedState ( OLed led, OLedState st ); 219 virtual bool setLedState ( OLed led, OLedState st );
219 220
220 virtual bool hasLightSensor ( ) const; 221 virtual bool hasLightSensor ( ) const;
221 virtual int readLightSensor ( ); 222 virtual int readLightSensor ( );
222 virtual int lightSensorResolution ( ) const; 223 virtual int lightSensorResolution ( ) const;
223 224
224 const QStrList &allowedCpuFrequencies() const; 225 const QStrList &allowedCpuFrequencies() const;
225 bool setCurrentCpuFrequency(uint index); 226 bool setCurrentCpuFrequency(uint index);
226 227
227 /** 228 /**
228 * Returns the available buttons on this device. The number and location 229 * Returns the available buttons on this device. The number and location
229 * 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
230 * 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
231 * button. Note that this list only contains "user mappable" buttons. 232 * button. Note that this list only contains "user mappable" buttons.
232 */ 233 */
233 const QValueList<ODeviceButton> &buttons ( ) /* ### make const */; 234 const QValueList<ODeviceButton> &buttons ( ) /* ### make const */;
234 235
235 /** 236 /**
236 * 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
237 * returns 0L 238 * returns 0L
238 */ 239 */
239 const ODeviceButton *buttonForKeycode ( ushort keyCode ); 240 const ODeviceButton *buttonForKeycode ( ushort keyCode );
240 241
241 /** 242 /**
242 * 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
243 * default pass an empty string as \a qcopMessage. 244 * default pass an empty string as \a qcopMessage.
244 */ 245 */
245 void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); 246 void remapPressedAction ( int button, const OQCopMessage &qcopMessage );
246 247
247 /** 248 /**
248 * 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
249 * default pass an empty string as \a qcopMessage. 250 * default pass an empty string as \a qcopMessage.
250 */ 251 */
251 void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); 252 void remapHeldAction ( int button, const OQCopMessage &qcopMessage );
252 253
253 /** 254 /**
254 * 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
255 */ 256 */
256 uint buttonHoldTime ( ) const; 257 uint buttonHoldTime ( ) const;
257 258
258signals: 259signals:
259 void buttonMappingChanged ( ); 260 void buttonMappingChanged ( );
260 261
261private slots: 262private slots:
262 void systemMessage ( const QCString &, const QByteArray & ); 263 void systemMessage ( const QCString &, const QByteArray & );
263 264
264protected: 265protected:
265 void reloadButtonMapping ( ); 266 void reloadButtonMapping ( );
266 /* ugly virtual hook */ 267 /* ugly virtual hook */
267 virtual void virtual_hook( int id, void* data ); 268 virtual void virtual_hook( int id, void* data );
268}; 269};
269 270
270} 271}
271 272
272#endif 273#endif
273 274