]> Shamusworld >> Repos - architektonas/blob - src/base/layer.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / layer.h
1 #ifndef __LAYER_H__
2 #define __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 "flags.h"
14 #include "pen.h"
15
16 /**
17  * Holds the data that defines a layer.
18  */
19 class LayerData
20 {
21         public:
22                 LayerData() {}
23
24                 LayerData(const QString & name, const 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                 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 Layer
54 {
55         public:
56                 explicit Layer(const QString & name);
57                 //Layer(const char* name);
58
59                 Layer * clone();
60                 void setName(const QString & name);
61                 QString getName() const;
62                 void setPen(const Pen & pen);
63                 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                 //Layer & operator=(const Layer & l);
73
74                 friend std::ostream & operator<<(std::ostream & os, const Layer & l);
75
76                 //friend class LayerList;
77
78         private:
79                 //! Layer data
80                 LayerData data;
81 };
82
83 #endif