00001 /* 00002 This file is part of the Opie Project 00003 00004 =. (C) 2004 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 00005 .=l. Based on Qtopia 1.7 Brightnessapplet (C) 2003-2004 TrollTech 00006 .>+-= 00007 _;:, .> :=|. This program is free software; you can 00008 .> <`_, > . <= redistribute it and/or modify it under 00009 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00010 .="- .-=="i, .._ License as published by the Free Software 00011 - . .-<_> .<> Foundation; either version 2 of the License, 00012 ._= =} : or (at your option) any later version. 00013 .%`+i> _;_. 00014 .i_,=:_. -<s. This program is distributed in the hope that 00015 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00016 : .. .:, . . . without even the implied warranty of 00017 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00018 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00019 ..}^=.= = ; General Public License for more 00020 ++= -. .` .: details. 00021 : = ...= . :.=- 00022 -. .:....=;==+<; You should have received a copy of the GNU 00023 -_. . . )=. = General Public License along with 00024 -- :-=` this application; see the file COPYING.LIB. 00025 If not, write to the Free Software Foundation, 00026 Inc., 59 Temple Place - Suite 330, 00027 Boston, MA 02111-1307, USA. 00028 00029 */ 00030 00031 #ifndef NETWORKAPPLET_H 00032 #define NETWORKAPPLET_H 00033 00034 #include <opie2/otaskbarapplet.h> 00035 #include <qframe.h> 00036 #include <qstring.h> 00037 #include <qtoolbutton.h> 00038 #include <qlineedit.h> 00039 #include <qpixmap.h> 00040 00041 class QShowEvent; 00042 class QHideEvent; 00043 class QSlider; 00044 00045 class BrightnessAppletControl : public QFrame 00046 { 00047 public: 00048 BrightnessAppletControl( Opie::Ui::OTaskbarApplet* parent, const char* name = 0 ); 00049 ~BrightnessAppletControl(); 00050 virtual void hideEvent( QHideEvent* ); 00051 QSlider* slider; 00052 }; 00053 00054 class BrightnessApplet : public Opie::Ui::OTaskbarApplet 00055 { 00056 Q_OBJECT 00057 00058 public: 00059 BrightnessApplet( QWidget* parent = 0, const char* name = 0 ); 00060 ~BrightnessApplet(); 00061 00062 void writeSystemBrightness( int brightness ); 00063 int readSystemBrightness(); 00064 int calcBrightnessValue(); 00065 00066 static int position(); 00067 00068 public slots: 00069 void sliderMoved( int value ); 00070 00071 protected: 00072 virtual void paintEvent( QPaintEvent* ); 00073 virtual void mousePressEvent( QMouseEvent* ); 00074 00075 private: 00076 BrightnessAppletControl* _control; 00077 QPixmap _pixmap; 00078 }; 00079 00080 #endif 00081
1.4.2