Scribus
Open source desktop publishing at your fingertips
api_item.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_ITEM_H_
8 #define API_ITEM_H_
9 
10 #include <QObject>
11 #include <QtDebug>
12 #include <QApplication>
13 
14 #include "scripterimpl.h"
15 
16 class ItemAPI : public QObject
17 {
18  Q_OBJECT
19  Q_PROPERTY(QString name READ name WRITE setName)
20  Q_PROPERTY(QString fillColor READ fillColor WRITE setFillColor)
21  Q_PROPERTY(QString lineColor READ lineColor WRITE setLineColor)
22  Q_PROPERTY(double fillShade READ fillShade WRITE setFillShade)
23  Q_PROPERTY(double lineShade READ lineShade WRITE setLineShade)
24  Q_PROPERTY(double fillTransparency READ fillTransparency WRITE setFillTransparency)
25  Q_PROPERTY(double lineTransparency READ lineTransparency WRITE setLineTransparency)
26  Q_PROPERTY(bool locked READ locked WRITE setLocked)
27  Q_PROPERTY(bool sizeLocked READ sizeLocked WRITE setSizeLocked)
28  Q_PROPERTY(bool flipVertical READ imageFlippedV WRITE setImageFlippedV)
29  Q_PROPERTY(bool flipHorizontal READ imageFlippedH WRITE setImageFlippedH)
30  Q_PROPERTY(double lineWidth READ lineWidth WRITE setLineWidth)
31  Q_PROPERTY(QString customLineStyle READ customLineStyle WRITE setCustomLineStyle)
32  Q_PROPERTY(int startArrowIndex READ startArrowIndex WRITE setStartArrowIndex)
33  Q_PROPERTY(int endArrowIndex READ endArrowIndex WRITE setEndArrowIndex)
34 
35  Q_PROPERTY(bool printEnabled READ printEnabled WRITE setPrintEnabled)
36  Q_PROPERTY(double xPos READ xPos WRITE setXPos)
37  Q_PROPERTY(double yPos READ yPos WRITE setYPos)
38  Q_PROPERTY(double width READ width WRITE setWidth)
39  Q_PROPERTY(double height READ height WRITE setHeight)
40  Q_PROPERTY(double rotation READ rotation WRITE setRotation)
41  Q_PROPERTY(bool reversed READ reversed WRITE setReversed)
42  Q_PROPERTY(double cornerRadius READ cornerRadius WRITE setCornerRadius)
43  Q_PROPERTY(double columnGap READ columnGap WRITE setColumnGap)
44  Q_PROPERTY(int columns READ columns WRITE setColumns)
45 
46 public:
47  ItemAPI(PageItem *it);
48  virtual ~ItemAPI();
49 
50 public slots:
51  void move(double dx, double dy);
52  void moveAbs(double x, double y);
53  void rotate(double rot);
54  void rotateAbs(double rot);
55  void resize(double width, double height);
56 
57 private:
58  PageItem *item;
59 
63  QString name();
64  void setName(QString name);
65 
66  QString fillColor();
67  void setFillColor(QString color);
68 
69  QString lineColor();
70  void setLineColor(QString color);
71 
72  double fillShade();
73  void setFillShade(double value);
74 
75  double lineShade();
76  void setLineShade(double value);
77 
78  double fillTransparency();
79  void setFillTransparency(double value);
80 
81  double lineTransparency();
82  void setLineTransparency(double value);
83 
84  bool locked();
85  void setLocked(bool value);
86 
87  bool sizeLocked();
88  void setSizeLocked(bool value);
89 
90  bool imageFlippedV();
91  void setImageFlippedV(bool value);
92 
93  bool imageFlippedH();
94  void setImageFlippedH(bool value);
95 
96  double lineWidth();
97  void setLineWidth(double value);
98 
99  QString customLineStyle();
100  void setCustomLineStyle(QString name);
101 
102  int startArrowIndex();
103  void setStartArrowIndex(int value);
104 
105  int endArrowIndex();
106  void setEndArrowIndex(int value);
107 
108  bool printEnabled();
109  void setPrintEnabled(bool value);
110 
111  double xPos();
112  void setXPos(double value);
113 
114  double yPos();
115  void setYPos(double value);
116 
117  double width();
118  void setWidth(double value);
119 
120  double height();
121  void setHeight(double value);
122 
123  double rotation();
124  void setRotation(double rotation);
125 
126  bool reversed();
127  void setReversed(bool value);
128 
129  double cornerRadius();
130  void setCornerRadius(double value);
131 
132  double columnGap();
133  void setColumnGap(double value);
134 
135  int columns();
136  void setColumns(int value);
137 };
138 
139 #endif /*API_ITEM_H_*/
Definition: pageitem.h:92
void move(double dx, double dy)
Definition: api_item.cpp:290
Definition: api_item.h:16