Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

volume.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 
00021 #ifndef __VOLUME_APPLET_H__
00022 #define __VOLUME_APPLET_H__
00023 
00024 
00025 #include <qframe.h>
00026 
00027 class QPixmap;
00028 class QTimer;
00029 class QSlider;
00030 class QCheckBox;
00031 class QButton;
00032 namespace Opie { namespace Ui { class OLedBox; }; };
00033 
00034 class VolumeApplet;
00035 
00036 class VolumeControl : public QFrame {
00037         Q_OBJECT
00038         
00039 public:
00040         VolumeControl ( VolumeApplet *icon, bool showMic = false, QWidget *parent=0, const char *name=0 );
00041 
00042         bool volMuted ( ) const;
00043         int volPercent ( ) const;
00044 
00045         virtual void show ( bool showmic );
00046 
00047 protected:
00048         virtual void keyPressEvent ( QKeyEvent * e );
00049         
00050 protected slots:
00051         void volumeChanged ( bool muted );
00052         void micChanged ( bool muted );
00053         
00054 private slots:
00055         void volMoved ( int percent );
00056         void micMoved ( int percent );
00057         void alarmMoved ( int percent );
00058         void bassMoved( int percent );
00059         void trebleMoved( int percent );
00060         
00061         void volMuteToggled ( bool );
00062         void micMuteToggled ( bool );
00063         void alarmSoundToggled ( bool );
00064         void keyClickToggled ( bool );
00065         void screenTapToggled ( bool ); 
00066 
00067         void buttonChanged ( );
00068         void rateTimerDone ( );
00069         
00070 private:
00071         void readConfig ( bool force = false );
00072 
00073         enum eUpdate {
00074                 UPD_None,
00075                 UPD_Vol,
00076                 UPD_Mic,
00077                 UPD_Bass,
00078                 UPD_Treble
00079         };
00080         void writeConfigEntry ( const char *entry, int val, eUpdate upd );
00081 
00082 
00083 private:
00084         QSlider *volSlider;
00085         QSlider *bassSlider;
00086         QSlider *trebleSlider;
00087         QSlider *micSlider;
00088         QSlider *alarmSlider;
00089         Opie::Ui::OLedBox *volLed;
00090         Opie::Ui::OLedBox *micLed;
00091         Opie::Ui::OLedBox *alarmLed;
00092         
00093         QCheckBox *alarmBox;
00094         QCheckBox *tapBox;
00095         QCheckBox *keyBox;
00096         QPushButton *upButton;
00097         QPushButton *downButton;
00098         QTimer *rateTimer;
00099 
00100         int  m_vol_percent;
00101         int  m_mic_percent;
00102         int  m_alarm_percent;
00103         int  m_bass_percent;
00104         int  m_treble_percent;
00105         bool m_vol_muted;
00106         bool m_mic_muted;       
00107         bool m_snd_alarm;
00108         bool m_snd_touch;
00109         bool m_snd_key;
00110 
00111         VolumeApplet *m_icon;   
00112 };
00113 
00114 class VolumeApplet : public QWidget {
00115         Q_OBJECT
00116 
00117 public:
00118         VolumeApplet ( QWidget *parent = 0, const char *name=0 );
00119         ~VolumeApplet ( );
00120         static int position();
00121 
00122         void redraw ( bool all = true );
00123 
00124 protected:
00125         virtual void mousePressEvent ( QMouseEvent * );
00126         virtual void paintEvent ( QPaintEvent* );
00127         
00128 private:
00129         QPixmap *      m_pixmap;
00130         VolumeControl *m_dialog;
00131 };
00132 
00133 
00134 #endif // __VOLUME_APPLET_H__
00135 

Generated on Sat Nov 5 16:15:25 2005 for OPIE by  doxygen 1.4.2