1 #ifndef __BLOCKLIBRARYTREE_H__
2 #define __BLOCKLIBRARYTREE_H__
14 #include "BlockCategory.h"
15 #include "Exception.h"
20 class BlockLibraryTree {
26 void clear(); // free thewhole tree
27 void clearBlocks(); // just remove the blocks from the BlockCateogry lists
28 void addItem(QXmlAttributes &attributes);
29 bool initChildParent();
31 BlockCategory *getRoot();
32 BlockCategory *searchCategory(int id);
34 QDomElement save(QDomDocument &doc);
35 void load(QDomElement &elt) throw(Exception);
38 This class builds a tree of BlockCategory, but it also stores all BlockCategory object
39 in an array so that access via an id is direct.
41 The root of the tree is in fact tabCategories[0]
43 BlockCategory** tabCategories;
50 #endif // BLOCKLIBRARYTREE_H