]> Shamusworld >> Repos - architektonas/blob - src/base/rs_layer.h
Scrubbed out all references to RS2::qtToRsButton(). Gone!
[architektonas] / src / base / rs_layer.h
1 #ifndef RS_LAYER_H
2 #define RS_LAYER_H
3
4 #include <stddef.h>
5
6 #ifdef __hpux
7 #include <sys/_size_t.h>
8 #endif
9
10 #include <iostream>
11 #include <QtCore>
12
13 #include "rs_flags.h"
14 #include "rs_pen.h"
15
16 /**
17  * Holds the data that defines a layer.
18  */
19 class RS_LayerData
20 {
21         public:
22                 RS_LayerData() {}
23
24                 RS_LayerData(const QString & name, const RS_Pen & pen, bool frozen, bool locked)
25                 {
26                         this->name = name;
27                         this->pen = pen;
28                         this->frozen = frozen;
29                         this->locked = locked;
30                 }
31
32                 //! Layer name
33                 QString name;
34
35                 //! default pen for this layer
36                 RS_Pen pen;
37
38                 //! Frozen flag
39                 bool frozen;
40
41                 //! Locked flag
42                 bool locked;
43
44                 //! Converted flag (cam)
45                 bool converted;
46 };
47
48 /**
49  * Class for representing a layer
50  *
51  * @author Andrew Mustun
52  */
53 class RS_Layer
54 {
55         public:
56                 explicit RS_Layer(const QString & name);
57                 //RS_Layer(const char* name);
58
59                 RS_Layer * clone();
60                 void setName(const QString & name);
61                 QString getName() const;
62                 void setPen(const RS_Pen & pen);
63                 RS_Pen getPen() const;
64                 bool isFrozen() const;
65                 bool isConverted() const;
66                 void setConverted(bool c);
67                 void toggle();
68                 void freeze(bool freeze);
69                 void toggleLock();
70                 void lock(bool l);
71                 bool isLocked();
72                 //RS_Layer & operator=(const RS_Layer & l);
73
74                 friend std::ostream & operator<<(std::ostream & os, const RS_Layer & l);
75
76                 //friend class RS_LayerList;
77
78         private:
79                 //! Layer data
80                 RS_LayerData data;
81 };
82
83 #endif