00001
00002
00003
00004
00005 #ifndef _GAPE_MUTE_CONTROLLER_H_
00006 #define _GAPE_MUTE_CONTROLLER_H_
00007
00008 #include "gapecontroller.h"
00009 #include <qwidget.h>
00010 #include <qlabel.h>
00011 #include <qlayout.h>
00012 #include <qcheckbox.h>
00013
00014 #define GAPE_MUTE_CONTROLLER_HEIGHT 50
00015 #define GAPE_MUTE_CONTROLLER_WIDTH 40
00016
00024 class GapeMuteController : public GapeController
00025 {
00026 Q_OBJECT
00027 public:
00028 QWidget* pic;
00029 QLabel* title;
00030 QLabel* muteLabel;
00031 QCheckBox* muteBox;
00032 QHBoxLayout* columnLayout;
00033
00041 GapeMuteController(QWidget* parent=NULL, const char * name=0, const QPixmap& icon=0)
00042 : GapeController(parent,name),
00043 titleFont("times", 12, QFont::Bold) {
00044 preferredSize.setHeight(GAPE_MUTE_CONTROLLER_HEIGHT);
00045 preferredSize.setWidth(GAPE_MUTE_CONTROLLER_WIDTH);
00046 title = new QLabel(this);
00047 title->setFont(titleFont);
00048 title->setText(name);
00049
00050
00051
00052 muteBox = new QCheckBox(this);
00053 columnLayout = new QHBoxLayout(this);
00054 columnLayout->addWidget(title);
00055
00056 columnLayout->addWidget(muteBox);
00057 connect(muteBox, SIGNAL(toggled(bool)), this, SIGNAL(emitMute(bool)));
00058 connect(this, SIGNAL(emitMute(bool)), this, SLOT(setChecked(bool)));
00059 }
00060
00064 ~GapeMuteController() {};
00065
00066 virtual QSize sizeHint() const {
00067 return preferredSize;
00068 }
00069
00070 public slots:
00071 virtual void setChecked(bool b) {
00072 muteBox->setChecked(b);
00073 }
00074
00075 protected:
00076 QFont titleFont;
00077 QSize preferredSize;
00078
00079 };
00080 #endif