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