summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/scriptplugin/cmdpage.h
blob: c3880d53b8b44a0a04cf4e8e7c104cf61289808f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef CMDPAGE_H
#define CMDPAGE_H

// Pulls in <Python.h> first
#include "cmdvar.h"

/** Page related Commands */

/*! docstring */
PyDoc_STRVAR(scribus_newpage__doc__,
QT_TR_NOOP("newPage(where [,\"masterpage\"])\n\
\n\
Creates a new page. If \"where\" is -1 the new Page is appended to the\n\
document, otherwise the new page is inserted before \"where\". Page numbers are\n\
counted from 1 upwards, no matter what the displayed first page number of your\n\
document is. The optional parameter \"masterpage\" specifies the name of the\n\
master page for the new page.\n\
\n\
May raise IndexError if the page number is out of range\n\
"));
/*! new page */
PyObject *scribus_newpage(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_actualpage__doc__,
QT_TR_NOOP("currentPage() -> integer\n\
\n\
Returns the number of the current working page. Page numbers are counted from 1\n\
upwards, no matter what the displayed first page number of your document is.\n\
"));
/*! get actual page */
PyObject *scribus_actualpage(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_redraw__doc__,
QT_TR_NOOP("redrawAll()\n\
\n\
Redraws all pages.\n\
"));
/*! redraw all */
PyObject *scribus_redraw(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_pageposition__doc__,
QT_TR_NOOP("getPageType() -> integer\n\
\n\
Returns the type of the Page, 0 means left Page, 1 is a middle Page and 2 is a right Page\n\
"));
/*! Go to page */
PyObject *scribus_pageposition(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_savepageeps__doc__,
QT_TR_NOOP("savePageAsEPS(\"name\")\n\
\n\
Saves the current page as an EPS to the file \"name\".\n\
\n\
May raise ScribusError if the save failed.\n\
"));
/*! Export page as EPS file */
PyObject *scribus_savepageeps(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_deletepage__doc__,
QT_TR_NOOP("deletePage(nr)\n\
\n\
Deletes the given page. Does nothing if the document contains only one page.\n\
Page numbers are counted from 1 upwards, no matter what the displayed first\n\
page number is.\n\
\n\
May raise IndexError if the page number is out of range\n\
"));
/*! Delete page */
PyObject *scribus_deletepage(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_gotopage__doc__,
QT_TR_NOOP("gotoPage(nr)\n\
\n\
Moves to the page \"nr\" (that is, makes the current page \"nr\"). Note that\n\
gotoPage doesn't (currently) change the page the user's view is displaying, it\n\
just sets the page that script commands will operates on.\n\
\n\
May raise IndexError if the page number is out of range.\n\
"));
/*! Go to page */
PyObject *scribus_gotopage(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_pagecount__doc__,
QT_TR_NOOP("pageCount() -> integer\n\
\n\
Returns the number of pages in the document.\n\
"));
/*! Go to page */
PyObject *scribus_pagecount(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_getHguides__doc__,
QT_TR_NOOP("getHGuides() -> list\n\
\n\
Returns a list containing positions of the horizontal guides. Values are in the\n\
document's current units - see UNIT_<type> constants.\n\
"));
/*! get H guides */
PyObject *scribus_getHguides(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_setHguides__doc__,
QT_TR_NOOP("setHGuides(list)\n\
\n\
Sets horizontal guides. Input parameter must be a list of guide positions\n\
measured in the current document units - see UNIT_<type> constants.\n\
\n\
Example: setHGuides(getHGuides() + [200.0, 210.0] # add new guides without any lost\n\
         setHGuides([90,250]) # replace current guides entirely\n\
"));
/*! set H guides */
PyObject *scribus_setHguides(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_getVguides__doc__,
QT_TR_NOOP("getVGuides()\n\
\n\
See getHGuides.\n\
"));
/*! get V guides */
PyObject *scribus_getVguides(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_setVguides__doc__,
QT_TR_NOOP("setVGuides()\n\
\n\
See setHGuides.\n\
"));
/*! set V guides */
PyObject *scribus_setVguides(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_pagedimension__doc__,
QT_TR_NOOP("getPageSize() -> tuple\n\
\n\
Returns a tuple with document page dimensions measured in the document's current units.\n\
See UNIT_<type> constants and getPageMargins()\n\
"));
/**
returns a tuple with page domensions in used system
e.g. when is the doc in picas returns picas ;)
(Petr Vanek 02/17/04)
*/
PyObject *scribus_pagedimension(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_pagensize__doc__,
QT_TR_NOOP("getPageNSize(nr) -> tuple\n\
\n\
Returns a tuple with a particular page's size measured in the document's current units.\n\
See UNIT_<type> constants and getPageMargins()\n\
"));
/**
returns a tuple with a particular page's size  in used system
e.g. when is the doc in picas returns picas ;)
*/
PyObject *scribus_pagensize(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_getpagemargins__doc__,
QT_TR_NOOP("getPageMargins()\n\
\n\
Returns the document page margins as a (top, left, right, bottom) tuple in the document's current\n\
units. See UNIT_<type> constants and getPageSize().\n\
"));
/**
returns a tuple with page margins
Craig Ringer, Petr Vanek 09/25/2004
*/
PyObject *scribus_getpagemargins(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_pagenmargins__doc__,
QT_TR_NOOP("getPageNMargins(nr) -> tuple\n\
\n\
Returns a tuple with a particular page's margins measured in the document's current units.\n\
See UNIT_<type> constants and getPageMargins()\n\
"));
/**
returns a tuple with a particular page's size  in used system
e.g. when is the doc in picas returns picas ;)
*/
PyObject *scribus_pagenmargins(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_getpageitems__doc__,
QT_TR_NOOP("getPageItems() -> list\n\
\n\
Returns a list of tuples with items on the current page. The tuple is:\n\
(name, objectType, order) E.g. [('Text1', 4, 0), ('Image1', 2, 1)]\n\
means that object named 'Text1' is a text frame (type 4) and is the first at\n\
the page...\n\
"));
/**
returns a list of tuples with items on the actual page
TODO: solve utf/iso chars in object names
(Petr Vanek 03/02/2004)
*/
PyObject *scribus_getpageitems(PyObject * /*self*/);

/*! importpage */
PyDoc_STRVAR(scribus_importpage__doc__,
QT_TR_NOOP("importPage(\"fromDoc\", (pageList), [create, imortwhere, importwherePage])\n\
\n\
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\
fromDoc: string; the filename of the document to import pages from\n\
pageList: tuple with page numbers of pages to import\n\
create: number; 0 to replace existing pages, 1 (default) to insert new pages\n\
importWhere: number; the page number (of the current document) at which import the pages\n\
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\
"));
PyObject *scribus_importpage(PyObject */*self*/, PyObject* args);

#endif