]> Shamusworld >> Repos - architektonas/blob - src/base/blocklist.h
Fixed thumbnail rendering in LibraryWidget and DXF detection.
[architektonas] / src / base / blocklist.h
1 #ifndef __BLOCKLIST_H__
2 #define __BLOCKLIST_H__
3
4 #include <QtCore>
5 #include "block.h"
6 //#include "blocklistlistener.h"
7 #include "entity.h"
8
9 /**
10  * List of blocks.
11  *
12  * @see RS_Block
13  *
14  * @author Andrew Mustun
15  */
16 class RS_BlockList
17 {
18         public:
19                 RS_BlockList(bool owner = false);
20                 virtual ~RS_BlockList();
21
22                 void clear();
23                 uint count();
24                 RS_Block * at(uint i);
25                 void activate(const QString & name);
26                 void activate(RS_Block * block);
27                 RS_Block * getActive();
28                 virtual bool add(RS_Block * block, bool notify = true);
29                 virtual void addNotification();
30                 virtual void remove(RS_Block * block);
31                 virtual bool rename(RS_Block * block, const QString & name);
32                 //virtual void editBlock(RS_Block* block, const RS_Block& source);
33                 RS_Block * find(const QString & name);
34                 QString newName(const QString & suggestion = "");
35                 void toggle(const QString & name);
36                 void toggle(RS_Block * block);
37                 void freezeAll(bool freeze);
38 //              void addListener(RS_BlockListListener * listener);
39 //              void removeListener(RS_BlockListListener * listener);
40                 void setModified(bool m);
41                 virtual bool isModified() const;
42
43                 friend std::ostream & operator<<(std::ostream & os, RS_BlockList & b);
44
45         private:
46                 //! Is the list owning the blocks?
47                 bool owner;
48                 //! Blocks in the graphic
49                 QList<RS_Block *> blocks;
50                 //! List of registered BlockListListeners
51 //              QList<RS_BlockListListener *> blockListListeners;
52                 //! Currently active block
53                 RS_Block * activeBlock;
54                 /** Flag set if the layer list was modified and not yet saved. */
55                 bool modified;
56 };
57
58 #endif