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 *getBlock(int index);
\r
33 void addChild(BlockCategory* child);
\r
34 inline void setParent(BlockCategory* _parent) { parent = _parent; }
\r
37 QDomElement save(QDomDocument &doc);
\r
39 BlockCategory *getRoot();
\r
42 QList<BlockCategory *> childs;
\r
43 BlockCategory* parent;
\r
44 QList<ReferenceBlock*> blocks;
\r
50 #endif // BLOCKCATEGORY_H
\r