labellist.h

00001 /*
00002  * Silence
00003  *
00004  * Copyright (C) 2009 Manuel Unglaub
00005  *
00006  * This file is part of Silence.
00007  *
00008  * Silence is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, version GPLv2 only of the License.
00011  *
00012  * Silence is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016 
00017  * You should have received a copy of the GNU General Public License
00018  * along with Silence.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 #ifndef LABELLIST_H
00022 #define LABELLIST_H
00023 
00024 #include <QFrame>
00025 #include <QGridLayout>
00026 #include <QLabel>
00027 #include <QPushButton>
00028 #include <QListWidget>
00029 #include <QAction>
00030 
00031 
00040 class LabelList : public QFrame
00041 {
00042     Q_OBJECT
00043 
00044     public:
00053         LabelList(QWidget *parent = 0, Qt::WindowFlags f = 0);
00054 
00060         ~LabelList();
00061 
00062     signals:
00068         void addedLabel(QString label);
00069 
00075         void removedLabel(QString label);
00076 
00082         void addedBannedLabel(QString label);
00083 
00089         void removedBannedLabel(QString label);
00090 
00096         void clearLabels();
00097 
00103         void clearBannedLabels();
00104 
00105     public slots:
00109         void update();
00110 
00111     private slots:
00112         void toggleVisibility();
00113         void showContextMenu();
00114         void addLabel();
00115         void addBannedLabel();
00116         void clear();
00117 
00118     private:
00119         bool showOptions;
00120         QGridLayout *layout;
00121         QLabel *title;
00122         QPushButton *showBtn;
00123         QListWidget *list;
00124 
00125         QAction *addLabelAction,
00126                 *addBannedLabelAction,
00127                 *clearAction;
00128 
00129         void fillList();
00130         void setupActions();
00131 
00132 };
00133 
00134 #endif // LABELLIST_H
00135 
00136 
Generated on Fri May 14 19:12:50 2010 for Silence by  doxygen 1.6.3