Scribus
Open source desktop publishing at your fingertips
cmdpage.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 CMDPAGE_H
8 #define CMDPAGE_H
9 
10 // Pulls in <Python.h> first
11 #include "cmdvar.h"
12 
16 PyDoc_STRVAR(scribus_newpage__doc__,
17 QT_TR_NOOP("newPage(where [,\"masterpage\"])\n\
18 \n\
19 Creates a new page. If \"where\" is -1 the new Page is appended to the\n\
20 document, otherwise the new page is inserted before \"where\". Page numbers are\n\
21 counted from 1 upwards, no matter what the displayed first page number of your\n\
22 document is. The optional parameter \"masterpage\" specifies the name of the\n\
23 master page for the new page.\n\
24 \n\
25 May raise IndexError if the page number is out of range\n\
26 "));
28 PyObject *scribus_newpage(PyObject * /*self*/, PyObject* args);
29 
31 PyDoc_STRVAR(scribus_actualpage__doc__,
32 QT_TR_NOOP("currentPage() -> integer\n\
33 \n\
34 Returns the number of the current working page. Page numbers are counted from 1\n\
35 upwards, no matter what the displayed first page number of your document is.\n\
36 "));
38 PyObject *scribus_actualpage(PyObject * /*self*/);
39 
41 PyDoc_STRVAR(scribus_redraw__doc__,
42 QT_TR_NOOP("redrawAll()\n\
43 \n\
44 Redraws all pages.\n\
45 "));
47 PyObject *scribus_redraw(PyObject * /*self*/);
48 
50 PyDoc_STRVAR(scribus_pageposition__doc__,
51 QT_TR_NOOP("getPageType() -> integer\n\
52 \n\
53 Returns the type of the Page, 0 means left Page, 1 is a middle Page and 2 is a right Page\n\
54 "));
56 PyObject *scribus_pageposition(PyObject * /*self*/, PyObject* args);
57 
59 PyDoc_STRVAR(scribus_savepageeps__doc__,
60 QT_TR_NOOP("savePageAsEPS(\"name\")\n\
61 \n\
62 Saves the current page as an EPS to the file \"name\".\n\
63 \n\
64 May raise ScribusError if the save failed.\n\
65 "));
67 PyObject *scribus_savepageeps(PyObject * /*self*/, PyObject* args);
68 
70 PyDoc_STRVAR(scribus_deletepage__doc__,
71 QT_TR_NOOP("deletePage(nr)\n\
72 \n\
73 Deletes the given page. Does nothing if the document contains only one page.\n\
74 Page numbers are counted from 1 upwards, no matter what the displayed first\n\
75 page number is.\n\
76 \n\
77 May raise IndexError if the page number is out of range\n\
78 "));
80 PyObject *scribus_deletepage(PyObject * /*self*/, PyObject* args);
81 
83 PyDoc_STRVAR(scribus_gotopage__doc__,
84 QT_TR_NOOP("gotoPage(nr)\n\
85 \n\
86 Moves to the page \"nr\" (that is, makes the current page \"nr\"). Note that\n\
87 gotoPage doesn't (currently) change the page the user's view is displaying, it\n\
88 just sets the page that script commands will operates on.\n\
89 \n\
90 May raise IndexError if the page number is out of range.\n\
91 "));
93 PyObject *scribus_gotopage(PyObject * /*self*/, PyObject* args);
94 
96 PyDoc_STRVAR(scribus_pagecount__doc__,
97 QT_TR_NOOP("pageCount() -> integer\n\
98 \n\
99 Returns the number of pages in the document.\n\
100 "));
102 PyObject *scribus_pagecount(PyObject * /*self*/);
103 
105 PyDoc_STRVAR(scribus_getHguides__doc__,
106 QT_TR_NOOP("getHGuides() -> list\n\
107 \n\
108 Returns a list containing positions of the horizontal guides. Values are in the\n\
109 document's current units - see UNIT_<type> constants.\n\
110 "));
112 PyObject *scribus_getHguides(PyObject * /*self*/);
113 
115 PyDoc_STRVAR(scribus_setHguides__doc__,
116 QT_TR_NOOP("setHGuides(list)\n\
117 \n\
118 Sets horizontal guides. Input parameter must be a list of guide positions\n\
119 measured in the current document units - see UNIT_<type> constants.\n\
120 \n\
121 Example: setHGuides(getHGuides() + [200.0, 210.0] # add new guides without any lost\n\
122  setHGuides([90,250]) # replace current guides entirely\n\
123 "));
125 PyObject *scribus_setHguides(PyObject * /*self*/, PyObject* args);
126 
128 PyDoc_STRVAR(scribus_getVguides__doc__,
129 QT_TR_NOOP("getVGuides()\n\
130 \n\
131 See getHGuides.\n\
132 "));
134 PyObject *scribus_getVguides(PyObject * /*self*/);
135 
137 PyDoc_STRVAR(scribus_setVguides__doc__,
138 QT_TR_NOOP("setVGuides()\n\
139 \n\
140 See setHGuides.\n\
141 "));
143 PyObject *scribus_setVguides(PyObject * /*self*/, PyObject* args);
144 
146 PyDoc_STRVAR(scribus_pagedimension__doc__,
147 QT_TR_NOOP("getPageSize() -> tuple\n\
148 \n\
149 Returns a tuple with document page dimensions measured in the document's current units.\n\
150 See UNIT_<type> constants and getPageMargins()\n\
151 "));
157 PyObject *scribus_pagedimension(PyObject * /*self*/);
158 
160 PyDoc_STRVAR(scribus_pagensize__doc__,
161 QT_TR_NOOP("getPageNSize(nr) -> tuple\n\
162 \n\
163 Returns a tuple with a particular page's size measured in the document's current units.\n\
164 See UNIT_<type> constants and getPageMargins()\n\
165 "));
170 PyObject *scribus_pagensize(PyObject * /*self*/, PyObject* args);
171 
173 PyDoc_STRVAR(scribus_getpagemargins__doc__,
174 QT_TR_NOOP("getPageMargins()\n\
175 \n\
176 Returns the document page margins as a (top, left, right, bottom) tuple in the document's current\n\
177 units. See UNIT_<type> constants and getPageSize().\n\
178 "));
183 PyObject *scribus_getpagemargins(PyObject * /*self*/);
184 
186 PyDoc_STRVAR(scribus_pagenmargins__doc__,
187 QT_TR_NOOP("getPageNMargins(nr) -> tuple\n\
188 \n\
189 Returns a tuple with a particular page's margins measured in the document's current units.\n\
190 See UNIT_<type> constants and getPageMargins()\n\
191 "));
196 PyObject *scribus_pagenmargins(PyObject * /*self*/, PyObject* args);
197 
199 PyDoc_STRVAR(scribus_getpageitems__doc__,
200 QT_TR_NOOP("getPageItems() -> list\n\
201 \n\
202 Returns a list of tuples with items on the current page. The tuple is:\n\
203 (name, objectType, order) E.g. [('Text1', 4, 0), ('Image1', 2, 1)]\n\
204 means that object named 'Text1' is a text frame (type 4) and is the first at\n\
205 the page...\n\
206 "));
212 PyObject *scribus_getpageitems(PyObject * /*self*/);
213 
215 PyDoc_STRVAR(scribus_importpage__doc__,
216 QT_TR_NOOP("importPage(\"fromDoc\", (pageList), [create, imortwhere, importwherePage])\n\
217 \n\
218 Imports a set of pages (given as a tuple) from an existing document (the file name must be given). This functions maps the \"Page->Import\" dropdown menu function.\n\
219 fromDoc: string; the filename of the document to import pages from\n\
220 pageList: tuple with page numbers of pages to import\n\
221 create: number; 0 to replace existing pages, 1 (default) to insert new pages\n\
222 importWhere: number; the page number (of the current document) at which import the pages\n\
223 importWherePage: number; used if create==1; 0 to create pages before selected page; 1 to create pages after selected page; 2 (default) to create pages at the end of the document\n\
224 "));
225 PyObject *scribus_importpage(PyObject */*self*/, PyObject* args);
226 
227 #endif
228