author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/applets/volumeapplet/volume.h | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'core/applets/volumeapplet/volume.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/volumeapplet/volume.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h new file mode 100644 index 0000000..5704cad --- a/dev/null +++ b/core/applets/volumeapplet/volume.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef __VOLUME_APPLET_H__ | ||
21 | #define __VOLUME_APPLET_H__ | ||
22 | |||
23 | |||
24 | #include <qwidget.h> | ||
25 | #include <qframe.h> | ||
26 | #include <qpixmap.h> | ||
27 | #include <qguardedptr.h> | ||
28 | |||
29 | class QSlider; | ||
30 | class QCheckBox; | ||
31 | |||
32 | class VolumeControl : public QFrame | ||
33 | { | ||
34 | Q_OBJECT | ||
35 | public: | ||
36 | VolumeControl( QWidget *parent=0, const char *name=0 ); | ||
37 | |||
38 | public: | ||
39 | QSlider *slider; | ||
40 | QCheckBox *muteBox; | ||
41 | |||
42 | private: | ||
43 | void keyPressEvent( QKeyEvent * ); | ||
44 | }; | ||
45 | |||
46 | class VolumeApplet : public QWidget | ||
47 | { | ||
48 | Q_OBJECT | ||
49 | public: | ||
50 | VolumeApplet( QWidget *parent = 0, const char *name=0 ); | ||
51 | ~VolumeApplet(); | ||
52 | bool isMute( ) { return muted; } | ||
53 | int percent( ) { return volumePercent; } | ||
54 | |||
55 | public slots: | ||
56 | void volumeChanged( bool muted ); | ||
57 | void setVolume( int percent ); | ||
58 | void sliderMoved( int percent ); | ||
59 | void mute( bool ); | ||
60 | |||
61 | private: | ||
62 | void readSystemVolume(); | ||
63 | void writeSystemVolume(); | ||
64 | void mousePressEvent( QMouseEvent * ); | ||
65 | void paintEvent( QPaintEvent* ); | ||
66 | |||
67 | private: | ||
68 | int volumePercent; | ||
69 | bool muted; | ||
70 | QPixmap volumePixmap; | ||
71 | }; | ||
72 | |||
73 | |||
74 | #endif // __VOLUME_APPLET_H__ | ||
75 | |||