summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
authorsandman <sandman>2002-10-29 18:43:23 (UTC)
committer sandman <sandman>2002-10-29 18:43:23 (UTC)
commit5ac67b8aece5aca20419f8953f88a36fd729adfc (patch) (unidiff)
tree3ce57c7a938d36ce40ff0dfe4b114233febf7b08 /libopie/odevice.h
parent45d9a30ec17b5146ffdac8e776003752fe2deeea (diff)
downloadopie-5ac67b8aece5aca20419f8953f88a36fd729adfc.zip
opie-5ac67b8aece5aca20419f8953f88a36fd729adfc.tar.gz
opie-5ac67b8aece5aca20419f8953f88a36fd729adfc.tar.bz2
- redone the Model enum to make it easy to check for series (like: is this an
iPAQ - and not is this a 31xx or 36xx or ...) - fixed the disply brightness resolution bug on H38xx
Diffstat (limited to 'libopie/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index e07b91c..e50009c 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -1,146 +1,149 @@
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 <qstring.h> 23#include <qstring.h>
24#include <qnamespace.h> 24#include <qnamespace.h>
25 25
26class ODeviceData; 26class ODeviceData;
27 27
28namespace Opie { 28namespace Opie {
29 29
30enum OModel { 30enum OModel {
31 Model_Unknown, 31 Model_Unknown,
32
33 Model_Series_Mask = 0xff000000,
32 34
33 Model_iPAQ = ( 1 << 16 ), 35 Model_iPAQ = ( 1 << 24 ),
34 36
35 Model_iPAQ_H31xx = ( Model_iPAQ | 1 ), 37 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
36 Model_iPAQ_H36xx = ( Model_iPAQ | 2 ), 38 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ),
37 Model_iPAQ_H37xx = ( Model_iPAQ | 3 ), 39 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
38 Model_iPAQ_H38xx = ( Model_iPAQ | 4 ), 40 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
41 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
42 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
39 43
40 Model_Zaurus = ( 2 << 16 ), 44 Model_Zaurus = ( 2 << 24 ),
41 45
42 Model_Zaurus_SL5000 = ( Model_Zaurus | 1 ), 46 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
43}; 47};
44 48
45 enum OVendor { 49 enum OVendor {
46 Vendor_Unknown, 50 Vendor_Unknown,
47 51
48 Vendor_HP, 52 Vendor_HP,
49 Vendor_Sharp 53 Vendor_Sharp
50 }; 54 };
51 55
52enum OSystem { 56enum OSystem {
53 System_Unknown, 57 System_Unknown,
54 58
55 System_Familiar, 59 System_Familiar,
56 System_Zaurus, 60 System_Zaurus,
57 System_OpenZaurus 61 System_OpenZaurus
58}; 62};
59 63
60enum OLedState { 64enum OLedState {
61 Led_Off, 65 Led_Off,
62 Led_On, 66 Led_On,
63 Led_BlinkSlow, 67 Led_BlinkSlow,
64 Led_BlinkFast 68 Led_BlinkFast
65}; 69};
66 70
67enum OLed { 71enum OLed {
68 Led_Mail, 72 Led_Mail,
69 Led_Power, 73 Led_Power,
70 Led_BlueTooth 74 Led_BlueTooth
71}; 75};
72 76
73enum OHardKey { 77enum OHardKey {
74 HardKey_Datebook = Qt::Key_F9, 78 HardKey_Datebook = Qt::Key_F9,
75 HardKey_Contacts = Qt::Key_F10, 79 HardKey_Contacts = Qt::Key_F10,
76 HardKey_Menu = Qt::Key_F11, 80 HardKey_Menu = Qt::Key_F11,
77 HardKey_Home = Qt::Key_F12, 81 HardKey_Home = Qt::Key_F12,
78 HardKey_Mail = Qt::Key_F14, 82 HardKey_Mail = Qt::Key_F14,
79 HardKey_Record = Qt::Key_F24, 83 HardKey_Record = Qt::Key_F24,
80 HardKey_Suspend = Qt::Key_F34, 84 HardKey_Suspend = Qt::Key_F34,
81 HardKey_Backlight = Qt::Key_F35, 85 HardKey_Backlight = Qt::Key_F35,
82}; 86};
83 87
84 88
85class ODevice 89class ODevice
86{ 90{
87private: 91private:
88 ODevice ( const ODevice & ); 92 ODevice ( const ODevice & );
89 93
90protected: 94protected:
91 ODevice ( ); 95 ODevice ( );
92 virtual void init ( ); 96 virtual void init ( );
93 97
94 ODeviceData *d; 98 ODeviceData *d;
95 99
96public: 100public:
97 virtual ~ODevice ( ); 101 virtual ~ODevice ( );
98 102
99 static ODevice *inst ( ); 103 static ODevice *inst ( );
100 104
101 105
102 106
103// information 107// information
104 108
105 QString modelString ( ) const; 109 QString modelString ( ) const;
106 OModel model ( ) const; 110 OModel model ( ) const;
111 inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); }
107 112
108 QString vendorString ( ) const; 113 QString vendorString ( ) const;
109 OVendor vendor ( ) const; 114 OVendor vendor ( ) const;
110 115
111 QString systemString ( ) const; 116 QString systemString ( ) const;
112 OSystem system ( ) const; 117 OSystem system ( ) const;
113 118
114 QString systemVersionString ( ) const; 119 QString systemVersionString ( ) const;
115 120
116 // system 121 // system
117 122
118 virtual bool setSoftSuspend ( bool on ); 123 virtual bool setSoftSuspend ( bool on );
119 virtual bool suspend ( ); 124 virtual bool suspend ( );
120 125
121 virtual bool setDisplayStatus ( bool on ); 126 virtual bool setDisplayStatus ( bool on );
122 virtual bool setDisplayBrightness ( int brightness ); 127 virtual bool setDisplayBrightness ( int brightness );
123 virtual int displayBrightnessResolution ( ) const; 128 virtual int displayBrightnessResolution ( ) const;
124 129
125// input / output 130// input / output
126 131
127 virtual void alarmSound ( ); 132 virtual void alarmSound ( );
128 virtual void keySound ( ); 133 virtual void keySound ( );
129 virtual void touchSound ( ); 134 virtual void touchSound ( );
130 135
131 virtual QValueList <OLed> ledList ( ) const; 136 virtual QValueList <OLed> ledList ( ) const;
132 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 137 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
133 virtual OLedState ledState ( OLed led ) const; 138 virtual OLedState ledState ( OLed led ) const;
134 virtual bool setLedState ( OLed led, OLedState st ); 139 virtual bool setLedState ( OLed led, OLedState st );
135 140
136 virtual bool hasLightSensor ( ) const; 141 virtual bool hasLightSensor ( ) const;
137 virtual int readLightSensor ( ); 142 virtual int readLightSensor ( );
138 virtual int lightSensorResolution ( ) const; 143 virtual int lightSensorResolution ( ) const;
139
140 //virtual QValueList <int> keyList ( ) const;
141}; 144};
142 145
143} 146}
144 147
145#endif 148#endif
146 149