summaryrefslogtreecommitdiff
path: root/library/power.h
Unidiff
Diffstat (limited to 'library/power.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/power.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/power.h b/library/power.h
index 99d3595..04499a8 100644
--- a/library/power.h
+++ b/library/power.h
@@ -1,52 +1,52 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef POWER_H 21#ifndef POWER_H
22#define POWER_H 22#define POWER_H
23 23
24#include <qobject.h> 24#include <qobject.h>
25 25
26class PowerStatus 26class PowerStatus
27{ 27{
28public: 28public:
29 PowerStatus() { 29 PowerStatus() {
30 ac = Offline; 30 ac = Offline;
31 bs = NotPresent; 31 bs = NotPresent;
32 bbs = NotPresent; 32 bbs = NotPresent;
33 percentRemain = -1; 33 percentRemain = -1;
34 secsRemain = -1; 34 secsRemain = -1;
35 } 35 }
36 36
37 enum ACStatus { Offline, Online, Backup }; 37 enum ACStatus { Offline, Online, Backup };
38 ACStatus acStatus() const { return ac; } 38 ACStatus acStatus() const { return ac; }
39 39
40 enum BatteryStatus { High=0x01, Low=0x02, VeryLow=0x04, Critical=0x08, 40 enum BatteryStatus { High=0x01, Low=0x02, VeryLow=0x04, Critical=0x08,
41 Charging=0x10, NotPresent=0x20 }; 41 Charging=0x10, NotPresent=0x20 };
42 BatteryStatus batteryStatus() const { return bs; } 42 BatteryStatus batteryStatus() const { return bs; }
43 BatteryStatus backupBatteryStatus() const { return bbs; } 43 BatteryStatus backupBatteryStatus() const { return bbs; }
44 44
45 bool batteryPercentAccurate() const { return percentAccurate; } 45 bool batteryPercentAccurate() const { return percentAccurate; }
46 int batteryPercentRemaining() const { return percentRemain; } 46 int batteryPercentRemaining() const { return percentRemain; }
47 int batteryTimeRemaining() const { return secsRemain; } 47 int batteryTimeRemaining() const { return secsRemain; }
48 48
49 bool operator!=( const PowerStatus &ps ) { 49 bool operator!=( const PowerStatus &ps ) {
50 return (ps.ac != ac) || (ps.bs != bs) || (ps.bbs != bbs) || 50 return (ps.ac != ac) || (ps.bs != bs) || (ps.bbs != bbs) ||
51 (ps.percentRemain != percentRemain) || 51 (ps.percentRemain != percentRemain) ||
52 (ps.secsRemain != secsRemain ); 52 (ps.secsRemain != secsRemain );