summaryrefslogtreecommitdiff
path: root/libopie/odevice.h
authorsandman <sandman>2002-09-30 21:09:13 (UTC)
committer sandman <sandman>2002-09-30 21:09:13 (UTC)
commit3ff016b281a3c059e6ecb728c60fd6847756f291 (patch) (unidiff)
tree6d7b341ef586552b1a2154af047b41fb567b59d9 /libopie/odevice.h
parent5158385997be6b64cab623674f9e9e1835f94fc6 (diff)
downloadopie-3ff016b281a3c059e6ecb728c60fd6847756f291.zip
opie-3ff016b281a3c059e6ecb728c60fd6847756f291.tar.gz
opie-3ff016b281a3c059e6ecb728c60fd6847756f291.tar.bz2
- partly rearranged for better bc in the future
- led handling rewritten - cleanups - another try at fixing the OZ suspend "glitches"
Diffstat (limited to 'libopie/odevice.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.h121
1 files changed, 71 insertions, 50 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 2f676ff..38f3787 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -1,117 +1,138 @@
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 24#include <qnamespace.h>
25 25
26class ODeviceData; 26class ODeviceData;
27 27
28namespace Opie {
29
28enum OModel { 30enum OModel {
29 OMODEL_Unknown, 31 Model_Unknown,
30 32
31 OMODEL_iPAQ_H31xx, 33 Model_iPAQ_H31xx,
32 OMODEL_iPAQ_H36xx, 34 Model_iPAQ_H36xx,
33 OMODEL_iPAQ_H37xx, 35 Model_iPAQ_H37xx,
34 OMODEL_iPAQ_H38xx, 36 Model_iPAQ_H38xx,
35 37
36 OMODEL_Zaurus_SL5000 38 Model_Zaurus_SL5000
37}; 39};
38 40
39 enum OVendor { 41 enum OVendor {
40 OVENDOR_Unknown, 42 Vendor_Unknown,
41 43
42 OVENDOR_HP, 44 Vendor_HP,
43 OVENDOR_Sharp 45 Vendor_Sharp
44 }; 46 };
45 47
46enum OSystem { 48enum OSystem {
47 OSYSTEM_Unknown, 49 System_Unknown,
48 50
49 OSYSTEM_Familiar, 51 System_Familiar,
50 OSYSTEM_Zaurus, 52 System_Zaurus,
51 OSYSTEM_OpenZaurus 53 System_OpenZaurus
52}; 54};
53 55
54enum OLedState { 56enum OLedState {
55 OLED_Off, 57 Led_Off,
56 OLED_On, 58 Led_On,
57 OLED_BlinkSlow, 59 Led_BlinkSlow,
58 OLED_BlinkFast 60 Led_BlinkFast
61};
62
63enum OLed {
64 Led_Mail,
65 Led_Power,
66 Led_BlueTooth
67};
68
69enum OHardKey {
70 HardKey_Datebook = Qt::Key_F9,
71 HardKey_Contacts = Qt::Key_F10,
72 HardKey_Menu = Qt::Key_F11,
73 HardKey_Home = Qt::Key_F12,
74 HardKey_Mail = Qt::Key_F14,
75 HardKey_Record = Qt::Key_F24,
76 HardKey_Suspend = Qt::Key_F34,
77 HardKey_Backlight = Qt::Key_F35,
59}; 78};
60 79
61 80
62class ODevice 81class ODevice
63{ 82{
83private:
84 ODevice ( const ODevice & );
85
86protected:
87 ODevice ( );
88 virtual void init ( );
89
90 ODeviceData *d;
91
64public: 92public:
93 virtual ~ODevice ( );
94
65 static ODevice *inst ( ); 95 static ODevice *inst ( );
66 96
67 // system
68 enum PowerButtonHandler {
69 KERNEL,
70 OPIE
71 };
72 97
73 virtual bool setPowerButtonHandler ( PowerButtonHandler h );
74 virtual bool suspend ( );
75 98
76 virtual bool setDisplayStatus ( bool on );
77 virtual bool setDisplayBrightness ( int brightness );
78 virtual int displayBrightnessResolution ( ) const;
79
80// information 99// information
81 100
82 QString modelString ( ); 101 QString modelString ( ) const;
83 OModel model ( ); 102 OModel model ( ) const;
84 103
85 QString vendorString ( ); 104 QString vendorString ( ) const;
86 OVendor vendor ( ); 105 OVendor vendor ( ) const;
106
107 QString systemString ( ) const;
108 OSystem system ( ) const;
109
110 QString systemVersionString ( ) const;
87 111
88 QString systemString ( ); 112 // system
89 OSystem system ( );
90 113
91 QString systemVersionString ( ); 114 virtual bool setSoftSuspend ( bool on );
115 virtual bool suspend ( );
92 116
117 virtual bool setDisplayStatus ( bool on );
118 virtual bool setDisplayBrightness ( int brightness );
119 virtual int displayBrightnessResolution ( ) const;
120
93// input / output 121// input / output
94 122
95 virtual void alarmSound ( ); 123 virtual void alarmSound ( );
96 virtual void keySound ( ); 124 virtual void keySound ( );
97 virtual void touchSound ( ); 125 virtual void touchSound ( );
98 126
99 virtual uint hasLeds ( ) const; 127 virtual QValueList <OLed> ledList ( ) const;
100 virtual OLedState led ( uint which ) const; 128 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
101 virtual bool setLed ( uint which, OLedState st ); 129 virtual OLedState ledState ( OLed led ) const;
102 130 virtual bool setLedState ( OLed led, OLedState st );
103 virtual ~ODevice ( );
104 131
105protected: 132 //virtual QValueList <int> keyList ( ) const;
106 ODevice ( );
107 virtual void init ( );
108
109 ODeviceData *d;
110
111private:
112 ODevice ( const ODevice & );
113}; 133};
114 134
115#endif 135}
116 136
137#endif
117 138