label.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 LABEL_H
00022 #define LABEL_H
00023 
00024 #include <QList>
00025 #include <QString>
00026 #include <QStringList>
00027 
00037 class Label
00038 {
00039     public:
00044         Label();
00045 
00052         Label(QString text);
00053 
00058         ~Label();
00059 
00064         int getIndex() const;
00065 
00070         QString getText();
00071 
00076         void setText(QString text);
00077 
00082         Label* getParent();
00083 
00089         Label* getChild(int index);
00090 
00097         bool addChild(int index, Label *child);
00098 
00105         bool addChildren(int position, int count);
00106 
00113         bool removeChildren(int position, int count);
00114 
00119         void appendChild(Label *child);
00120 
00125         int childCount();
00126 
00131         QStringList toStringList();
00132 
00138         bool contains(QString labelText);
00139     
00140     protected:
00145         void setParent(Label *parent);
00146 
00147     private:
00148         QString text;
00149         Label* parent;
00150         QList<Label*> children;
00151         
00152         void init(Label *parent, QString text);
00153 };
00154 
00155 #endif // LABEL_H
00156 
Generated on Fri May 14 19:12:50 2010 for Silence by  doxygen 1.6.3