label.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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