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