labelwidget.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 LABELWIDGET_H
00022 #define LABELWIDGET_H
00023 
00024 #include "src/data/label.h"
00025 #include <QGridLayout>
00026 #include <QGroupBox>
00027 #include <QPushButton>
00028 #include <QTreeWidget>
00029 #include <QWidget>
00030 
00031 
00039 class LabelWidget : public QWidget
00040 {
00041     Q_OBJECT
00042 
00043     public:
00050         LabelWidget(QWidget *parent = 0, bool showManageLabelsBtn = true);
00051 
00056         ~LabelWidget();
00057 
00058     public slots:
00063         QStringList getLabels() const;
00064 
00069         void selectLabels(QStringList select);
00070 
00074         void manageLabels();
00075 
00079         void updateLabels();
00080 
00081     private slots:
00082         void itemActivated(QTreeWidgetItem *item, int column);
00083 
00084     private:
00085         QGridLayout *layout;
00086         QTreeWidget *labeltree;
00087         QPushButton *manageLabelsBtn;
00088 
00089         void setupTree();
00090         void fillTree();
00091         void addLabel(QTreeWidgetItem* parent, Label* label);
00092         void deselectChildren(QTreeWidgetItem* item);
00093 };
00094 
00095 #endif // LABELWIDGET_H
00096 
Generated on Fri May 14 19:12:50 2010 for Silence by  doxygen 1.6.3