summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
Unidiff
Diffstat (limited to 'libopie/odevice.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevice.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index ff578d8..45a790b 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -23,54 +23,63 @@
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
35/**
36 * The available devices
37 */
35enum OModel { 38enum 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 ),
44 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), 47 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
45 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), 48 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
46 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), 49 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
47 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), 50 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
48 51
49 Model_Zaurus = ( 2 << 24 ), 52 Model_Zaurus = ( 2 << 24 ),
50 53
51 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), 54 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
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
61/**
62 * The vendor of the device
63 */
58 enum OVendor { 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 */
65enum OSystem { 74enum 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
71}; 80};
72 81
73enum OLedState { 82enum OLedState {
74 Led_Off, 83 Led_Off,
75 Led_On, 84 Led_On,
76 Led_BlinkSlow, 85 Led_BlinkSlow,
@@ -85,40 +94,54 @@ enum OLed {
85 94
86enum OHardKey { 95enum OHardKey {
87 HardKey_Datebook = Qt::Key_F9, 96 HardKey_Datebook = Qt::Key_F9,
88 HardKey_Contacts = Qt::Key_F10, 97 HardKey_Contacts = Qt::Key_F10,
89 HardKey_Menu = Qt::Key_F11, 98 HardKey_Menu = Qt::Key_F11,
90 HardKey_Home = Qt::Key_F12, 99 HardKey_Home = Qt::Key_F12,
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 */
97class ODevice : public QObject { 117class ODevice : public QObject {
98 Q_OBJECT 118 Q_OBJECT
99 119
100private: 120private:
121 /* disable copy */
101 ODevice ( const ODevice & ); 122 ODevice ( const ODevice & );
102 123
103protected: 124protected:
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
110public: 131public:
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;
@@ -129,25 +152,25 @@ public:
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 162
140// input / output 163// input / output
141 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;
148 virtual OLedState ledState ( OLed led ) const; 171 virtual OLedState ledState ( OLed led ) const;
149 virtual bool setLedState ( OLed led, OLedState st ); 172 virtual bool setLedState ( OLed led, OLedState st );
150 173
151 virtual bool hasLightSensor ( ) const; 174 virtual bool hasLightSensor ( ) const;
152 virtual int readLightSensor ( ); 175 virtual int readLightSensor ( );
153 virtual int lightSensorResolution ( ) const; 176 virtual int lightSensorResolution ( ) const;