Scribus
Open source desktop publishing at your fingertips
api_layer.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 API_LAYER_H_
8 #define API_LAYER_H_
9 
10 #include <QObject>
11 #include <QtDebug>
12 #include <QApplication>
13 
14 #include "scripterimpl.h"
15 #include "sclayer.h"
16 
17 /*
18  * ScLayerWrapper is a wrapper class for ScLayer, which has
19  * all properties of ScLayer defined via Q_PROPERTY
20  */
21 
22 class LayerAPI : public QObject
23 {
24  Q_OBJECT
25 
26  Q_PROPERTY(QString name READ getName WRITE setName)
27  Q_PROPERTY(int id READ getID)
28  Q_PROPERTY(int level READ getLevel WRITE setLevel)
29  Q_PROPERTY(bool printable READ isPrintable WRITE setPrintable)
30  Q_PROPERTY(bool viewable READ isViewable WRITE setViewable)
31  Q_PROPERTY(bool editable READ isEditable WRITE setEditable)
32  Q_PROPERTY(bool flowControl READ getFlowControl WRITE setFlowControl)
33  Q_PROPERTY(bool outlineMode READ getOutlineMode WRITE setOutlineMode)
34  Q_PROPERTY(double transparency READ getTransparency WRITE setTransparency)
35  Q_PROPERTY(int blendMode READ getBlendMode WRITE setBlendMode)
36  Q_PROPERTY(bool active READ isActive WRITE setActive)
37  Q_PROPERTY(QList<QVariant> items READ items)
38 
39 private:
40  ScLayer *innerLayer;
41 
42 public:
43  LayerAPI(ScLayer *l);
44  virtual ~LayerAPI();
45 
46  QList<QVariant> items();
47 
48 
49 public slots:
50  QString getName();
51  void setName(QString name);
52 
53  int getID();
54 
55  int getLevel();
56  void setLevel(int level);
57 
58  bool isPrintable();
59  void setPrintable(bool value);
60 
61  bool isViewable();
62  void setViewable(bool value);
63 
64  bool isEditable();
65  void setEditable(bool value);
66 
67  bool getFlowControl();
68  void setFlowControl(bool value);
69 
70  bool getOutlineMode();
71  void setOutlineMode(bool value);
72 
73  double getTransparency();
74  void setTransparency(double value);
75 
76  int getBlendMode();
77  void setBlendMode(int value);
78 
79  bool isActive();
80  void setActive(bool value);
81 
82 };
83 
84 #endif /*API_LAYER_H_*/
Definition: api_layer.h:22
Definition: sclayer.h:17