]> Shamusworld >> Repos - architektonas/blob - src/base/clipboard.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / clipboard.h
1 #ifndef __CLIPBOARD_H__
2 #define __CLIPBOARD_H__
3
4 #include <iostream>
5 #include "drawing.h"
6
7 #define CLIPBOARD Clipboard::instance()
8
9 class Block;
10 class Layer;
11 class Entity;
12
13 /**
14  * QCad internal clipboard. We don't use the system clipboard for
15  * better portability. Implemented as singleton.
16  *
17  * @author James Hammons
18  * @author Andrew Mustun
19  */
20 class Clipboard
21 {
22         protected:
23                 Clipboard();
24
25         public:
26                 static Clipboard * instance();
27
28                 void clear();
29                 void addBlock(Block * b);
30                 bool hasBlock(const QString & name);
31                 int countBlocks();
32                 Block * blockAt(int i);
33                 void addLayer(Layer* l);
34                 bool hasLayer(const QString & name);
35                 int countLayers();
36                 Layer * layerAt(int i);
37                 void addEntity(Entity * e);
38                 uint count();
39                 Entity * entityAt(uint i);
40                 Entity * firstEntity();
41                 Entity * nextEntity();
42                 Drawing * getGraphic();
43
44                 friend std::ostream & operator<<(std::ostream & os, Clipboard & cb);
45
46         protected:
47                 static Clipboard * uniqueInstance;
48
49                 Drawing graphic;
50 };
51
52 #endif