author | sandman <sandman> | 2003-03-26 23:53:14 (UTC) |
---|---|---|
committer | sandman <sandman> | 2003-03-26 23:53:14 (UTC) |
commit | 9d291e88efa5b33bbf34112cdee8b0e516150dd6 (patch) (unidiff) | |
tree | 6059b942d98691d7882d5290d5aa854b187f13ce /libopie/odevice.h | |
parent | eda6fffbe8ad7e3635985d9b2a8f7b46964aa271 (diff) | |
download | opie-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
-rw-r--r-- | libopie/odevice.h | 3 |
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 | |||
@@ -82,48 +82,49 @@ enum OLed { | |||
82 | Led_Power, | 82 | Led_Power, |
83 | Led_BlueTooth | 83 | Led_BlueTooth |
84 | }; | 84 | }; |
85 | 85 | ||
86 | enum OHardKey { | 86 | enum 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 | ||
97 | class ODevice : public QObject { | 97 | class ODevice : public QObject { |
98 | Q_OBJECT | 98 | Q_OBJECT |
99 | 99 | ||
100 | private: | 100 | private: |
101 | ODevice ( const ODevice & ); | 101 | ODevice ( const ODevice & ); |
102 | 102 | ||
103 | protected: | 103 | protected: |
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 | ||
109 | public: | 110 | public: |
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 | ||
@@ -136,49 +137,49 @@ public: | |||
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 | ||