Scribus
Open source desktop publishing at your fingertips
cmdobj.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 CMDOBJ_H
8 #define CMDOBJ_H
9 
10 // Pulls in <Python.h> first
11 #include "cmdvar.h"
12 
16 PyDoc_STRVAR(scribus_newrect__doc__,
17 QT_TR_NOOP("createRect(x, y, width, height, [\"name\"]) -> string\n\
18 \n\
19 Creates a new rectangle on the current page and returns its name. The\n\
20 coordinates are given in the current measurement units of the document\n\
21 (see UNIT constants). \"name\" should be a unique identifier for the object\n\
22 because you need this name to reference that object in future. If \"name\"\n\
23 is not given Scribus will create one for you.\n\
24 \n\
25 May raise NameExistsError if you explicitly pass a name that's already used.\n\
26 "));
30 PyObject *scribus_newrect(PyObject * /*self*/, PyObject* args);
31 
33 PyDoc_STRVAR(scribus_newellipse__doc__,
34 QT_TR_NOOP("createEllipse(x, y, width, height, [\"name\"]) -> string\n\
35 \n\
36 Creates a new ellipse on the current page and returns its name.\n\
37 The coordinates are given in the current measurement units of the document\n\
38 (see UNIT constants). \"name\" should be a unique identifier for the object\n\
39 because you need this name for further referencing of that object. If \"name\"\n\
40 is not given Scribus will create one for you.\n\
41 \n\
42 May raise NameExistsError if you explicitly pass a name that's already used.\n\
43 "));
47 PyObject *scribus_newellipse(PyObject * /*self*/, PyObject* args);
48 
50 PyDoc_STRVAR(scribus_newimage__doc__,
51 QT_TR_NOOP("createImage(x, y, width, height, [\"name\"]) -> string\n\
52 \n\
53 Creates a new picture frame on the current page and returns its name. The\n\
54 coordinates are given in the current measurement units of the document.\n\
55 \"name\" should be a unique identifier for the object because you need this\n\
56 name for further access to that object. If \"name\" is not given Scribus will\n\
57 create one for you.\n\
58 \n\
59 May raise NameExistsError if you explicitly pass a name that's already used.\n\
60 "));
62 PyObject *scribus_newimage(PyObject * /*self*/, PyObject* args);
63 
65 PyDoc_STRVAR(scribus_newtext__doc__,
66 QT_TR_NOOP("createText(x, y, width, height, [\"name\"]) -> string\n\
67 \n\
68 Creates a new text frame on the actual page and returns its name.\n\
69 The coordinates are given in the actual measurement unit of the document (see\n\
70 UNIT constants). \"name\" should be a unique identifier for the object because\n\
71 you need this name for further referencing of that object. If \"name\" is not\n\
72 given Scribus will create one for you.\n\
73 \n\
74 May raise NameExistsError if you explicitly pass a name that's already used.\n\
75 "));
77 PyObject *scribus_newtext(PyObject * /*self*/, PyObject* args);
78 
80 PyDoc_STRVAR(scribus_newtable__doc__,
81 QT_TR_NOOP("createTable(x, y, width, height, numRows, numColumns, [\"name\"]) -> string\n\
82 \n\
83 Creates a new table with the given number of rows and columns on the actual page\n\
84 and returns its name. The coordinates are given in the actual measurement unit of\n\
85 the document (see UNIT constants). \"name\" should be a unique identifier for\n\
86 the object because you need this name for further referencing of that object. If\n\
87 \"name\" is not given Scribus will create one for you.\n\
88 \n\
89 May raise NameExistsError if you explicitly pass a name that's already used.\n\
90 May raise ValueError if an insufficient number of rows or columns is passed.\n\
91 "));
93 PyObject *scribus_newtable(PyObject * /*self*/, PyObject* args);
94 
96 PyDoc_STRVAR(scribus_newline__doc__,
97 QT_TR_NOOP("createLine(x1, y1, x2, y2, [\"name\"]) -> string\n\
98 \n\
99 Creates a new line from the point(x1, y1) to the point(x2, y2) and returns\n\
100 its name. The coordinates are given in the current measurement unit of the\n\
101 document (see UNIT constants). \"name\" should be a unique identifier for the\n\
102 object because you need this name for further access to that object. If\n\
103 \"name\" is not given Scribus will create one for you.\n\
104 \n\
105 May raise NameExistsError if you explicitly pass a name that's already used.\n\
106 "));
108 PyObject *scribus_newline(PyObject * /*self*/, PyObject* args);
109 
111 PyDoc_STRVAR(scribus_polyline__doc__,
112 QT_TR_NOOP("createPolyLine(list, [\"name\"]) -> string\n\
113 \n\
114 Creates a new polyline and returns its name. The points for the polyline are\n\
115 stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\
116 The coordinates are given in the current measurement units of the document (see\n\
117 UNIT constants). \"name\" should be a unique identifier for the object because\n\
118 you need this name for further access to that object. If \"name\" is not given\n\
119 Scribus will create one for you.\n\
120 \n\
121 May raise NameExistsError if you explicitly pass a name that's already used.\n\
122 May raise ValueError if an insufficient number of points is passed or if\n\
123 the number of values passed don't group into points without leftovers.\n\
124 "));
126 PyObject *scribus_polyline(PyObject * /*self*/, PyObject* args);
127 
129 PyDoc_STRVAR(scribus_polygon__doc__,
130 QT_TR_NOOP("createPolygon(list, [\"name\"]) -> string\n\
131 \n\
132 Creates a new polygon and returns its name. The points for the polygon are\n\
133 stored in the list \"list\" in the following order: [x1, y1, x2, y2...xn. yn].\n\
134 At least three points are required. There is no need to repeat the first point\n\
135 to close the polygon. The polygon is automatically closed by connecting the\n\
136 first and the last point. The coordinates are given in the current measurement\n\
137 units of the document (see UNIT constants). \"name\" should be a unique\n\
138 identifier for the object because you need this name for further access to that\n\
139 object. If \"name\" is not given Scribus will create one for you.\n\
140 \n\
141 May raise NameExistsError if you explicitly pass a name that's already used.\n\
142 May raise ValueError if an insufficient number of points is passed or if\n\
143 the number of values passed don't group into points without leftovers.\n\
144 "));
146 PyObject *scribus_polygon(PyObject * /*self*/, PyObject* args);
147 
149 PyDoc_STRVAR(scribus_bezierline__doc__,
150 QT_TR_NOOP("createBezierLine(list, [\"name\"]) -> string\n\
151 \n\
152 Creates a new bezier curve and returns its name. The points for the bezier\n\
153 curve are stored in the list \"list\" in the following order:\n\
154 [x1, y1, kx1, ky1, x2, y2, kx2, ky2...xn. yn, kxn. kyn]\n\
155 In the points list, x and y mean the x and y coordinates of the point and kx\n\
156 and ky meaning the control point for the curve. The coordinates are given in\n\
157 the current measurement units of the document (see UNIT constants). \"name\"\n\
158 should be a unique identifier for the object because you need this name for\n\
159 further access to that object. If \"name\" is not given Scribus will create one\n\
160 for you.\n\
161 \n\
162 May raise NameExistsError if you explicitly pass a name that's already used.\n\
163 May raise ValueError if an insufficient number of points is passed or if\n\
164 the number of values passed don't group into points without leftovers.\n\
165 "));
167 PyObject *scribus_bezierline(PyObject * /*self*/, PyObject* args);
168 
170 PyDoc_STRVAR(scribus_pathtext__doc__,
171 QT_TR_NOOP("createPathText(x, y, \"textbox\", \"beziercurve\", [\"name\"]) -> string\n\
172 \n\
173 Creates a new pathText by merging the two objects \"textbox\" and\n\
174 \"beziercurve\" and returns its name. The coordinates are given in the current\n\
175 measurement unit of the document (see UNIT constants). \"name\" should be a\n\
176 unique identifier for the object because you need this name for further access\n\
177 to that object. If \"name\" is not given Scribus will create one for you.\n\
178 \n\
179 May raise NameExistsError if you explicitly pass a name that's already used.\n\
180 May raise NotFoundError if one or both of the named base object don't exist.\n\
181 "));
185 PyObject *scribus_pathtext(PyObject * /*self*/, PyObject* args);
186 
188 PyDoc_STRVAR(scribus_deleteobj__doc__,
189 QT_TR_NOOP("deleteObject([\"name\"])\n\
190 \n\
191 Deletes the item with the name \"name\". If \"name\" is not given the currently\n\
192 selected item is deleted.\n\
193 "));
196 PyObject *scribus_deleteobj(PyObject * /*self*/, PyObject* args);
197 
199 PyDoc_STRVAR(scribus_textflow__doc__,
200 QT_TR_NOOP("textFlowMode(\"name\" [, state])\n\
201 \n\
202 Enables/disables \"Text Flows Around Frame\" feature for object \"name\".\n\
203 Called with parameters string name and optional int \"state\" (0 <= state <= 3).\n\
204 Setting \"state\" to 0 will disable text flow.\n\
205 Setting \"state\" to 1 will make text flow around object frame.\n\
206 Setting \"state\" to 2 will make text flow around bounding box.\n\
207 Setting \"state\" to 3 will make text flow around contour line.\n\
208 If \"state\" is not passed, text flow is toggled.\n\
209 "));
218 PyObject *scribus_textflow(PyObject * /*self*/, PyObject* args);
219 
221 PyDoc_STRVAR(scribus_objectexists__doc__,
222 QT_TR_NOOP("objectExists([\"name\"]) -> bool\n\
223 \n\
224 Test if an object with specified name really exists in the document.\n\
225 The optional parameter is the object name. When no object name is given,\n\
226 returns True if there is something selected.\n\
227 "));
235 PyObject *scribus_objectexists(PyObject * /*self*/, PyObject* args);
236 
238 PyDoc_STRVAR(scribus_setstyle__doc__,
239 QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\
240 \n\
241 Apply the named \"style\" to the object named \"name\". If object name is\n\
242 given, style is applied to the current text selection in object \"name\".\n\
243 If no object name is given, style is applied on selected object.\n\
244 "));
250 PyObject *scribus_setstyle(PyObject * /*self*/, PyObject* args);
251 
253 PyDoc_STRVAR(scribus_getstylenames__doc__,
254 QT_TR_NOOP("getAllStyles() -> list\n\
255 \n\
256 Return a list of the names of all paragraph styles in the current document.\n\
257 "));
262 PyObject *scribus_getstylenames(PyObject * /*self*/);
263 
265 PyDoc_STRVAR(scribus_getcharstylenames__doc__,
266 QT_TR_NOOP("getCharStyles() -> list\n\
267 \n\
268 Return a list of the names of all character styles in the current document.\n\
269 "));
270 PyObject *scribus_getcharstylenames(PyObject * /*self*/);
271 
272 
274 PyDoc_STRVAR(scribus_duplicateobject__doc__,
275 QT_TR_NOOP("duplicateObject([\"name\"]) -> string\n\
276 \n\
277 creates a Duplicate of the selected Object (or Selection Group).\n\
278 "));
283 PyObject *scribus_duplicateobject(PyObject * /* self */, PyObject *args);
284 
286 PyDoc_STRVAR(scribus_copyobject__doc__,
287 QT_TR_NOOP("copyObject([\"name\"]) -> string\n\
288 \n\
289 copies the selected Object (or Selection Group).\n\
290 "));
295 PyObject *scribus_copyobject(PyObject * /* self */, PyObject *args);
296 
298 PyDoc_STRVAR(scribus_pasteobject__doc__,
299 QT_TR_NOOP("pasteObject([\"name\"]) -> string\n\
300 \n\
301 pastes a Duplicate of the selected Object (or Selection Group).\n\
302 "));
307 PyObject *scribus_pasteobject(PyObject * /* self */, PyObject *args);
308 
309 /* Internal function not intended for general use; no docstring */
310 PyObject* scribus_getframetype(PyObject* self, PyObject* args, PyObject* kw);
311 
312 #endif
313