Scribus
Open source desktop publishing at your fingertips
sclayer.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef SCLAYER_H
8 #define SCLAYER_H
9 
10 #include <QColor>
11 #include <QString>
12 #include <QList>
13 #include <QSet> //necessary to avoid msvc warnings induced by SCRIBUS_API on ScLayers + early instanciation of templates
14 
15 #include "scribusapi.h"
16 
17 class SCRIBUS_API ScLayer
18 {
19 public:
20  ScLayer(void);
21  ScLayer(const QString& name, int level, int id);
22  QString Name;
23  int ID;
24  int Level;
25  bool isPrintable;
26  bool isViewable;
27  bool isEditable;
28  bool isSelectable;
29  bool flowControl;
30  bool outlineMode;
31  double transparency;
32  int blendMode;
33  QColor markerColor;
34  bool operator< (const ScLayer& other) const;
35  bool operator== (const ScLayer& other) const;
36 };
37 
38 class SCRIBUS_API ScLayers : public QList<ScLayer>
39 {
40 public:
41 
46  int getMaxID(void);
47 
52  const ScLayer* bottomLayer (void) const;
53 
58  const ScLayer* topLayer (void) const;
59 
66  void levelToLayer (ScLayer& layer, int level) const;
67 
72  ScLayer* bottom(void);
73 
78  ScLayer* top(void);
79 
85  ScLayer* byLevel(const int level);
86 
92  ScLayer* byID(const int nr);
93 
99  ScLayer* above (int nr);
100 
106  ScLayer* below (int nr);
107 
113  const ScLayer* layerByLevel (int level) const;
114 
120  const ScLayer* layerByID (int nr) const;
121 
127  const ScLayer* layerByName (const QString& name) const;
128 
134  const ScLayer* layerAbove (int level) const;
135 
141  const ScLayer* layerAbove (const ScLayer& layer) const;
142 
148  const ScLayer* layerBelow (int level) const;
149 
155  const ScLayer* layerBelow (const ScLayer& layer) const;
156 
162  int addLayer(const QString& layerName);
163 
169  int addLayer(const ScLayer& layer);
170 
176  ScLayer* newLayer(const QString& layerName);
177 
182  bool removeLayerByID(int id);
183 
188  bool removeLayerByLevel(int level);
189 
194  bool raiseLayer(int nr);
195 
200  bool lowerLayer(int nr);
201 
205  void sort(void);
206 
212  bool layerPrintable(const int layerID) const;
213 
220  bool setLayerPrintable(const int layerID, const bool isPrintable);
221 
227  bool layerVisible(const int layerID) const;
228 
235  bool setLayerVisible(const int layerID, const bool isViewable);
236 
242  bool layerLocked(const int layerID) const;
243 
250  bool setLayerLocked(const int layerID, const bool isViewable);
251 
257  bool layerFlow(const int layerID) const;
258 
265  bool setLayerFlow(const int layerID, const bool flow);
266 
272  bool layerOutline(const int layerID) const;
273 
280  bool setLayerOutline(const int layerID, const bool outline);
281 
287  double layerTransparency(const int layerID) const;
288 
295  bool setLayerTransparency(const int layerID, double trans);
296 
302  int layerBlendMode(const int layerID) const;
303 
310  bool setLayerBlendMode(const int layerID, int blend);
311 
317  QColor layerMarker(const int layerID) const;
318 
325  bool setLayerMarker(const int layerID, QColor color);
326 
332  bool layerSelectable(const int layerID) const;
333 
340  bool setLayerSelectable(const int layerID, const bool isSelectable);
341 };
342 
343 uint qHash(const ScLayer& layer);
344 
345 #endif
Definition: sclayer.h:38
Definition: sclayer.h:17