summaryrefslogtreecommitdiff
path: root/core/applets/volumeapplet/volume.h
Unidiff
Diffstat (limited to 'core/applets/volumeapplet/volume.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/volumeapplet/volume.h40
1 files changed, 16 insertions, 24 deletions
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h
index cb0be72..a982f53 100644
--- a/core/applets/volumeapplet/volume.h
+++ b/core/applets/volumeapplet/volume.h
@@ -1,10 +1,10 @@
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**
@@ -22,31 +22,39 @@
22 22
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qguardedptr.h> 27#include <qguardedptr.h>
28#include <qtimer.h>
29 28
30class QSlider; 29class QSlider;
31class QCheckBox; 30class QCheckBox;
31class QPushButton;
32class QTimer;
32 33
33class VolumeControl : public QFrame 34class VolumeControl : public QFrame
34{ 35{
35 Q_OBJECT 36 Q_OBJECT
36public: 37public:
37 VolumeControl( bool showMic=FALSE, QWidget *parent=0, const char *name=0 ); 38 VolumeControl( QWidget *parent=0, const char *name=0 );
38 39
39public: 40public:
40 QSlider *slider; 41 QSlider *slider;
41 QSlider *mic;
42 QCheckBox *muteBox; 42 QCheckBox *muteBox;
43 43
44private: 44private:
45 void keyPressEvent( QKeyEvent * ); 45 void keyPressEvent( QKeyEvent * );
46 void createView(bool showMic = FALSE); 46
47private slots:
48 void ButtonChanged();
49 void rateTimerDone();
50
51private:
52 QPushButton *upButton;
53 QPushButton *downButton;
54 QTimer *rateTimer;
47}; 55};
48 56
49class VolumeApplet : public QWidget 57class VolumeApplet : public QWidget
50{ 58{
51 Q_OBJECT 59 Q_OBJECT
52public: 60public:
@@ -54,40 +62,24 @@ public:
54 ~VolumeApplet(); 62 ~VolumeApplet();
55 bool isMute( ) { return muted; } 63 bool isMute( ) { return muted; }
56 int percent( ) { return volumePercent; } 64 int percent( ) { return volumePercent; }
57 65
58public slots: 66public slots:
59 void volumeChanged( bool muted ); 67 void volumeChanged( bool muted );
60 void micChanged( bool muted );
61
62 void setVolume( int percent ); 68 void setVolume( int percent );
63 void setMic( int percent );
64
65 void sliderMoved( int percent ); 69 void sliderMoved( int percent );
66 void micMoved( int percent );
67 void mute( bool ); 70 void mute( bool );
68 71
69 void showVolControl(bool showMic = FALSE);
70 void advVolControl();
71
72private: 72private:
73 void readSystemVolume(); 73 void readSystemVolume();
74 void readSystemMic();
75
76 void writeSystemVolume(); 74 void writeSystemVolume();
77 void writeSystemMic();
78
79 void keyPressEvent ( QKeyEvent * e );
80 void mousePressEvent( QMouseEvent * ); 75 void mousePressEvent( QMouseEvent * );
81 void mouseReleaseEvent( QMouseEvent *);
82 void paintEvent( QPaintEvent* ); 76 void paintEvent( QPaintEvent* );
83 77
84private: 78private:
85 int volumePercent, micPercent; 79 int volumePercent;
86 bool muted, micMuted; 80 bool muted;
87 QPixmap volumePixmap; 81 QPixmap volumePixmap;
88 QTimer *advancedTimer;
89}; 82};
90 83
91 84
92#endif // __VOLUME_APPLET_H__ 85#endif // __VOLUME_APPLET_H__
93