author | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
commit | 0b311079ff19798866291034663757103c6ba935 (patch) (unidiff) | |
tree | 70ddccf3a3147475050fa06cc2d807a71ab1d5ee /libopie/odevice.h | |
parent | 1537ccb435ca725c793db6e94e0b9e83484b57e7 (diff) | |
download | opie-0b311079ff19798866291034663757103c6ba935.zip opie-0b311079ff19798866291034663757103c6ba935.tar.gz opie-0b311079ff19798866291034663757103c6ba935.tar.bz2 |
Jumbo API documentation update
and some API fixed
ColorDialog is now OColorDialog!!! keep the namespace tidy!
ColorPopupMenu is now OColorPopupMenu!!! keep the namespace tidy
ColorDialog TT couldn't break bc we can so make it const QColor&
OTimePicker add some convience methods
more I might have forgot
-rw-r--r-- | libopie/odevice.h | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index ff578d8..45a790b 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -1,19 +1,19 @@ | |||
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 | ||
@@ -29,15 +29,18 @@ | |||
29 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 29 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
30 | 30 | ||
31 | class ODeviceData; | 31 | class ODeviceData; |
32 | 32 | ||
33 | namespace Opie { | 33 | namespace Opie { |
34 | 34 | ||
35 | /** | ||
36 | * The available devices | ||
37 | */ | ||
35 | enum OModel { | 38 | enum OModel { |
36 | Model_Unknown, | 39 | Model_Unknown, // = 0 |
37 | 40 | ||
38 | Model_Series_Mask = 0xff000000, | 41 | Model_Series_Mask = 0xff000000, |
39 | 42 | ||
40 | Model_iPAQ = ( 1 << 24 ), | 43 | Model_iPAQ = ( 1 << 24 ), |
41 | 44 | ||
42 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 45 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
43 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 46 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
@@ -52,19 +55,25 @@ enum OModel { | |||
52 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 55 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
53 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 56 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
54 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 57 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
55 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), | 58 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), |
56 | }; | 59 | }; |
57 | 60 | ||
58 | enum OVendor { | 61 | /** |
62 | * The vendor of the device | ||
63 | */ | ||
64 | enum OVendor { | ||
59 | Vendor_Unknown, | 65 | Vendor_Unknown, |
60 | 66 | ||
61 | Vendor_HP, | 67 | Vendor_HP, |
62 | Vendor_Sharp | 68 | Vendor_Sharp |
63 | }; | 69 | }; |
64 | 70 | ||
71 | /** | ||
72 | * The System used | ||
73 | */ | ||
65 | enum OSystem { | 74 | enum OSystem { |
66 | System_Unknown, | 75 | System_Unknown, |
67 | 76 | ||
68 | System_Familiar, | 77 | System_Familiar, |
69 | System_Zaurus, | 78 | System_Zaurus, |
70 | System_OpenZaurus | 79 | System_OpenZaurus |
@@ -91,57 +100,71 @@ enum OHardKey { | |||
91 | HardKey_Mail = Qt::Key_F13, | 100 | HardKey_Mail = Qt::Key_F13, |
92 | HardKey_Record = Qt::Key_F24, | 101 | HardKey_Record = Qt::Key_F24, |
93 | HardKey_Suspend = Qt::Key_F34, | 102 | HardKey_Suspend = Qt::Key_F34, |
94 | HardKey_Backlight = Qt::Key_F35, | 103 | HardKey_Backlight = Qt::Key_F35, |
95 | }; | 104 | }; |
96 | 105 | ||
106 | /** | ||
107 | * A singleton which gives informations about device specefic option | ||
108 | * like the Hardware used, LEDs, the Base Distribution and | ||
109 | * hardware key mappings. | ||
110 | * | ||
111 | * | ||
112 | * @short A small class for device specefic options | ||
113 | * @see QObject | ||
114 | * @author Robert Griebl | ||
115 | * @version 1.0 | ||
116 | */ | ||
97 | class ODevice : public QObject { | 117 | class ODevice : public QObject { |
98 | Q_OBJECT | 118 | Q_OBJECT |
99 | 119 | ||
100 | private: | 120 | private: |
121 | /* disable copy */ | ||
101 | ODevice ( const ODevice & ); | 122 | ODevice ( const ODevice & ); |
102 | 123 | ||
103 | protected: | 124 | protected: |
104 | ODevice ( ); | 125 | ODevice ( ); |
105 | virtual void init ( ); | 126 | virtual void init ( ); |
106 | virtual void initButtons ( ); | 127 | virtual void initButtons ( ); |
107 | 128 | ||
108 | ODeviceData *d; | 129 | ODeviceData *d; |
109 | 130 | ||
110 | public: | 131 | public: |
132 | // sandman do we want to allow destructions? -zecke? | ||
111 | virtual ~ODevice ( ); | 133 | virtual ~ODevice ( ); |
112 | 134 | ||
135 | |||
113 | static ODevice *inst ( ); | 136 | static ODevice *inst ( ); |
114 | 137 | ||
115 | // information | 138 | // information |
116 | 139 | ||
117 | QString modelString ( ) const; | 140 | QString modelString ( ) const; |
118 | OModel model ( ) const; | 141 | OModel model ( ) const; |
119 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } | 142 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } |
120 | 143 | ||
121 | QString vendorString ( ) const; | 144 | QString vendorString ( ) const; |
122 | OVendor vendor ( ) const; | 145 | OVendor vendor ( ) const; |
123 | 146 | ||
124 | QString systemString ( ) const; | 147 | QString systemString ( ) const; |
125 | OSystem system ( ) const; | 148 | OSystem system ( ) const; |
126 | 149 | ||
127 | QString systemVersionString ( ) const; | 150 | QString systemVersionString ( ) const; |
128 | 151 | ||
129 | Transformation rotation ( ) const; | 152 | Transformation rotation ( ) const; |
130 | 153 | ||
131 | // system | 154 | // system |
132 | 155 | ||
133 | virtual bool setSoftSuspend ( bool on ); | 156 | virtual bool setSoftSuspend ( bool on ); |
134 | virtual bool suspend ( ); | 157 | virtual bool suspend ( ); |
135 | 158 | ||
136 | virtual bool setDisplayStatus ( bool on ); | 159 | virtual bool setDisplayStatus ( bool on ); |
137 | virtual bool setDisplayBrightness ( int brightness ); | 160 | virtual bool setDisplayBrightness ( int brightness ); |
138 | virtual int displayBrightnessResolution ( ) const; | 161 | virtual int displayBrightnessResolution ( ) const; |
139 | |||
140 | // input / output | ||
141 | 162 | ||
163 | // input / output | ||
164 | //FIXME playAlarmSound and al might be better -zecke | ||
142 | virtual void alarmSound ( ); | 165 | virtual void alarmSound ( ); |
143 | virtual void keySound ( ); | 166 | virtual void keySound ( ); |
144 | virtual void touchSound ( ); | 167 | virtual void touchSound ( ); |
145 | 168 | ||
146 | virtual QValueList <OLed> ledList ( ) const; | 169 | virtual QValueList <OLed> ledList ( ) const; |
147 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 170 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
@@ -156,13 +179,13 @@ public: | |||
156 | * Returns the available buttons on this device. The number and location | 179 | * Returns the available buttons on this device. The number and location |
157 | * of buttons will vary depending on the device. Button numbers will be assigned | 180 | * of buttons will vary depending on the device. Button numbers will be assigned |
158 | * by the device manufacturer and will be from most preferred button to least preffered | 181 | * by the device manufacturer and will be from most preferred button to least preffered |
159 | * button. Note that this list only contains "user mappable" buttons. | 182 | * button. Note that this list only contains "user mappable" buttons. |
160 | */ | 183 | */ |
161 | const QValueList<ODeviceButton> &buttons ( ); | 184 | const QValueList<ODeviceButton> &buttons ( ); |
162 | 185 | ||
163 | /** | 186 | /** |
164 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 187 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
165 | * returns 0L | 188 | * returns 0L |
166 | */ | 189 | */ |
167 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 190 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
168 | 191 | ||
@@ -172,26 +195,26 @@ public: | |||
172 | */ | 195 | */ |
173 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 196 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
174 | 197 | ||
175 | /** | 198 | /** |
176 | * Reassigns the held action for \a button. To return to the factory | 199 | * Reassigns the held action for \a button. To return to the factory |
177 | * default pass an empty string as \a qcopMessage. | 200 | * default pass an empty string as \a qcopMessage. |
178 | */ | 201 | */ |
179 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 202 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
180 | 203 | ||
181 | /** | 204 | /** |
182 | * How long (in ms) you have to press a button for a "hold" action | 205 | * How long (in ms) you have to press a button for a "hold" action |
183 | */ | 206 | */ |
184 | uint buttonHoldTime ( ) const; | 207 | uint buttonHoldTime ( ) const; |
185 | 208 | ||
186 | signals: | 209 | signals: |
187 | void buttonMappingChanged ( ); | 210 | void buttonMappingChanged ( ); |
188 | 211 | ||
189 | private slots: | 212 | private slots: |
190 | void systemMessage ( const QCString &, const QByteArray & ); | 213 | void systemMessage ( const QCString &, const QByteArray & ); |
191 | 214 | ||
192 | protected: | 215 | protected: |
193 | void reloadButtonMapping ( ); | 216 | void reloadButtonMapping ( ); |
194 | }; | 217 | }; |
195 | 218 | ||
196 | } | 219 | } |
197 | 220 | ||