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