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.h140
1 files changed, 78 insertions, 62 deletions
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h
index 6e631f2..ff5c64a 100644
--- a/core/applets/volumeapplet/volume.h
+++ b/core/applets/volumeapplet/volume.h
@@ -24,81 +24,97 @@
24 24
25#include <qwidget.h>
26#include <qframe.h> 25#include <qframe.h>
27#include <qpixmap.h>
28#include <qguardedptr.h>
29#include <qtimer.h>
30 26
27class QPixmap;
28class QTimer;
31class QSlider; 29class QSlider;
32class QCheckBox; 30class QCheckBox;
31class QButton;
32class OLedBox;
33 33
34class VolumeControl : public QFrame 34class VolumeApplet;
35{
36 Q_OBJECT
37public:
38 VolumeControl( bool showMic=FALSE, QWidget *parent=0, const char *name=0 );
39 35
36class VolumeControl : public QFrame {
37 Q_OBJECT
38
40public: 39public:
41 QSlider *slider; 40 VolumeControl ( VolumeApplet *icon, bool showMic = false, QWidget *parent=0, const char *name=0 );
42 QSlider *mic;
43 QCheckBox *muteBox;
44 QCheckBox *alarmSound;
45 QCheckBox *screentaps;
46 QCheckBox *keyclicks;
47 41
42 bool volMuted ( ) const;
43 int volPercent ( ) const;
48 44
49private: 45 virtual void show ( bool showmic );
50 QPushButton *upButton;
51 QPushButton *downButton;
52 QTimer *rateTimer;
53
54 void keyPressEvent( QKeyEvent * );
55 void createView(bool showMic = FALSE);
56private slots:
57 void ButtonChanged();
58 void rateTimerDone();
59
60};
61 46
62class VolumeApplet : public QWidget 47protected:
63{ 48 virtual void keyPressEvent ( QKeyEvent * e );
64 Q_OBJECT 49
65public: 50protected slots:
66 VolumeApplet( QWidget *parent = 0, const char *name=0 ); 51 void volumeChanged ( bool muted );
67 ~VolumeApplet(); 52 void micChanged ( bool muted );
68 bool isMute( ) { return muted; } 53
69 int percent( ) { return volumePercent; } 54private slots:
70 55 void volMoved ( int percent );
71public slots: 56 void micMoved ( int percent );
72 void volumeChanged( bool muted ); 57 void alarmMoved ( int percent );
73 void micChanged( bool muted ); 58
74 void sliderMoved( int percent ); 59 void volMuteToggled ( bool );
75 void mute( bool ); 60 void micMuteToggled ( bool );
61 void alarmSoundToggled ( bool );
62 void keyClickToggled ( bool );
63 void screenTapToggled ( bool );
64
65 void buttonChanged ( );
66 void rateTimerDone ( );
67
68private:
69 void readConfig ( bool force = false );
76 70
77 void micMoved( int percent ); 71 enum eUpdate {
78 void setVolume( int percent ); 72 UPD_None,
79 void setMic( int percent ); 73 UPD_Vol,
74 UPD_Mic
75 };
76 void writeConfigEntry ( const char *entry, int val, eUpdate upd );
80 77
81 void showVolControl(bool showMic = FALSE);
82 void advVolControl();
83 78
84private: 79private:
85 int volumePercent, micPercent; 80 QSlider *volSlider;
86 bool muted, micMuted; 81 QSlider *micSlider;
87 QPixmap volumePixmap; 82 QSlider *alarmSlider;
88 QTimer *advancedTimer; 83 OLedBox *volLed;
84 OLedBox *micLed;
85 OLedBox *alarmLed;
86
87 QCheckBox *alarmBox;
88 QCheckBox *tapBox;
89 QCheckBox *keyBox;
90 QPushButton *upButton;
91 QPushButton *downButton;
92 QTimer *rateTimer;
93
94 int m_vol_percent;
95 int m_mic_percent;
96 int m_alarm_percent;
97 bool m_vol_muted;
98 bool m_mic_muted;
99 bool m_snd_alarm;
100 bool m_snd_touch;
101 bool m_snd_key;
102
103 VolumeApplet *m_icon;
104};
89 105
90 void readSystemVolume(); 106class VolumeApplet : public QWidget {
91 void writeSystemVolume(); 107 Q_OBJECT
92 void mousePressEvent( QMouseEvent * );
93 void paintEvent( QPaintEvent* );
94 108
95 void readSystemMic(); 109public:
96 void keyPressEvent ( QKeyEvent * e ); 110 VolumeApplet ( QWidget *parent = 0, const char *name=0 );
97 void mouseReleaseEvent( QMouseEvent *); 111 ~VolumeApplet ( );
98 void writeSystemMic();
99 112
100protected slots: 113protected:
101 void alarmSoundCheckToggled(bool); 114 virtual void mousePressEvent ( QMouseEvent * );
102 void keyclicksCheckToggled(bool); 115 virtual void paintEvent ( QPaintEvent* );
103 void screentapsCheckToggled(bool); 116
117private:
118 QPixmap * m_pixmap;
119 VolumeControl *m_dialog;
104}; 120};