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.h47
1 files changed, 31 insertions, 16 deletions
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h
index a982f53..9fc12d8 100644
--- a/core/applets/volumeapplet/volume.h
+++ b/core/applets/volumeapplet/volume.h
@@ -1,7 +1,7 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of 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
@@ -17,6 +17,7 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#ifndef __VOLUME_APPLET_H__ 21#ifndef __VOLUME_APPLET_H__
21#define __VOLUME_APPLET_H__ 22#define __VOLUME_APPLET_H__
22 23
@@ -25,33 +26,33 @@
25#include <qframe.h> 26#include <qframe.h>
26#include <qpixmap.h> 27#include <qpixmap.h>
27#include <qguardedptr.h> 28#include <qguardedptr.h>
29#include <qtimer.h>
28 30
29class QSlider; 31class QSlider;
30class QCheckBox; 32class QCheckBox;
31class QPushButton;
32class QTimer;
33 33
34class VolumeControl : public QFrame 34class VolumeControl : public QFrame
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37public: 37public:
38 VolumeControl( QWidget *parent=0, const char *name=0 ); 38 VolumeControl( bool showMic=FALSE, QWidget *parent=0, const char *name=0 );
39 39
40public: 40public:
41 QSlider *slider; 41 QSlider *slider;
42 QSlider *mic;
42 QCheckBox *muteBox; 43 QCheckBox *muteBox;
43 44
44private: 45private:
46 QPushButton *upButton;
47 QPushButton *downButton;
48 QTimer *rateTimer;
49
45 void keyPressEvent( QKeyEvent * ); 50 void keyPressEvent( QKeyEvent * );
46 51 void createView(bool showMic = FALSE);
47private slots: 52private slots:
48 void ButtonChanged(); 53 void ButtonChanged();
49 void rateTimerDone(); 54 void rateTimerDone();
50 55
51private:
52 QPushButton *upButton;
53 QPushButton *downButton;
54 QTimer *rateTimer;
55}; 56};
56 57
57class VolumeApplet : public QWidget 58class VolumeApplet : public QWidget
@@ -65,21 +66,35 @@ public:
65 66
66public slots: 67public slots:
67 void volumeChanged( bool muted ); 68 void volumeChanged( bool muted );
68 void setVolume( int percent ); 69 void micChanged( bool muted );
69 void sliderMoved( int percent ); 70 void sliderMoved( int percent );
70 void mute( bool ); 71 void mute( bool );
71 72
73 void micMoved( int percent );
74 void setVolume( int percent );
75 void setMic( int percent );
76
77 void showVolControl(bool showMic = FALSE);
78 void advVolControl();
79
72private: 80private:
81 int volumePercent, micPercent;
82 bool muted, micMuted;
83 QPixmap volumePixmap;
84 QTimer *advancedTimer;
85
73 void readSystemVolume(); 86 void readSystemVolume();
74 void writeSystemVolume(); 87 void writeSystemVolume();
75 void mousePressEvent( QMouseEvent * ); 88 void mousePressEvent( QMouseEvent * );
76 void paintEvent( QPaintEvent* ); 89 void paintEvent( QPaintEvent* );
77 90
78private: 91 void readSystemMic();
79 int volumePercent; 92 void keyPressEvent ( QKeyEvent * e );
80 bool muted; 93 void mouseReleaseEvent( QMouseEvent *);
81 QPixmap volumePixmap; 94 void writeSystemMic();
95
82}; 96};
83 97
84 98
85#endif // __VOLUME_APPLET_H__ 99#endif // __VOLUME_APPLET_H__
100