summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
authorsandman <sandman>2003-03-26 23:53:14 (UTC)
committer sandman <sandman>2003-03-26 23:53:14 (UTC)
commit9d291e88efa5b33bbf34112cdee8b0e516150dd6 (patch) (unidiff)
tree6059b942d98691d7882d5290d5aa854b187f13ce /libopie/odevice.h
parenteda6fffbe8ad7e3635985d9b2a8f7b46964aa271 (diff)
downloadopie-9d291e88efa5b33bbf34112cdee8b0e516150dd6.zip
opie-9d291e88efa5b33bbf34112cdee8b0e516150dd6.tar.gz
opie-9d291e88efa5b33bbf34112cdee8b0e516150dd6.tar.bz2
delay the initialization of the button information:
- faster startup for apps that are not accessing the HW buttons - the basic ODevice stuff is useable without a QApplication object
Diffstat (limited to 'libopie/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 575e1fe..ff578d8 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -10,189 +10,190 @@
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
35enum OModel { 35enum OModel {
36 Model_Unknown, 36 Model_Unknown,
37 37
38 Model_Series_Mask = 0xff000000, 38 Model_Series_Mask = 0xff000000,
39 39
40 Model_iPAQ = ( 1 << 24 ), 40 Model_iPAQ = ( 1 << 24 ),
41 41
42 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), 42 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
43 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), 43 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ),
44 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), 44 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
45 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), 45 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
46 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), 46 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
47 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), 47 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
48 48
49 Model_Zaurus = ( 2 << 24 ), 49 Model_Zaurus = ( 2 << 24 ),
50 50
51 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), 51 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
52 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), 52 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ),
53 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), 53 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ),
54 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), 54 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ),
55 Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), 55 Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ),
56}; 56};
57 57
58 enum OVendor { 58 enum OVendor {
59 Vendor_Unknown, 59 Vendor_Unknown,
60 60
61 Vendor_HP, 61 Vendor_HP,
62 Vendor_Sharp 62 Vendor_Sharp
63 }; 63 };
64 64
65enum OSystem { 65enum OSystem {
66 System_Unknown, 66 System_Unknown,
67 67
68 System_Familiar, 68 System_Familiar,
69 System_Zaurus, 69 System_Zaurus,
70 System_OpenZaurus 70 System_OpenZaurus
71}; 71};
72 72
73enum OLedState { 73enum OLedState {
74 Led_Off, 74 Led_Off,
75 Led_On, 75 Led_On,
76 Led_BlinkSlow, 76 Led_BlinkSlow,
77 Led_BlinkFast 77 Led_BlinkFast
78}; 78};
79 79
80enum OLed { 80enum OLed {
81 Led_Mail, 81 Led_Mail,
82 Led_Power, 82 Led_Power,
83 Led_BlueTooth 83 Led_BlueTooth
84}; 84};
85 85
86enum OHardKey { 86enum OHardKey {
87 HardKey_Datebook = Qt::Key_F9, 87 HardKey_Datebook = Qt::Key_F9,
88 HardKey_Contacts = Qt::Key_F10, 88 HardKey_Contacts = Qt::Key_F10,
89 HardKey_Menu = Qt::Key_F11, 89 HardKey_Menu = Qt::Key_F11,
90 HardKey_Home = Qt::Key_F12, 90 HardKey_Home = Qt::Key_F12,
91 HardKey_Mail = Qt::Key_F13, 91 HardKey_Mail = Qt::Key_F13,
92 HardKey_Record = Qt::Key_F24, 92 HardKey_Record = Qt::Key_F24,
93 HardKey_Suspend = Qt::Key_F34, 93 HardKey_Suspend = Qt::Key_F34,
94 HardKey_Backlight = Qt::Key_F35, 94 HardKey_Backlight = Qt::Key_F35,
95}; 95};
96 96
97class ODevice : public QObject { 97class ODevice : public QObject {
98 Q_OBJECT 98 Q_OBJECT
99 99
100private: 100private:
101 ODevice ( const ODevice & ); 101 ODevice ( const ODevice & );
102 102
103protected: 103protected:
104 ODevice ( ); 104 ODevice ( );
105 virtual void init ( ); 105 virtual void init ( );
106 virtual void initButtons ( );
106 107
107 ODeviceData *d; 108 ODeviceData *d;
108 109
109public: 110public:
110 virtual ~ODevice ( ); 111 virtual ~ODevice ( );
111 112
112 static ODevice *inst ( ); 113 static ODevice *inst ( );
113 114
114// information 115// information
115 116
116 QString modelString ( ) const; 117 QString modelString ( ) const;
117 OModel model ( ) const; 118 OModel model ( ) const;
118 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } 119 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); }
119 120
120 QString vendorString ( ) const; 121 QString vendorString ( ) const;
121 OVendor vendor ( ) const; 122 OVendor vendor ( ) const;
122 123
123 QString systemString ( ) const; 124 QString systemString ( ) const;
124 OSystem system ( ) const; 125 OSystem system ( ) const;
125 126
126 QString systemVersionString ( ) const; 127 QString systemVersionString ( ) const;
127 128
128 Transformation rotation ( ) const; 129 Transformation rotation ( ) const;
129 130
130 // system 131 // system
131 132
132 virtual bool setSoftSuspend ( bool on ); 133 virtual bool setSoftSuspend ( bool on );
133 virtual bool suspend ( ); 134 virtual bool suspend ( );
134 135
135 virtual bool setDisplayStatus ( bool on ); 136 virtual bool setDisplayStatus ( bool on );
136 virtual bool setDisplayBrightness ( int brightness ); 137 virtual bool setDisplayBrightness ( int brightness );
137 virtual int displayBrightnessResolution ( ) const; 138 virtual int displayBrightnessResolution ( ) const;
138 139
139// input / output 140// input / output
140 141
141 virtual void alarmSound ( ); 142 virtual void alarmSound ( );
142 virtual void keySound ( ); 143 virtual void keySound ( );
143 virtual void touchSound ( ); 144 virtual void touchSound ( );
144 145
145 virtual QValueList <OLed> ledList ( ) const; 146 virtual QValueList <OLed> ledList ( ) const;
146 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 147 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
147 virtual OLedState ledState ( OLed led ) const; 148 virtual OLedState ledState ( OLed led ) const;
148 virtual bool setLedState ( OLed led, OLedState st ); 149 virtual bool setLedState ( OLed led, OLedState st );
149 150
150 virtual bool hasLightSensor ( ) const; 151 virtual bool hasLightSensor ( ) const;
151 virtual int readLightSensor ( ); 152 virtual int readLightSensor ( );
152 virtual int lightSensorResolution ( ) const; 153 virtual int lightSensorResolution ( ) const;
153 154
154 /** 155 /**
155 * Returns the available buttons on this device. The number and location 156 * Returns the available buttons on this device. The number and location
156 * of buttons will vary depending on the device. Button numbers will be assigned 157 * of buttons will vary depending on the device. Button numbers will be assigned
157 * by the device manufacturer and will be from most preferred button to least preffered 158 * by the device manufacturer and will be from most preferred button to least preffered
158 * button. Note that this list only contains "user mappable" buttons. 159 * button. Note that this list only contains "user mappable" buttons.
159 */ 160 */
160 const QValueList<ODeviceButton> &buttons ( ) const; 161 const QValueList<ODeviceButton> &buttons ( );
161 162
162 /** 163 /**
163 * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it 164 * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it
164 * returns 0L 165 * returns 0L
165 */ 166 */
166 const ODeviceButton *buttonForKeycode ( ushort keyCode ); 167 const ODeviceButton *buttonForKeycode ( ushort keyCode );
167 168
168 /** 169 /**
169 * Reassigns the pressed action for \a button. To return to the factory 170 * Reassigns the pressed action for \a button. To return to the factory
170 * default pass an empty string as \a qcopMessage. 171 * default pass an empty string as \a qcopMessage.
171 */ 172 */
172 void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); 173 void remapPressedAction ( int button, const OQCopMessage &qcopMessage );
173 174
174 /** 175 /**
175 * Reassigns the held action for \a button. To return to the factory 176 * Reassigns the held action for \a button. To return to the factory
176 * default pass an empty string as \a qcopMessage. 177 * default pass an empty string as \a qcopMessage.
177 */ 178 */
178 void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); 179 void remapHeldAction ( int button, const OQCopMessage &qcopMessage );
179 180
180 /** 181 /**
181 * How long (in ms) you have to press a button for a "hold" action 182 * How long (in ms) you have to press a button for a "hold" action
182 */ 183 */
183 uint buttonHoldTime ( ) const; 184 uint buttonHoldTime ( ) const;
184 185
185 signals: 186 signals:
186 void buttonMappingChanged ( ); 187 void buttonMappingChanged ( );
187 188
188 private slots: 189 private slots:
189 void systemMessage ( const QCString &, const QByteArray & ); 190 void systemMessage ( const QCString &, const QByteArray & );
190 191
191protected: 192protected:
192 void reloadButtonMapping ( ); 193 void reloadButtonMapping ( );
193}; 194};
194 195
195} 196}
196 197
197#endif 198#endif
198 199