Diffstat (limited to 'libopie2/opiecore/device/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index aaebde3..474d792 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -1,169 +1,191 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) 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; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
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 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | 42 | ||
43 | namespace Opie{ | 43 | namespace Opie{ |
44 | namespace Core{ | 44 | namespace Core{ |
45 | 45 | ||
46 | class ODeviceData; | 46 | class ODeviceData; |
47 | /** | 47 | /** |
48 | * The available devices | 48 | * The available devices |
49 | */ | 49 | */ |
50 | enum OModel { | 50 | enum OModel { |
51 | Model_Unknown, // = 0 | 51 | Model_Unknown, // = 0 |
52 | 52 | ||
53 | Model_Series_Mask = 0xff000000, | 53 | Model_Series_Mask = 0xff000000, |
54 | 54 | ||
55 | Model_iPAQ = ( 1 << 24 ), | 55 | Model_iPAQ = ( 1 << 24 ), |
56 | 56 | ||
57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
64 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 64 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
65 | 65 | ||
66 | Model_Jornada = ( 6 << 24 ), | 66 | Model_Jornada = ( 6 << 24 ), |
67 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 67 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
68 | 68 | ||
69 | Model_Zaurus = ( 2 << 24 ), | 69 | Model_Zaurus = ( 2 << 24 ), |
70 | 70 | ||
71 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 71 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
72 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 72 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
73 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 73 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
74 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 74 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
75 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), | 75 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), |
76 | 76 | ||
77 | Model_SIMpad = ( 3 << 24 ), | 77 | Model_SIMpad = ( 3 << 24 ), |
78 | 78 | ||
79 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 79 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
80 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 80 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
81 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 81 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
82 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 82 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
83 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 83 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
84 | 84 | ||
85 | Model_Ramses = ( 4 << 24 ), | 85 | Model_Ramses = ( 4 << 24 ), |
86 | 86 | ||
87 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 87 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
88 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 88 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
89 | 89 | ||
90 | Model_Yopy = ( 5 << 24 ), | 90 | Model_Yopy = ( 5 << 24 ), |
91 | 91 | ||
92 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), | 92 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), |
93 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), | 93 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), |
94 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), | 94 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), |
95 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), | 95 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), |
96 | 96 | ||
97 | Model_Beagle = ( 6 << 24 ), | ||
98 | |||
99 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), | ||
100 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), | ||
101 | |||
97 | }; | 102 | }; |
98 | 103 | ||
99 | /** | 104 | /** |
100 | * The vendor of the device | 105 | * The vendor of the device |
101 | */ | 106 | */ |
102 | enum OVendor { | 107 | enum OVendor { |
103 | Vendor_Unknown, | 108 | Vendor_Unknown, |
104 | 109 | ||
105 | Vendor_HP, | 110 | Vendor_HP, |
106 | Vendor_Sharp, | 111 | Vendor_Sharp, |
107 | Vendor_SIEMENS, | 112 | Vendor_SIEMENS, |
108 | Vendor_MundN, | 113 | Vendor_MundN, |
109 | Vendor_GMate, | 114 | Vendor_GMate, |
115 | Vendor_MasterIA, | ||
110 | }; | 116 | }; |
111 | 117 | ||
112 | /** | 118 | /** |
113 | * The System used | 119 | * The System used |
114 | */ | 120 | */ |
115 | enum OSystem { | 121 | enum OSystem { |
116 | System_Unknown, | 122 | System_Unknown, |
117 | 123 | ||
118 | System_Familiar, | 124 | System_Familiar, |
119 | System_Zaurus, | 125 | System_Zaurus, |
120 | System_OpenZaurus, | 126 | System_OpenZaurus, |
121 | System_Linupy, | 127 | System_Linupy, |
128 | System_OpenEmbedded, | ||
129 | }; | ||
130 | |||
131 | typedef struct { | ||
132 | OSystem system; | ||
133 | char* sysstr; | ||
134 | char* sysvfile; | ||
135 | } ODistribution; | ||
136 | |||
137 | static ODistribution distributions[] = | ||
138 | { | ||
139 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, | ||
140 | { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, | ||
141 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, | ||
142 | { System_Unknown, "Linux", "/etc/issue" }, | ||
143 | |||
122 | }; | 144 | }; |
123 | 145 | ||
124 | enum OLedState { | 146 | enum OLedState { |
125 | Led_Off, | 147 | Led_Off, |
126 | Led_On, | 148 | Led_On, |
127 | Led_BlinkSlow, | 149 | Led_BlinkSlow, |
128 | Led_BlinkFast | 150 | Led_BlinkFast |
129 | }; | 151 | }; |
130 | 152 | ||
131 | enum OLed { | 153 | enum OLed { |
132 | Led_Mail, | 154 | Led_Mail, |
133 | Led_Power, | 155 | Led_Power, |
134 | Led_BlueTooth | 156 | Led_BlueTooth |
135 | }; | 157 | }; |
136 | 158 | ||
137 | enum OHardKey { | 159 | enum OHardKey { |
138 | HardKey_Datebook = Qt::Key_F9, | 160 | HardKey_Datebook = Qt::Key_F9, |
139 | HardKey_Contacts = Qt::Key_F10, | 161 | HardKey_Contacts = Qt::Key_F10, |
140 | HardKey_Menu = Qt::Key_F11, | 162 | HardKey_Menu = Qt::Key_F11, |
141 | HardKey_Home = Qt::Key_F12, | 163 | HardKey_Home = Qt::Key_F12, |
142 | HardKey_Mail = Qt::Key_F13, | 164 | HardKey_Mail = Qt::Key_F13, |
143 | HardKey_Record = Qt::Key_F24, | 165 | HardKey_Record = Qt::Key_F24, |
144 | HardKey_Suspend = Qt::Key_F34, | 166 | HardKey_Suspend = Qt::Key_F34, |
145 | HardKey_Backlight = Qt::Key_F35, | 167 | HardKey_Backlight = Qt::Key_F35, |
146 | HardKey_Action = Qt::Key_F10, | 168 | HardKey_Action = Qt::Key_F10, |
147 | HardKey_OK = Qt::Key_F11, | 169 | HardKey_OK = Qt::Key_F11, |
148 | HardKey_End = Qt::Key_F12, | 170 | HardKey_End = Qt::Key_F12, |
149 | }; | 171 | }; |
150 | 172 | ||
151 | enum ODirection { | 173 | enum ODirection { |
152 | CW = 0, | 174 | CW = 0, |
153 | CCW = 1, | 175 | CCW = 1, |
154 | Flip = 2, | 176 | Flip = 2, |
155 | }; | 177 | }; |
156 | 178 | ||
157 | enum OHingeStatus { | 179 | enum OHingeStatus { |
158 | CASE_CLOSED = 3, | 180 | CASE_CLOSED = 3, |
159 | CASE_PORTRAIT = 2, | 181 | CASE_PORTRAIT = 2, |
160 | CASE_LANDSCAPE = 0, | 182 | CASE_LANDSCAPE = 0, |
161 | CASE_UNKNOWN = 1, | 183 | CASE_UNKNOWN = 1, |
162 | }; | 184 | }; |
163 | 185 | ||
164 | /* default button for qvfb or such | 186 | /* default button for qvfb or such |
165 | * see odevice.cpp for details. | 187 | * see odevice.cpp for details. |
166 | * hint: manage a user defined button for qvfb? | 188 | * hint: manage a user defined button for qvfb? |
167 | * alwin | 189 | * alwin |
168 | */ | 190 | */ |
169 | struct default_button { | 191 | struct default_button { |