00001 /********************************************************************** 00002 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 #ifndef BATTERY_STATUS_H 00021 #define BATTERY_STATUS_H 00022 00023 #include <qframe.h> 00024 00025 class PowerStatus; 00026 00027 class BatteryStatus : public QFrame 00028 { 00029 Q_OBJECT 00030 public: 00031 BatteryStatus( const PowerStatus *s, QWidget *parent=0, WFlags f = 0 ); 00032 ~BatteryStatus(); 00033 void BatteryStatus::UpdateBatteryStatus(); 00034 void updatePercent( int ); 00035 QSize sizeHint() const; 00036 protected: 00037 void drawSegment( QPainter *p, const QRect &r, const QColor &topgrad, const QColor &botgrad, const QColor &highlight, int hightlight_height ); 00038 void paintEvent( QPaintEvent *pe ); 00039 bool BatteryStatus::getProcApmStatusIpaq(); 00040 00041 private: 00042 QString statusText() const; 00043 QString statusTextIpaq() const; 00044 const PowerStatus *ps; 00045 int percent; 00046 int ipaqPercent; 00047 int jackPercent; 00048 int jackMinutes; 00049 QString perc1; 00050 QString sec1; 00051 QString perc2; 00052 QString sec2; 00053 QString ipaqStatus; 00054 QString jackStatus; 00055 QString ipaqChem; 00056 QString jackChem; 00057 bool bat2; 00058 bool bat2inserted; 00059 int screenWidth; 00060 int screenHeight; 00061 }; 00062 00063 #endif 00064
1.4.2