author | erik <erik> | 2007-02-08 21:46:07 (UTC) |
---|---|---|
committer | erik <erik> | 2007-02-08 21:46:07 (UTC) |
commit | 497621fb3ba39ea511842a30cddfcdbda090e7ba (patch) (unidiff) | |
tree | 13e70fb1840b7cc1c7b3a16ff9b6e71925b76b57 /libopie2/opiecore/device/odevice.h | |
parent | 63f64a9733d5504bb04d5f06cdf52b42a4b8006c (diff) | |
download | opie-497621fb3ba39ea511842a30cddfcdbda090e7ba.zip opie-497621fb3ba39ea511842a30cddfcdbda090e7ba.tar.gz opie-497621fb3ba39ea511842a30cddfcdbda090e7ba.tar.bz2 |
This commit provides the necessary changes and new files for Opie to
have partial support for the Palm LD, TX and Z72 handheld computers.
This commit is based on a patch submitted by Cristiano to the opie-devel
list. The patch itself comprises work done by Alex Osborne, Cristiano,
Sergey Lapin, Jan Herman and Aaron. Thanks goes to them for sticking with
the patch and expanding the number of devices Opie works on.
Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index a8362cd..1eb5959 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,350 +1,357 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> | 3 | (C) 2002-2006 The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; version 2 of the License. | 11 | - . .-<_> .<> Foundation; version 2 of the License. |
12 | ._= =} : | 12 | ._= =} : |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | 41 | ||
42 | 42 | ||
43 | #include <qstrlist.h> | 43 | #include <qstrlist.h> |
44 | #include <qwindowsystem_qws.h> | 44 | #include <qwindowsystem_qws.h> |
45 | 45 | ||
46 | 46 | ||
47 | class Sound; | 47 | class Sound; |
48 | 48 | ||
49 | namespace Opie{ | 49 | namespace Opie{ |
50 | namespace Core{ | 50 | namespace Core{ |
51 | 51 | ||
52 | class ODeviceData; | 52 | class ODeviceData; |
53 | /** | 53 | /** |
54 | * The available devices | 54 | * The available devices |
55 | */ | 55 | */ |
56 | enum OModel { | 56 | enum OModel { |
57 | Model_Unknown, // = 0 | 57 | Model_Unknown, // = 0 |
58 | 58 | ||
59 | Model_Series_Mask = 0xffff0000, | 59 | Model_Series_Mask = 0xffff0000, |
60 | 60 | ||
61 | Model_iPAQ = ( 1 << 16 ), | 61 | Model_iPAQ = ( 1 << 16 ), |
62 | 62 | ||
63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), | 63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), |
64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), | 64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), |
65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), | 65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), |
66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), | 66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), |
67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), | 67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), |
68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), |
69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), |
70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), |
71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), | 71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), |
72 | Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), | 72 | Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), |
73 | Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ), | 73 | Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ), |
74 | Model_iPAQ_H4xxx = ( Model_iPAQ | 0x000b ), | 74 | Model_iPAQ_H4xxx = ( Model_iPAQ | 0x000b ), |
75 | Model_Jornada = ( 6 << 16 ), | 75 | Model_Jornada = ( 6 << 16 ), |
76 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), | 76 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), |
77 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), | 77 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), |
78 | Model_Jornada_820 = ( Model_Jornada | 0x0003 ), | 78 | Model_Jornada_820 = ( Model_Jornada | 0x0003 ), |
79 | 79 | ||
80 | Model_Zaurus = ( 2 << 16 ), | 80 | Model_Zaurus = ( 2 << 16 ), |
81 | 81 | ||
82 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), | 82 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), |
83 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), | 83 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), |
84 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), | 84 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), |
85 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), | 85 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), |
86 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), | 86 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), |
87 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), | 87 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), |
88 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), | 88 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), |
89 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), | 89 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), |
90 | Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), | 90 | Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), |
91 | 91 | ||
92 | Model_SIMpad = ( 3 << 16 ), | 92 | Model_SIMpad = ( 3 << 16 ), |
93 | 93 | ||
94 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), | 94 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), |
95 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), | 95 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), |
96 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), | 96 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), |
97 | Model_SIMpad_SLC = ( Model_SIMpad | 0x0003 ), | 97 | Model_SIMpad_SLC = ( Model_SIMpad | 0x0003 ), |
98 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x0004 ), | 98 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x0004 ), |
99 | 99 | ||
100 | Model_Ramses = ( 4 << 16 ), | 100 | Model_Ramses = ( 4 << 16 ), |
101 | 101 | ||
102 | Model_Ramses_All = ( Model_Ramses | 0xffff ), | 102 | Model_Ramses_All = ( Model_Ramses | 0xffff ), |
103 | Model_Ramses_MNCI = ( Model_Ramses | 0x0001 ), | 103 | Model_Ramses_MNCI = ( Model_Ramses | 0x0001 ), |
104 | Model_Ramses_MNCIRX = ( Model_Ramses | 0x0002 ), | 104 | Model_Ramses_MNCIRX = ( Model_Ramses | 0x0002 ), |
105 | 105 | ||
106 | Model_Yopy = ( 5 << 16 ), | 106 | Model_Yopy = ( 5 << 16 ), |
107 | 107 | ||
108 | Model_Yopy_All = ( Model_Yopy | 0xffff ), | 108 | Model_Yopy_All = ( Model_Yopy | 0xffff ), |
109 | Model_Yopy_3000 = ( Model_Yopy | 0x0001 ), | 109 | Model_Yopy_3000 = ( Model_Yopy | 0x0001 ), |
110 | Model_Yopy_3500 = ( Model_Yopy | 0x0002 ), | 110 | Model_Yopy_3500 = ( Model_Yopy | 0x0002 ), |
111 | Model_Yopy_3700 = ( Model_Yopy | 0x0003 ), | 111 | Model_Yopy_3700 = ( Model_Yopy | 0x0003 ), |
112 | 112 | ||
113 | Model_Beagle = ( 6 << 16 ), | 113 | Model_Beagle = ( 6 << 16 ), |
114 | 114 | ||
115 | Model_Beagle_All = ( Model_Beagle | 0xffff ), | 115 | Model_Beagle_All = ( Model_Beagle | 0xffff ), |
116 | Model_Beagle_PA100 = ( Model_Beagle | 0x0001 ), | 116 | Model_Beagle_PA100 = ( Model_Beagle | 0x0001 ), |
117 | 117 | ||
118 | Model_GenuineIntel = ( 7 << 16 ), | 118 | Model_GenuineIntel = ( 7 << 16 ), |
119 | 119 | ||
120 | Model_MyPal = ( 8 << 16 ), | 120 | Model_MyPal = ( 8 << 16 ), |
121 | 121 | ||
122 | Model_MyPal_All = ( Model_MyPal | 0xffff ), | 122 | Model_MyPal_All = ( Model_MyPal | 0xffff ), |
123 | Model_MyPal_620 = ( Model_MyPal | 0x0001 ), | 123 | Model_MyPal_620 = ( Model_MyPal | 0x0001 ), |
124 | Model_MyPal_716 = ( Model_MyPal | 0x0002 ), | 124 | Model_MyPal_716 = ( Model_MyPal | 0x0002 ), |
125 | Model_MyPal_730 = ( Model_MyPal | 0x0003 ), | 125 | Model_MyPal_730 = ( Model_MyPal | 0x0003 ), |
126 | 126 | ||
127 | Model_HTC = ( 9 << 16 ), | 127 | Model_HTC = ( 9 << 16 ), |
128 | Model_HTC_All = ( Model_HTC | 0xffff ), | 128 | Model_HTC_All = ( Model_HTC | 0xffff ), |
129 | Model_HTC_Universal = ( Model_HTC | 0x0001 ), | 129 | Model_HTC_Universal = ( Model_HTC | 0x0001 ), |
130 | Model_HTC_Alpine = ( Model_HTC | 0x0002 ), | 130 | Model_HTC_Alpine = ( Model_HTC | 0x0002 ), |
131 | Model_HTC_Apache = ( Model_HTC | 0x0003 ), | 131 | Model_HTC_Apache = ( Model_HTC | 0x0003 ), |
132 | Model_HTC_Beetles = ( Model_HTC | 0x0004 ), | 132 | Model_HTC_Beetles = ( Model_HTC | 0x0004 ), |
133 | Model_HTC_Blueangel = ( Model_HTC | 0x0005 ), | 133 | Model_HTC_Blueangel = ( Model_HTC | 0x0005 ), |
134 | Model_HTC_Himalaya = ( Model_HTC | 0x0006 ), | 134 | Model_HTC_Himalaya = ( Model_HTC | 0x0006 ), |
135 | Model_HTC_Magician = ( Model_HTC | 0x0007 ), | 135 | Model_HTC_Magician = ( Model_HTC | 0x0007 ), |
136 | 136 | ||
137 | Model_Motorola = ( 9 << 17 ), | 137 | Model_Motorola = ( 9 << 17 ), |
138 | Model_Motorola_All = ( Model_Motorola | 0xffff ), | 138 | Model_Motorola_All = ( Model_Motorola | 0xffff ), |
139 | Model_Motorola_EZX = ( Model_Motorola | 0x0001 ), | 139 | Model_Motorola_EZX = ( Model_Motorola | 0x0001 ), |
140 | 140 | ||
141 | Model_Palm = ( 10 << 16), | ||
142 | Model_Palm_All = ( Model_Palm | 0xffff ), | ||
143 | Model_Palm_LD = ( Model_Palm | 0x0001 ), | ||
144 | Model_Palm_TX = ( Model_Palm | 0x0002 ), | ||
145 | Model_Palm_Z72 = ( Model_Palm | 0x0003 ), | ||
146 | |||
141 | }; | 147 | }; |
142 | 148 | ||
143 | /** | 149 | /** |
144 | * The vendor of the device | 150 | * The vendor of the device |
145 | */ | 151 | */ |
146 | enum OVendor { | 152 | enum OVendor { |
147 | Vendor_Unknown, | 153 | Vendor_Unknown, |
148 | 154 | ||
149 | Vendor_HP, | 155 | Vendor_HP, |
150 | Vendor_Sharp, | 156 | Vendor_Sharp, |
151 | Vendor_SIEMENS, | 157 | Vendor_SIEMENS, |
152 | Vendor_MundN, | 158 | Vendor_MundN, |
153 | Vendor_GMate, | 159 | Vendor_GMate, |
154 | Vendor_MasterIA, | 160 | Vendor_MasterIA, |
155 | Vendor_GenuineIntel, | 161 | Vendor_GenuineIntel, |
156 | Vendor_Asus, | 162 | Vendor_Asus, |
157 | Vendor_HTC, | 163 | Vendor_HTC, |
158 | Vendor_Motorola, | 164 | Vendor_Motorola, |
165 | Vendor_Palm, | ||
159 | }; | 166 | }; |
160 | 167 | ||
161 | /** | 168 | /** |
162 | * The System used | 169 | * The System used |
163 | */ | 170 | */ |
164 | enum OSystem { | 171 | enum OSystem { |
165 | System_Unknown, | 172 | System_Unknown, |
166 | 173 | ||
167 | System_Familiar, | 174 | System_Familiar, |
168 | System_Zaurus, | 175 | System_Zaurus, |
169 | System_OpenZaurus, | 176 | System_OpenZaurus, |
170 | System_Linupy, | 177 | System_Linupy, |
171 | System_OpenEmbedded, | 178 | System_OpenEmbedded, |
172 | System_PC, | 179 | System_PC, |
173 | System_OpenEZX, | 180 | System_OpenEZX, |
174 | System_Angstrom, | 181 | System_Angstrom, |
175 | }; | 182 | }; |
176 | 183 | ||
177 | typedef struct { | 184 | typedef struct { |
178 | OSystem system; | 185 | OSystem system; |
179 | char* sysstr; | 186 | char* sysstr; |
180 | char* sysvfile; | 187 | char* sysvfile; |
181 | } ODistribution; | 188 | } ODistribution; |
182 | 189 | ||
183 | extern ODistribution distributions[]; | 190 | extern ODistribution distributions[]; |
184 | 191 | ||
185 | 192 | ||
186 | enum OLedState { | 193 | enum OLedState { |
187 | Led_Off, | 194 | Led_Off, |
188 | Led_On, | 195 | Led_On, |
189 | Led_BlinkSlow, | 196 | Led_BlinkSlow, |
190 | Led_BlinkFast | 197 | Led_BlinkFast |
191 | }; | 198 | }; |
192 | 199 | ||
193 | enum OLed { | 200 | enum OLed { |
194 | Led_Mail, | 201 | Led_Mail, |
195 | Led_Power, | 202 | Led_Power, |
196 | Led_BlueTooth | 203 | Led_BlueTooth |
197 | }; | 204 | }; |
198 | 205 | ||
199 | enum OHardKey { | 206 | enum OHardKey { |
200 | HardKey_Datebook = Qt::Key_F9, | 207 | HardKey_Datebook = Qt::Key_F9, |
201 | HardKey_Contacts = Qt::Key_F10, | 208 | HardKey_Contacts = Qt::Key_F10, |
202 | HardKey_Menu = Qt::Key_F11, | 209 | HardKey_Menu = Qt::Key_F11, |
203 | HardKey_Home = Qt::Key_F12, | 210 | HardKey_Home = Qt::Key_F12, |
204 | HardKey_Mail = Qt::Key_F13, | 211 | HardKey_Mail = Qt::Key_F13, |
205 | HardKey_Record = Qt::Key_F24, | 212 | HardKey_Record = Qt::Key_F24, |
206 | HardKey_Suspend = Qt::Key_F34, | 213 | HardKey_Suspend = Qt::Key_F34, |
207 | HardKey_Backlight = Qt::Key_F35, | 214 | HardKey_Backlight = Qt::Key_F35, |
208 | HardKey_Action = Qt::Key_F10, | 215 | HardKey_Action = Qt::Key_F10, |
209 | HardKey_OK = Qt::Key_F11, | 216 | HardKey_OK = Qt::Key_F11, |
210 | HardKey_End = Qt::Key_F12, | 217 | HardKey_End = Qt::Key_F12, |
211 | }; | 218 | }; |
212 | 219 | ||
213 | enum ODirection { | 220 | enum ODirection { |
214 | CW = 0, | 221 | CW = 0, |
215 | CCW = 1, | 222 | CCW = 1, |
216 | Flip = 2, | 223 | Flip = 2, |
217 | }; | 224 | }; |
218 | 225 | ||
219 | enum OHingeStatus { | 226 | enum OHingeStatus { |
220 | CASE_CLOSED = 3, | 227 | CASE_CLOSED = 3, |
221 | CASE_PORTRAIT = 2, | 228 | CASE_PORTRAIT = 2, |
222 | CASE_LANDSCAPE = 0, | 229 | CASE_LANDSCAPE = 0, |
223 | CASE_UNKNOWN = 1, | 230 | CASE_UNKNOWN = 1, |
224 | }; | 231 | }; |
225 | 232 | ||
226 | /* default button for qvfb or such | 233 | /* default button for qvfb or such |
227 | * see odevice.cpp for details. | 234 | * see odevice.cpp for details. |
228 | * hint: manage a user defined button for qvfb? | 235 | * hint: manage a user defined button for qvfb? |
229 | * alwin | 236 | * alwin |
230 | */ | 237 | */ |
231 | struct default_button { | 238 | struct default_button { |
232 | Qt::Key code; | 239 | Qt::Key code; |
233 | char *utext; | 240 | char *utext; |
234 | char *pix; | 241 | char *pix; |
235 | char *fpressedservice; | 242 | char *fpressedservice; |
236 | char *fpressedaction; | 243 | char *fpressedaction; |
237 | char *fheldservice; | 244 | char *fheldservice; |
238 | char *fheldaction; | 245 | char *fheldaction; |
239 | }; | 246 | }; |
240 | 247 | ||
241 | /** | 248 | /** |
242 | * A singleton which gives informations about device specefic option | 249 | * A singleton which gives informations about device specefic option |
243 | * like the Hardware used, LEDs, the Base Distribution and | 250 | * like the Hardware used, LEDs, the Base Distribution and |
244 | * hardware key mappings. | 251 | * hardware key mappings. |
245 | * | 252 | * |
246 | * @short A small class for device specific options | 253 | * @short A small class for device specific options |
247 | * @see QObject | 254 | * @see QObject |
248 | * @author Robert Griebl | 255 | * @author Robert Griebl |
249 | * @version 1.0 | 256 | * @version 1.0 |
250 | */ | 257 | */ |
251 | class ODevice : public QObject | 258 | class ODevice : public QObject |
252 | { | 259 | { |
253 | Q_OBJECT | 260 | Q_OBJECT |
254 | 261 | ||
255 | private: | 262 | private: |
256 | /* disable copy */ | 263 | /* disable copy */ |
257 | ODevice ( const ODevice & ); | 264 | ODevice ( const ODevice & ); |
258 | 265 | ||
259 | protected: | 266 | protected: |
260 | ODevice(); | 267 | ODevice(); |
261 | virtual void init(const QString&); | 268 | virtual void init(const QString&); |
262 | virtual void initButtons(); | 269 | virtual void initButtons(); |
263 | static void sendSuspendmsg(); | 270 | static void sendSuspendmsg(); |
264 | 271 | ||
265 | ODeviceData *d; | 272 | ODeviceData *d; |
266 | 273 | ||
267 | public: | 274 | public: |
268 | // sandman do we want to allow destructions? -zecke? | 275 | // sandman do we want to allow destructions? -zecke? |
269 | virtual ~ODevice(); | 276 | virtual ~ODevice(); |
270 | static ODevice *inst(); | 277 | static ODevice *inst(); |
271 | 278 | ||
272 | // information | 279 | // information |
273 | QString modelString() const; | 280 | QString modelString() const; |
274 | OModel model() const; | 281 | OModel model() const; |
275 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } | 282 | inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } |
276 | 283 | ||
277 | QString vendorString() const; | 284 | QString vendorString() const; |
278 | OVendor vendor() const; | 285 | OVendor vendor() const; |
279 | 286 | ||
280 | QString systemString() const; | 287 | QString systemString() const; |
281 | OSystem system() const; | 288 | OSystem system() const; |
282 | 289 | ||
283 | QString systemVersionString() const; | 290 | QString systemVersionString() const; |
284 | 291 | ||
285 | virtual Transformation rotation() const; | 292 | virtual Transformation rotation() const; |
286 | virtual ODirection direction() const; | 293 | virtual ODirection direction() const; |
287 | 294 | ||
288 | QString qteDriver() const; | 295 | QString qteDriver() const; |
289 | 296 | ||
290 | // system | 297 | // system |
291 | virtual bool suspend(); | 298 | virtual bool suspend(); |
292 | 299 | ||
293 | virtual bool setDisplayStatus ( bool on ); | 300 | virtual bool setDisplayStatus ( bool on ); |
294 | virtual bool setDisplayBrightness ( int brightness ); | 301 | virtual bool setDisplayBrightness ( int brightness ); |
295 | virtual int displayBrightnessResolution() const; | 302 | virtual int displayBrightnessResolution() const; |
296 | virtual bool setDisplayContrast ( int contrast ); | 303 | virtual bool setDisplayContrast ( int contrast ); |
297 | virtual int displayContrastResolution() const; | 304 | virtual int displayContrastResolution() const; |
298 | 305 | ||
299 | // don't add new virtual methods, use this: | 306 | // don't add new virtual methods, use this: |
300 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; | 307 | // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; |
301 | // and in your subclass do overwrite | 308 | // and in your subclass do overwrite |
302 | // protected virtual int virtual_hook(int, void *) | 309 | // protected virtual int virtual_hook(int, void *) |
303 | // which is defined below | 310 | // which is defined below |
304 | 311 | ||
305 | // input / output | 312 | // input / output |
306 | virtual void playAlarmSound(); | 313 | virtual void playAlarmSound(); |
307 | virtual void playKeySound(); | 314 | virtual void playKeySound(); |
308 | virtual void playTouchSound(); | 315 | virtual void playTouchSound(); |
309 | 316 | ||
310 | virtual QValueList <OLed> ledList() const; | 317 | virtual QValueList <OLed> ledList() const; |
311 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 318 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
312 | virtual OLedState ledState ( OLed led ) const; | 319 | virtual OLedState ledState ( OLed led ) const; |
313 | virtual bool setLedState ( OLed led, OLedState st ); | 320 | virtual bool setLedState ( OLed led, OLedState st ); |
314 | 321 | ||
315 | virtual bool hasLightSensor() const; | 322 | virtual bool hasLightSensor() const; |
316 | virtual int readLightSensor(); | 323 | virtual int readLightSensor(); |
317 | virtual int lightSensorResolution() const; | 324 | virtual int lightSensorResolution() const; |
318 | 325 | ||
319 | virtual bool hasHingeSensor() const; | 326 | virtual bool hasHingeSensor() const; |
320 | virtual OHingeStatus readHingeSensor()const; | 327 | virtual OHingeStatus readHingeSensor()const; |
321 | 328 | ||
322 | const QStrList &allowedCpuFrequencies() const; | 329 | const QStrList &allowedCpuFrequencies() const; |
323 | bool setCurrentCpuFrequency(uint index); | 330 | bool setCurrentCpuFrequency(uint index); |
324 | 331 | ||
325 | /** | 332 | /** |
326 | * Returns the available buttons on this device. The number and location | 333 | * Returns the available buttons on this device. The number and location |
327 | * of buttons will vary depending on the device. Button numbers will be assigned | 334 | * of buttons will vary depending on the device. Button numbers will be assigned |
328 | * by the device manufacturer and will be from most preferred button to least preffered | 335 | * by the device manufacturer and will be from most preferred button to least preffered |
329 | * button. Note that this list only contains "user mappable" buttons. | 336 | * button. Note that this list only contains "user mappable" buttons. |
330 | * | 337 | * |
331 | * @todo Make method const and take care of calling initButtons or make that const too | 338 | * @todo Make method const and take care of calling initButtons or make that const too |
332 | * | 339 | * |
333 | */ | 340 | */ |
334 | const QValueList<ODeviceButton> &buttons(); | 341 | const QValueList<ODeviceButton> &buttons(); |
335 | 342 | ||
336 | /** | 343 | /** |
337 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 344 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
338 | * returns 0L | 345 | * returns 0L |
339 | */ | 346 | */ |
340 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 347 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
341 | 348 | ||
342 | /** | 349 | /** |
343 | * Reassigns the pressed action for \a button. To return to the factory | 350 | * Reassigns the pressed action for \a button. To return to the factory |
344 | * default pass an empty string as \a qcopMessage. | 351 | * default pass an empty string as \a qcopMessage. |
345 | */ | 352 | */ |
346 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 353 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
347 | 354 | ||
348 | /** | 355 | /** |
349 | * Reassigns the held action for \a button. To return to the factory | 356 | * Reassigns the held action for \a button. To return to the factory |
350 | * default pass an empty string as \a qcopMessage. | 357 | * default pass an empty string as \a qcopMessage. |