Subversion Repositories Scribus

Rev

Rev 17330 | Rev 21563 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 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
*/
82 Franz 7
#ifndef CMDTEXT_H
8
#define CMDTEXT_H
9
 
792 subik 10
// Pulls in <Python.h> first
11
#include "cmdvar.h"
82 Franz 12
 
733 subik 13
/*! Text frame handling */
14
 
15
/*! docstring */
16
PyDoc_STRVAR(scribus_getfontsize__doc__,
853 subik 17
QT_TR_NOOP("getFontSize([\"name\"]) -> float\n\
18
\n\
19
Returns the font size in points for the text frame \"name\". If this text\n\
20
frame has some text selected the value assigned to the first character of\n\
21
the selection is returned.\n\
22
If \"name\" is not given the currently selected item is used.\n\
23
"));
733 subik 24
/*! Get font size */
10770 craig 25
PyObject *scribus_getfontsize(PyObject * /*self*/, PyObject* args);
733 subik 26
 
27
/*! docstring */
28
PyDoc_STRVAR(scribus_getfont__doc__,
853 subik 29
QT_TR_NOOP("getFont([\"name\"]) -> string\n\
30
\n\
31
Returns the font name for the text frame \"name\". If this text frame\n\
32
has some text selected the value assigned to the first character\n\
33
of the selection is returned. If \"name\" is not given the currently\n\
34
selected item is used.\n\
35
"));
733 subik 36
/*! Get font */
10770 craig 37
PyObject *scribus_getfont(PyObject * /*self*/, PyObject* args);
733 subik 38
 
39
/*! docstring */
40
PyDoc_STRVAR(scribus_gettextsize__doc__,
853 subik 41
QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\
42
\n\
43
Returns the length of the text in the text frame \"name\".\n\
44
If \"name\" is not given the currently selected item is used.\n\
45
"));
733 subik 46
/*! Get text size */
10770 craig 47
PyObject *scribus_gettextsize(PyObject * /*self*/, PyObject* args);
733 subik 48
 
49
/*! docstring */
6298 fschmid 50
PyDoc_STRVAR(scribus_gettextlines__doc__,
51
QT_TR_NOOP("getTextLines([\"name\"]) -> integer\n\
52
\n\
53
Returns the number of lines of the text in the text frame \"name\".\n\
54
If \"name\" is not given the currently selected item is used.\n\
55
"));
56
/*! Get text lines */
10770 craig 57
PyObject *scribus_gettextlines(PyObject * /*self*/, PyObject* args);
6298 fschmid 58
 
59
/*! docstring */
733 subik 60
PyDoc_STRVAR(scribus_getframetext__doc__,
853 subik 61
QT_TR_NOOP("getText([\"name\"]) -> string\n\
62
\n\
63
Returns the text of the text frame \"name\". If this text frame has some text\n\
64
selected, the selected text is returned. All text in the frame, not just\n\
65
currently visible text, is returned. If \"name\" is not given the currently\n\
66
selected item is used.\n\
67
"));
733 subik 68
/*! Get frame text */
10770 craig 69
PyObject *scribus_getframetext(PyObject * /*self*/, PyObject* args);
733 subik 70
 
71
/*! docstring */
72
PyDoc_STRVAR(scribus_gettext__doc__,
853 subik 73
QT_TR_NOOP("getAllText([\"name\"]) -> string\n\
74
\n\
75
Returns the text of the text frame \"name\" and of all text frames which are\n\
76
linked with this frame. If this textframe has some text selected, the selected\n\
77
text is returned. If \"name\" is not given the currently selected item is\n\
78
used.\n\
79
"));
733 subik 80
/*! Get all text */
10770 craig 81
PyObject *scribus_gettext(PyObject * /*self*/, PyObject* args);
733 subik 82
 
83
/*! docstring */
84
PyDoc_STRVAR(scribus_getlinespace__doc__,
853 subik 85
QT_TR_NOOP("getLineSpacing([\"name\"]) -> float\n\
86
\n\
87
Returns the line spacing (\"leading\") of the text frame \"name\" expressed in\n\
88
points. If \"name\" is not given the currently selected item is used.\n\
89
"));
733 subik 90
/*! Get line space */
10770 craig 91
PyObject *scribus_getlinespace(PyObject * /*self*/, PyObject* args);
733 subik 92
 
93
/*! docstring */
12332 jghali 94
PyDoc_STRVAR(scribus_gettextdistances__doc__,
95
QT_TR_NOOP("getTextDistances([\"name\"]) -> tuple\n\
96
\n\
97
Returns the text distances of the text frame \"name\" expressed in points. The\n\
98
distances are returned as a tuple like (left, right, top, bottom). If \"name\"\n\
99
is not given the currently selected item is used.\n\
100
"));
101
/*! Get text distances */
102
PyObject *scribus_gettextdistances(PyObject */*self*/, PyObject* args);
103
 
104
/*! docstring */
733 subik 105
PyDoc_STRVAR(scribus_getcolumngap__doc__,
853 subik 106
QT_TR_NOOP("getColumnGap([\"name\"]) -> float\n\
107
\n\
108
Returns the column gap size of the text frame \"name\" expressed in points. If\n\
109
\"name\" is not given the currently selected item is used.\n\
110
"));
733 subik 111
/*! Get column gap */
10770 craig 112
PyObject *scribus_getcolumngap(PyObject * /*self*/, PyObject* args);
733 subik 113
 
114
/*! docstring */
115
PyDoc_STRVAR(scribus_getcolumns__doc__,
853 subik 116
QT_TR_NOOP("getColumns([\"name\"]) -> integer\n\
117
\n\
118
Gets the number of columns of the text frame \"name\". If \"name\" is not\n\
119
given the currently selected item is used.\n\
120
"));
733 subik 121
/*! Get columns */
10770 craig 122
PyObject *scribus_getcolumns(PyObject * /*self*/, PyObject* args);
733 subik 123
 
124
/*! docstring */
125
PyDoc_STRVAR(scribus_setboxtext__doc__,
853 subik 126
QT_TR_NOOP("setText(\"text\", [\"name\"])\n\
127
\n\
128
Sets the text of the text frame \"name\" to the text of the string \"text\".\n\
129
Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ\n\
130
for more details. If \"name\" is not given the currently selected item is\n\
131
used.\n\
132
"));
733 subik 133
/*! Set text */
10770 craig 134
PyObject *scribus_setboxtext(PyObject * /*self*/, PyObject* args);
733 subik 135
 
136
/*! docstring */
137
PyDoc_STRVAR(scribus_inserttext__doc__,
853 subik 138
QT_TR_NOOP("insertText(\"text\", pos, [\"name\"])\n\
139
\n\
1977 craig 140
Inserts the text \"text\" at the position \"pos\" into the text frame \"name\".\n\
141
Text must be UTF encoded (see setText() as reference) The first character has an\n\
7440 subik 142
index of 0. Inserting text at position -1 appends it to the frame. If \"name\" is\n\
1977 craig 143
not given the currently selected Item is used.\n\
853 subik 144
\n\
145
May throw IndexError for an insertion out of bounds.\n\
146
"));
733 subik 147
/*! Insert text */
10770 craig 148
PyObject *scribus_inserttext(PyObject * /*self*/, PyObject* args);
733 subik 149
 
150
/*! docstring */
17795 jghali 151
PyDoc_STRVAR(scribus_inserthtmltext__doc__,
152
QT_TR_NOOP("insertHTMLText(\"file\", [\"name\"])\n\
153
\n\
154
Inserts the text from \"file\" into the text frame \"name\".\n\
155
Text must be UTF encoded (see setText() as reference). If \"name\" is\n\
156
not given the currently selected Item is used.\n\
157
"));
158
/*! Insert HTML text */
159
PyObject *scribus_inserthtmltext(PyObject * /*self*/, PyObject* args);
160
 
161
/*! docstring */
733 subik 162
PyDoc_STRVAR(scribus_setfont__doc__,
853 subik 163
QT_TR_NOOP("setFont(\"font\", [\"name\"])\n\
164
\n\
165
Sets the font of the text frame \"name\" to \"font\". If there is some text\n\
166
selected only the selected text is changed.  If \"name\" is not given the\n\
167
currently selected item is used.\n\
168
\n\
169
May throw ValueError if the font cannot be found.\n\
170
"));
733 subik 171
/*! Set font */
10770 craig 172
PyObject *scribus_setfont(PyObject * /*self*/, PyObject* args);
733 subik 173
 
174
/*! docstring */
175
PyDoc_STRVAR(scribus_setfontsize__doc__,
853 subik 176
QT_TR_NOOP("setFontSize(size, [\"name\"])\n\
177
\n\
178
Sets the font size of the text frame \"name\" to \"size\". \"size\" is treated\n\
179
as a value in points. If there is some text selected only the selected text is\n\
180
changed. \"size\" must be in the range 1 to 512. If \"name\" is not given the\n\
181
currently selected item is used.\n\
182
\n\
183
May throw ValueError for a font size that's out of bounds.\n\
184
"));
733 subik 185
/*! Set font size */
10770 craig 186
PyObject *scribus_setfontsize(PyObject * /*self*/, PyObject* args);
733 subik 187
 
188
/*! docstring */
189
PyDoc_STRVAR(scribus_setlinespace__doc__,
853 subik 190
QT_TR_NOOP("setLineSpacing(size, [\"name\"])\n\
191
\n\
192
Sets the line spacing (\"leading\") of the text frame \"name\" to \"size\".\n\
193
\"size\" is a value in points. If \"name\" is not given the currently selected\n\
194
item is used.\n\
195
\n\
196
May throw ValueError if the line spacing is out of bounds.\n\
197
"));
733 subik 198
/*! Set line space */
10770 craig 199
PyObject *scribus_setlinespace(PyObject * /*self*/, PyObject* args);
733 subik 200
 
201
/*! docstring */
14427 jghali 202
PyDoc_STRVAR(scribus_setlinespacemode__doc__,
203
QT_TR_NOOP("setLineSpacingMode(mode, [\"name\"])\n\
204
\n\
205
Sets the line spacing mode of the text frame \"name\" to \"mode\".\n\
206
If \"name\" is not given the currently selected\n\
207
item is used.\n\
208
Mode values are the same as in createParagraphStyle.\n\
209
\n\
210
May throw ValueError if the mode is out of bounds.\n\
211
"));
212
/*! Set line space mode */
213
PyObject *scribus_setlinespacemode(PyObject * /*self*/, PyObject* args);
214
 
215
/*! docstring */
12332 jghali 216
PyDoc_STRVAR(scribus_settextdistances__doc__,
217
QT_TR_NOOP("setTextDistances(left, right, top, bottom, [\"name\"])\n\
218
\n\
219
Sets the text distances of the text frame \"name\" to the values \"left\"\n\
220
\"right\", \"top\" and \"bottom\". If \"name\" is not given the currently\n\
221
selected item is used.\n\
222
\n\
223
May throw ValueError if any of the distances are out of bounds (must be positive).\n\
224
"));
225
/*! Set text distances */
226
PyObject *scribus_settextdistances(PyObject */*self*/, PyObject* args);
227
 
228
/*! docstring */
733 subik 229
PyDoc_STRVAR(scribus_setcolumngap__doc__,
853 subik 230
QT_TR_NOOP("setColumnGap(size, [\"name\"])\n\
231
\n\
232
Sets the column gap of the text frame \"name\" to the value \"size\". If\n\
233
\"name\" is not given the currently selected item is used.\n\
234
\n\
235
May throw ValueError if the column gap is out of bounds (must be positive).\n\
236
"));
733 subik 237
/*! Set column gap */
10770 craig 238
PyObject *scribus_setcolumngap(PyObject * /*self*/, PyObject* args);
733 subik 239
 
240
/*! docstring */
241
PyDoc_STRVAR(scribus_setcolumns__doc__,
853 subik 242
QT_TR_NOOP("setColumns(nr, [\"name\"])\n\
243
\n\
244
Sets the number of columns of the text frame \"name\" to the integer \"nr\".\n\
245
If \"name\" is not given the currently selected item is used.\n\
246
\n\
247
May throw ValueError if number of columns is not at least one.\n\
248
"));
733 subik 249
/*! Set columns */
10770 craig 250
PyObject *scribus_setcolumns(PyObject * /*self*/, PyObject* args);
733 subik 251
 
252
/*! docstring */
253
PyDoc_STRVAR(scribus_setalign__doc__,
853 subik 254
QT_TR_NOOP("setTextAlignment(align, [\"name\"])\n\
255
\n\
256
Sets the text alignment of the text frame \"name\" to the specified alignment.\n\
257
If \"name\" is not given the currently selected item is used. \"align\" should\n\
258
be one of the ALIGN_ constants defined in this module - see dir(scribus).\n\
259
\n\
260
May throw ValueError for an invalid alignment constant.\n\
261
"));
733 subik 262
/*! Set alignt */
10770 craig 263
PyObject *scribus_setalign(PyObject * /*self*/, PyObject* args);
733 subik 264
 
265
/*! docstring */
266
PyDoc_STRVAR(scribus_selecttext__doc__,
853 subik 267
QT_TR_NOOP("selectText(start, count, [\"name\"])\n\
268
\n\
269
Selects \"count\" characters of text in the text frame \"name\" starting from the\n\
270
character \"start\". Character counting starts at 0. If \"count\" is zero, any\n\
271
text selection will be cleared.  If \"name\" is not given the currently\n\
272
selected item is used.\n\
273
\n\
274
May throw IndexError if the selection is outside the bounds of the text.\n\
275
"));
733 subik 276
/*! Select text */
10770 craig 277
PyObject *scribus_selecttext(PyObject * /*self*/, PyObject* args);
733 subik 278
 
279
/*! docstring */
280
PyDoc_STRVAR(scribus_deletetext__doc__,
853 subik 281
QT_TR_NOOP("deleteText([\"name\"])\n\
282
\n\
283
Deletes any text in the text frame \"name\". If there is some text selected,\n\
284
only the selected text will be deleted. If \"name\" is not given the currently\n\
285
selected item is used.\n\
286
"));
733 subik 287
/*! Delete text */
10770 craig 288
PyObject *scribus_deletetext(PyObject * /*self*/, PyObject* args);
733 subik 289
 
290
/*! docstring */
291
PyDoc_STRVAR(scribus_settextfill__doc__,
853 subik 292
QT_TR_NOOP("setTextColor(\"color\", [\"name\"])\n\
293
\n\
294
Sets the text color of the text frame \"name\" to the color \"color\". If there\n\
295
is some text selected only the selected text is changed. If \"name\" is not\n\
296
given the currently selected item is used.\n\
297
"));
733 subik 298
/*! Set text fill */
10770 craig 299
PyObject *scribus_settextfill(PyObject * /*self*/, PyObject* args);
733 subik 300
 
301
/*! docstring */
302
PyDoc_STRVAR(scribus_settextstroke__doc__,
853 subik 303
QT_TR_NOOP("setTextStroke(\"color\", [\"name\"])\n\
304
\n\
305
Set \"color\" of the text stroke. If \"name\" is not given the currently\n\
306
selected item is used.\n\
307
"));
733 subik 308
/*! Set text stroke */
10770 craig 309
PyObject *scribus_settextstroke(PyObject * /*self*/, PyObject* args);
733 subik 310
 
311
/*! docstring */
13199 jghali 312
PyDoc_STRVAR(scribus_settextscalingv__doc__,
313
QT_TR_NOOP("setTextScalingV(scale, [\"name\"])\n\
314
\n\
315
Sets the vertical character scaling of the object \"name\" to \"scale\" in percent.\n\
316
If \"name\" is not given the currently selected item is used.\n\
317
"));
318
/*! Set text shde */
319
PyObject *scribus_settextscalingv(PyObject * /*self*/, PyObject* args);
320
 
321
/*! docstring */
322
PyDoc_STRVAR(scribus_settextscalingh__doc__,
323
QT_TR_NOOP("setTextScalingH(scale, [\"name\"])\n\
324
\n\
325
Sets the horizontal character scaling of the object \"name\" to \"scale\" in percent.\n\
326
If \"name\" is not given the currently selected item is used.\n\
327
"));
328
/*! Set text shde */
329
PyObject *scribus_settextscalingh(PyObject * /*self*/, PyObject* args);
330
 
331
/*! docstring */
733 subik 332
PyDoc_STRVAR(scribus_settextshade__doc__,
853 subik 333
QT_TR_NOOP("setTextShade(shade, [\"name\"])\n\
334
\n\
335
Sets the shading of the text color of the object \"name\" to \"shade\". If\n\
336
there is some text selected only the selected text is changed. \"shade\" must\n\
337
be an integer value in the range from 0 (lightest) to 100 (full color\n\
338
intensity). If \"name\" is not given the currently selected item is\n\
339
used.\n\
340
"));
733 subik 341
/*! Set text shde */
10770 craig 342
PyObject *scribus_settextshade(PyObject * /*self*/, PyObject* args);
733 subik 343
 
344
/*! docstring */
345
PyDoc_STRVAR(scribus_linktextframes__doc__,
853 subik 346
QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\
347
\n\
348
Link two text frames. The frame named \"fromname\" is linked to the\n\
349
frame named \"toname\". The target frame must be an empty text frame\n\
350
and must not link to or be linked from any other frames already.\n\
351
\n\
352
May throw ScribusException if linking rules are violated.\n\
353
"));
213 Franz 354
/**
733 subik 355
 Link text frames via Scripter.
356
 02/22/04 (petr vanek)
357
 TODO: PDF bookmarks handling
358
 */
10770 craig 359
PyObject *scribus_linktextframes(PyObject * /*self*/, PyObject* args);
733 subik 360
 
361
/*! docstring */
362
PyDoc_STRVAR(scribus_unlinktextframes__doc__,
853 subik 363
QT_TR_NOOP("unlinkTextFrames(\"name\")\n\
364
\n\
365
Remove the specified (named) object from the text frame flow/linkage. If the\n\
366
frame was in the middle of a chain, the previous and next frames will be\n\
367
connected, eg 'a->b->c' becomes 'a->c' when you unlinkTextFrames(b)'\n\
368
\n\
369
May throw ScribusException if linking rules are violated.\n\
370
"));
733 subik 371
/**
213 Franz 372
 (Un)Link text frames via Scripter.
373
 02/22/04 (petr vanek)
374
 TODO: PDF bookmarks handling
375
 */
376
PyObject *scribus_unlinktextframes(PyObject * self, PyObject* args);
733 subik 377
 
378
/*! docstring */
379
PyDoc_STRVAR(scribus_tracetext__doc__,
853 subik 380
QT_TR_NOOP("traceText([\"name\"])\n\
381
\n\
382
Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\
383
currently selected item is used."));
411 Franz 384
/**
385
 Trace text frames via Scripter.
386
 2004-09-07 (Craig Ringer)
387
*/
388
PyObject *scribus_tracetext(PyObject * self, PyObject* args);
82 Franz 389
 
1419 subik 390
PyDoc_STRVAR(scribus_istextoverflowing__doc__,
1607 subik 391
QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\
1419 subik 392
\n\
17330 jghali 393
Returns 1 if there are overflowing characters in text frame \"name\", 0 if not.\n\
1607 subik 394
If is nolinks set to non zero value it takes only one frame - it doesn't\n\
395
use text frame linking. Without this parameter it search all linking chain.\n\
1419 subik 396
\n\
397
May raise WrongFrameTypeError if the target frame is not an text frame\n"));
398
/** Check if is the text frame overflowind or not
399
 2005-02-04 petr vanek
400
 */
1607 subik 401
PyObject *scribus_istextoverflowing(PyObject * self, PyObject* args, PyObject* kw);
1419 subik 402
 
11223 subik 403
PyDoc_STRVAR(scribus_hyphenatetext__doc__,
404
QT_TR_NOOP("hyphenateText([\"name\"]) -> bool\n\
405
\n\
406
Does hyphenation on text frame \"name\".\n\
407
If \"name\" is not given the currently selected item is used.\n\
408
\n\
409
May raise WrongFrameTypeError if the target frame is not a text frame\n\
410
"));
411
/*
412
        Does hyphenation on the given text frame
413
        08.12.2007: Joachim Neu
414
*/
415
PyObject *scribus_hyphenatetext(PyObject *, PyObject* args);
416
 
417
PyDoc_STRVAR(scribus_dehyphenatetext__doc__,
418
QT_TR_NOOP("dehyphenateText([\"name\"]) -> bool\n\
419
\n\
420
Does dehyphenation on text frame \"name\".\n\
421
If \"name\" is not given the currently selected item is used.\n\
422
\n\
423
May raise WrongFrameTypeError if the target frame is not a text frame\n\
424
"));
425
/*
426
        Does dehyphenation on the given text frame
427
        13.12.2007: Joachim Neu
428
*/
429
PyObject *scribus_dehyphenatetext(PyObject *, PyObject* args);
430
 
1534 subik 431
/*! docstring */
432
PyDoc_STRVAR(scribus_setpdfbookmark__doc__,
433
QT_TR_NOOP("setPDFBookmark(\"toggle\", [\"name\"])\n\
434
\n\
10749 cbradney 435
Sets whether (toggle = 1) the text frame \"name\" is a bookmark nor not.\n\
1534 subik 436
If \"name\" is not given the currently selected item is used.\n\
437
\n\
438
May raise WrongFrameTypeError if the target frame is not a text frame\n\
439
"));
440
/*! Set PDF bookmark */
10770 craig 441
PyObject *scribus_setpdfbookmark(PyObject * /*self*/, PyObject* args);
1534 subik 442
 
443
/*! docstring */
444
PyDoc_STRVAR(scribus_ispdfbookmark__doc__,
445
 QT_TR_NOOP("isPDFBookmark([\"name\"]) -> bool\n\
446
\n\
447
Returns true if the text frame \"name\" is a PDF bookmark.\n\
448
If \"name\" is not given the currently selected item is used.\n\
449
\n\
450
May raise WrongFrameTypeError if the target frame is not a text frame\n\
451
"));
452
/*! Is PDF bookmark? */
10770 craig 453
PyObject *scribus_ispdfbookmark(PyObject * /*self*/, PyObject* args);
1534 subik 454
 
82 Franz 455
#endif