Scribus
Open source desktop publishing at your fingertips
cmddoc.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 CMDDOC_H
8 #define CMDDOC_H
9 
10 // Pulls in <Python.h> first
11 #include "cmdvar.h"
12 
15 PyDoc_STRVAR(scribus_newdocument__doc__,
16 QT_TR_NOOP("newDocument(size, margins, orientation, firstPageNumber,\n\
17  unit, pagesType, firstPageOrder, numPages) -> bool\n\
18 \n\
19 Creates a new document and returns true if successful. The parameters have the\n\
20 following meaning:\n\
21 \n\
22 size = A tuple (width, height) describing the size of the document. You can\n\
23 use predefined constants named PAPER_<paper_type> e.g. PAPER_A4 etc.\n\
24 \n\
25 margins = A tuple (left, right, top, bottom) describing the document\n\
26 margins\n\
27 \n\
28 orientation = the page orientation - constants PORTRAIT, LANDSCAPE\n\
29 \n\
30 firstPageNumer = is the number of the first page in the document used for\n\
31 pagenumbering. While you'll usually want 1, it's useful to have higher\n\
32 numbers if you're creating a document in several parts.\n\
33 \n\
34 unit: this value sets the measurement units used by the document. Use a\n\
35 predefined constant for this, one of: UNIT_INCHES, UNIT_MILLIMETERS,\n\
36 UNIT_PICAS, UNIT_POINTS.\n\
37 \n\
38 pagesType = One of the predefined constants PAGE_n. PAGE_1 is single page,\n\
39 PAGE_2 is for double sided documents, PAGE_3 is for 3 pages fold and\n\
40 PAGE_4 is 4-fold.\n\
41 \n\
42 firstPageOrder = What is position of first page in the document.\n\
43 Indexed from 0 (0 = first).\n\
44 \n\
45 numPage = Number of pages to be created.\n\
46 \n\
47 The values for width, height and the margins are expressed in the given unit\n\
48 for the document. PAPER_* constants are expressed in points. If your document\n\
49 is not in points, make sure to account for this.\n\
50 \n\
51 example: newDocument(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 7, UNIT_POINTS,\n\
52 PAGE_4, 3, 1)\n\
53 \n\
54 May raise ScribusError if is firstPageOrder bigger than allowed by pagesType.\n\
55 "));
58 PyObject *scribus_newdocument(PyObject * /*self*/, PyObject* args);
59 
61 PyDoc_STRVAR(scribus_newdoc__doc__,
62 QT_TR_NOOP("newDoc(size, margins, orientation, firstPageNumber,\n\
63  unit, facingPages, firstSideLeft) -> bool\n\
64 \n\
65 WARNING: Obsolete procedure! Use newDocument instead.\n\
66 \n\
67 Creates a new document and returns true if successful. The parameters have the\n\
68 following meaning:\n\
69 \n\
70  size = A tuple (width, height) describing the size of the document. You can\n\
71  use predefined constants named PAPER_<paper_type> e.g. PAPER_A4 etc.\n\
72 \n\
73  margins = A tuple (left, right, top, bottom) describing the document\n\
74  margins\n\
75 \n\
76  orientation = the page orientation - constants PORTRAIT, LANDSCAPE\n\
77 \n\
78  firstPageNumer = is the number of the first page in the document used for\n\
79  pagenumbering. While you'll usually want 1, it's useful to have higher\n\
80  numbers if you're creating a document in several parts.\n\
81 \n\
82  unit: this value sets the measurement units used by the document. Use a\n\
83  predefined constant for this, one of: UNIT_INCHES, UNIT_MILLIMETERS,\n\
84  UNIT_PICAS, UNIT_POINTS.\n\
85 \n\
86  facingPages = FACINGPAGES, NOFACINGPAGES\n\
87 \n\
88  firstSideLeft = FIRSTPAGELEFT, FIRSTPAGERIGHT\n\
89 \n\
90 The values for width, height and the margins are expressed in the given unit\n\
91 for the document. PAPER_* constants are expressed in points. If your document\n\
92 is not in points, make sure to account for this.\n\
93 \n\
94 example: newDoc(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 1, UNIT_POINTS,\n\
95  FACINGPAGES, FIRSTPAGERIGHT)\n\
96 "));
99 PyObject *scribus_newdoc(PyObject * /*self*/, PyObject* args);
100 
102 PyDoc_STRVAR(scribus_closedoc__doc__,
103 QT_TR_NOOP("closeDoc()\n\
104 \n\
105 Closes the current document without prompting to save.\n\
106 \n\
107 May throw NoDocOpenError if there is no document to close\n\
108 "));
110 PyObject *scribus_closedoc(PyObject * /*self*/);
111 
113 PyDoc_STRVAR(scribus_havedoc__doc__,
114 QT_TR_NOOP("haveDoc() -> int\n\
115 \n\
116 Returns the quantity of open documents: 0 if none are opened.\n\
117 "));
119 PyObject *scribus_havedoc(PyObject * /*self*/);
120 
122 PyDoc_STRVAR(scribus_opendoc__doc__,
123 QT_TR_NOOP("openDoc(\"name\")\n\
124 \n\
125 Opens the document \"name\".\n\
126 \n\
127 May raise ScribusError if the document could not be opened.\n\
128 "));
130 PyObject *scribus_opendoc(PyObject * /*self*/, PyObject* args);
131 
133 PyDoc_STRVAR(scribus_savedoc__doc__,
134 QT_TR_NOOP("saveDoc()\n\
135 \n\
136 Saves the current document with its current name, returns true if successful.\n\
137 If the document has not already been saved, this may bring up an interactive\n\
138 save file dialog.\n\
139 \n\
140 If the save fails, there is currently no way to tell.\n\
141 "));
142 PyObject *scribus_savedoc(PyObject * /*self*/);
143 
145 PyDoc_STRVAR(scribus_getdocname__doc__,
146 QT_TR_NOOP("getDocName() -> string\n\
147 \n\
148 Returns the name the document was saved under.\n\
149 If the document was not saved before the name is empty.\n\
150 "));
152 PyObject *scribus_getdocname(PyObject * /*self*/);
153 
155 PyDoc_STRVAR(scribus_savedocas__doc__,
156 QT_TR_NOOP("saveDocAs(\"name\")\n\
157 \n\
158 Saves the current document under the new name \"name\" (which may be a full or\n\
159 relative path).\n\
160 \n\
161 May raise ScribusError if the save fails.\n\
162 "));
164 PyObject *scribus_savedocas(PyObject * /*self*/, PyObject* args);
165 
167 PyDoc_STRVAR(scribus_setinfo__doc__,
168 QT_TR_NOOP("setInfo(\"author\", \"info\", \"description\") -> bool\n\
169 \n\
170 Sets the document information. \"Author\", \"Info\", \"Description\" are\n\
171 strings.\n\
172 "));
174 PyObject *scribus_setinfo(PyObject * /*self*/, PyObject* args);
175 
177 PyDoc_STRVAR(scribus_setmargins__doc__,
178 QT_TR_NOOP("setMargins(lr, rr, tr, br)\n\
179 \n\
180 Sets the margins of the document, Left(lr), Right(rr), Top(tr) and Bottom(br)\n\
181 margins are given in the measurement units of the document - see UNIT_<type>\n\
182 constants.\n\
183 "));
185 PyObject *scribus_setmargins(PyObject * /*self*/, PyObject* args);
186 
188 PyDoc_STRVAR(scribus_setbaseline__doc__,
189 QT_TR_NOOP("setBaseLine(grid, offset)\n\
190 \n\
191 Sets the base line settings of the document, grid spacing(grid), grid offset(offset).\n\
192 Values are given in the measurement units of the document - see UNIT_<type>\n\
193 constants.\n\
194 "));
196 PyObject *scribus_setbaseline(PyObject * /*self*/, PyObject* args);
197 
199 PyDoc_STRVAR(scribus_setunit__doc__,
200 QT_TR_NOOP("setUnit(type)\n\
201 \n\
202 Changes the measurement unit of the document. Possible values for \"unit\" are\n\
203 defined as constants UNIT_<type>.\n\
204 \n\
205 May raise ValueError if an invalid unit is passed.\n\
206 "));
208 PyObject *scribus_setunit(PyObject * /*self*/, PyObject* args);
209 
211 PyDoc_STRVAR(scribus_getunit__doc__,
212 QT_TR_NOOP("getUnit() -> integer (Scribus unit constant)\n\
213 \n\
214 Returns the measurement units of the document. The returned value will be one\n\
215 of the UNIT_* constants:\n\
216 UNIT_INCHES, UNIT_MILLIMETERS, UNIT_PICAS, UNIT_POINTS.\n\
217 "));
219 PyObject *scribus_getunit(PyObject * /*self*/);
220 
222 PyDoc_STRVAR(scribus_loadstylesfromfile__doc__,
223 QT_TR_NOOP("loadStylesFromFile(\"filename\")\n\
224 \n\
225 Loads paragraph styles from the Scribus document at \"filename\" into the\n\
226 current document.\n\
227 "));
229 PyObject *scribus_loadstylesfromfile(PyObject * /*self*/, PyObject *args);
230 
232 PyDoc_STRVAR(scribus_setdoctype__doc__,
233 QT_TR_NOOP("setDocType(facingPages, firstPageLeft)\n\
234 \n\
235 Sets the document type. To get facing pages set the first parameter to\n\
236 FACINGPAGES, to switch facingPages off use NOFACINGPAGES instead. If you want\n\
237 to be the first page a left side set the second parameter to FIRSTPAGELEFT, for\n\
238 a right page use FIRSTPAGERIGHT.\n\
239 "));
240 PyObject *scribus_setdoctype(PyObject * /*self*/, PyObject* args);
241 
242 PyDoc_STRVAR(scribus_closemasterpage__doc__,
243 QT_TR_NOOP("closeMasterPage()\n\
244 \n\
245 Closes the currently active master page, if any, and returns editing\n\
246 to normal. Begin editing with editMasterPage().\n\
247 "));
248 PyObject* scribus_closemasterpage(PyObject* self);
249 
250 PyDoc_STRVAR(scribus_masterpagenames__doc__,
251 QT_TR_NOOP("masterPageNames()\n\
252 \n\
253 Returns a list of the names of all master pages in the document.\n\
254 "));
255 PyObject* scribus_masterpagenames(PyObject* self);
256 
257 PyDoc_STRVAR(scribus_editmasterpage__doc__,
258 QT_TR_NOOP("editMasterPage(pageName)\n\
259 \n\
260 Enables master page editing and opens the named master page\n\
261 for editing. Finish editing with closeMasterPage().\n\
262 "));
263 PyObject* scribus_editmasterpage(PyObject* self, PyObject* args);
264 
265 PyDoc_STRVAR(scribus_createmasterpage__doc__,
266 QT_TR_NOOP("createMasterPage(pageName)\n\
267 \n\
268 Creates a new master page named pageName and opens it for\n\
269 editing.\n\
270 "));
271 PyObject* scribus_createmasterpage(PyObject* self, PyObject* args);
272 
273 PyDoc_STRVAR(scribus_deletemasterpage__doc__,
274 QT_TR_NOOP("deleteMasterPage(pageName)\n\
275 \n\
276 Delete the named master page.\n\
277 "));
278 PyObject* scribus_deletemasterpage(PyObject* self, PyObject* args);
279 
280 PyDoc_STRVAR(scribus_applymasterpage__doc__,
281 QT_TR_NOOP("applyMasterPage(masterPageName, pageNumber)\n\
282 \n\
283 Apply master page masterPageName on page pageNumber.\n\
284 "));
285 PyObject* scribus_applymasterpage(PyObject* self, PyObject* args);
286 
287 #endif
288 
289