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