]> Shamusworld >> Repos - architektonas/blob - src/base/layerlist.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / layerlist.h
1 #ifndef __LAYERLIST_H__
2 #define __LAYERLIST_H__
3
4 #include <iostream>
5 #include <QtCore>
6
7 class Layer;
8 //class LayerListListener;
9
10 /**
11  * A list of layers.
12  *
13  * @author Andrew Mustun
14  */
15 class LayerList
16 {
17         public:
18                 LayerList();
19                 virtual ~LayerList();
20
21                 void clear();
22                 uint count() const;
23                 Layer * at(uint i);
24                 void activate(const QString & name, bool notify = false);
25                 void activate(Layer * layer, bool notify = false);
26                 Layer * getActive();
27                 virtual void add(Layer * layer);
28                 virtual void remove(Layer * layer);
29                 virtual void edit(Layer * layer, const Layer & source);
30                 Layer * find(const QString & name);
31                 int getIndex(const QString & name);
32                 int getIndex(Layer * layer);
33                 void toggle(const QString & name);
34                 void toggle(Layer * layer);
35                 void toggleLock(Layer * layer);
36                 void freezeAll(bool freeze);
37 //              void addListener(LayerListListener * listener);
38 //              void removeListener(LayerListListener * listener);
39                 void setModified(bool m);
40                 virtual bool isModified() const;
41
42                 friend std::ostream & operator<<(std::ostream & os, LayerList & l);
43
44         private:
45                 //! layers in the graphic
46                 QList<Layer *> layers;
47                 //! List of registered LayerListListeners
48 //              QList<LayerListListener *> layerListListeners;
49                 //! Currently active layer
50                 Layer * activeLayer;
51                 /** Flag set if the layer list was modified and not yet saved. */
52                 bool modified;
53 };
54
55 #endif