1 #ifndef BLOCKCATEGORY_H
\r
2 #define BLOCKCATEGORY_H
\r
8 #include "ReferenceBlock.h"
\r
9 class ReferenceBlock;
\r
11 using namespace std;
\r
16 class BlockCategory {
\r
19 BlockCategory(QString _name, int _id, BlockCategory* _parent = NULL);
\r
22 inline int getId() { return id; }
\r
23 inline QString getName() { return name; }
\r
24 inline BlockCategory* getParent() { return parent; }
\r
25 inline QList<BlockCategory *> getChilds() { return childs; }
\r
26 BlockCategory* getChild(QString name);
\r
27 BlockCategory* getChild(int index);
\r
28 QList<BlockCategory *> getAllChilds();
\r
29 inline QList<ReferenceBlock*> getBlocks() { return blocks; }
\r
30 ReferenceBlock *getBlockById(int index);
\r
31 ReferenceBlock *getBlockByName(QString name);
\r
34 void addChild(BlockCategory* child);
\r
35 inline void setParent(BlockCategory* _parent) { parent = _parent; }
\r
38 QDomElement save(QDomDocument &doc);
\r
40 BlockCategory *getRoot();
\r
43 QList<BlockCategory *> childs;
\r
44 BlockCategory* parent;
\r
45 QList<ReferenceBlock*> blocks;
\r
51 #endif // BLOCKCATEGORY_H
\r