summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
Unidiff
Diffstat (limited to 'libopie/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 54b85a2..8164c4d 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -5,145 +5,149 @@
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
29enum Transformation { None, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
30
29class ODeviceData; 31class ODeviceData;
30 32
31namespace Opie { 33namespace Opie {
32 34
33enum OModel { 35enum OModel {
34 Model_Unknown, 36 Model_Unknown,
35 37
36 Model_Series_Mask = 0xff000000, 38 Model_Series_Mask = 0xff000000,
37 39
38 Model_iPAQ = ( 1 << 24 ), 40 Model_iPAQ = ( 1 << 24 ),
39 41
40 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), 42 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
41 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), 43 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ),
42 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), 44 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
43 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), 45 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
44 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), 46 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
45 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), 47 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
46 48
47 Model_Zaurus = ( 2 << 24 ), 49 Model_Zaurus = ( 2 << 24 ),
48 50
49 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), 51 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
50 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), 52 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ),
53 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ),
54 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ),
55 Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ),
51}; 56};
52 57
53 enum OVendor { 58 enum OVendor {
54 Vendor_Unknown, 59 Vendor_Unknown,
55 60
56 Vendor_HP, 61 Vendor_HP,
57 Vendor_Sharp 62 Vendor_Sharp
58 }; 63 };
59 64
60enum OSystem { 65enum OSystem {
61 System_Unknown, 66 System_Unknown,
62 67
63 System_Familiar, 68 System_Familiar,
64 System_Zaurus, 69 System_Zaurus,
65 System_OpenZaurus 70 System_OpenZaurus
66}; 71};
67 72
68enum OLedState { 73enum OLedState {
69 Led_Off, 74 Led_Off,
70 Led_On, 75 Led_On,
71 Led_BlinkSlow, 76 Led_BlinkSlow,
72 Led_BlinkFast 77 Led_BlinkFast
73}; 78};
74 79
75enum OLed { 80enum OLed {
76 Led_Mail, 81 Led_Mail,
77 Led_Power, 82 Led_Power,
78 Led_BlueTooth 83 Led_BlueTooth
79}; 84};
80 85
81enum OHardKey { 86enum OHardKey {
82 HardKey_Datebook = Qt::Key_F9, 87 HardKey_Datebook = Qt::Key_F9,
83 HardKey_Contacts = Qt::Key_F10, 88 HardKey_Contacts = Qt::Key_F10,
84 HardKey_Menu = Qt::Key_F11, 89 HardKey_Menu = Qt::Key_F11,
85 HardKey_Home = Qt::Key_F12, 90 HardKey_Home = Qt::Key_F12,
86 HardKey_Mail = Qt::Key_F13, 91 HardKey_Mail = Qt::Key_F13,
87 HardKey_Record = Qt::Key_F24, 92 HardKey_Record = Qt::Key_F24,
88 HardKey_Suspend = Qt::Key_F34, 93 HardKey_Suspend = Qt::Key_F34,
89 HardKey_Backlight = Qt::Key_F35, 94 HardKey_Backlight = Qt::Key_F35,
90}; 95};
91 96
92
93class ODevice : public QObject { 97class ODevice : public QObject {
94 Q_OBJECT 98 Q_OBJECT
95 99
96private: 100private:
97 ODevice ( const ODevice & ); 101 ODevice ( const ODevice & );
98 102
99protected: 103protected:
100 ODevice ( ); 104 ODevice ( );
101 virtual void init ( ); 105 virtual void init ( );
102 106
103 ODeviceData *d; 107 ODeviceData *d;
104 108
105public: 109public:
106 virtual ~ODevice ( ); 110 virtual ~ODevice ( );
107 111
108 static ODevice *inst ( ); 112 static ODevice *inst ( );
109 113
110
111
112// information 114// information
113 115
114 QString modelString ( ) const; 116 QString modelString ( ) const;
115 OModel model ( ) const; 117 OModel model ( ) const;
116 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } 118 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); }
117 119
118 QString vendorString ( ) const; 120 QString vendorString ( ) const;
119 OVendor vendor ( ) const; 121 OVendor vendor ( ) const;
120 122
121 QString systemString ( ) const; 123 QString systemString ( ) const;
122 OSystem system ( ) const; 124 OSystem system ( ) const;
123 125
124 QString systemVersionString ( ) const; 126 QString systemVersionString ( ) const;
125 127
128 Transformation rotation ( ) const;
129
126 // system 130 // system
127 131
128 virtual bool setSoftSuspend ( bool on ); 132 virtual bool setSoftSuspend ( bool on );
129 virtual bool suspend ( ); 133 virtual bool suspend ( );
130 134
131 virtual bool setDisplayStatus ( bool on ); 135 virtual bool setDisplayStatus ( bool on );
132 virtual bool setDisplayBrightness ( int brightness ); 136 virtual bool setDisplayBrightness ( int brightness );
133 virtual int displayBrightnessResolution ( ) const; 137 virtual int displayBrightnessResolution ( ) const;
134 138
135// input / output 139// input / output
136 140
137 virtual void alarmSound ( ); 141 virtual void alarmSound ( );
138 virtual void keySound ( ); 142 virtual void keySound ( );
139 virtual void touchSound ( ); 143 virtual void touchSound ( );
140 144
141 virtual QValueList <OLed> ledList ( ) const; 145 virtual QValueList <OLed> ledList ( ) const;
142 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 146 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
143 virtual OLedState ledState ( OLed led ) const; 147 virtual OLedState ledState ( OLed led ) const;
144 virtual bool setLedState ( OLed led, OLedState st ); 148 virtual bool setLedState ( OLed led, OLedState st );
145 149
146 virtual bool hasLightSensor ( ) const; 150 virtual bool hasLightSensor ( ) const;
147 virtual int readLightSensor ( ); 151 virtual int readLightSensor ( );
148 virtual int lightSensorResolution ( ) const; 152 virtual int lightSensorResolution ( ) const;
149 153