Back to index

scribus-ng  1.3.4.dfsg+svn20071115
cmdtext.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef CMDTEXT_H
00008 #define CMDTEXT_H
00009 
00010 // Pulls in <Python.h> first
00011 #include "cmdvar.h"
00012 
00016 PyDoc_STRVAR(scribus_getfontsize__doc__,
00017 QT_TR_NOOP("getFontSize([\"name\"]) -> float\n\
00018 \n\
00019 Returns the font size in points for the text frame \"name\". If this text\n\
00020 frame has some text selected the value assigned to the first character of\n\
00021 the selection is returned.\n\
00022 If \"name\" is not given the currently selected item is used.\n\
00023 "));
00025 PyObject *scribus_getfontsize(PyObject */*self*/, PyObject* args);
00026 
00028 PyDoc_STRVAR(scribus_getfont__doc__,
00029 QT_TR_NOOP("getFont([\"name\"]) -> string\n\
00030 \n\
00031 Returns the font name for the text frame \"name\". If this text frame\n\
00032 has some text selected the value assigned to the first character\n\
00033 of the selection is returned. If \"name\" is not given the currently\n\
00034 selected item is used.\n\
00035 "));
00037 PyObject *scribus_getfont(PyObject */*self*/, PyObject* args);
00038 
00040 PyDoc_STRVAR(scribus_gettextsize__doc__,
00041 QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\
00042 \n\
00043 Returns the length of the text in the text frame \"name\".\n\
00044 If \"name\" is not given the currently selected item is used.\n\
00045 "));
00047 PyObject *scribus_gettextsize(PyObject */*self*/, PyObject* args);
00048 
00050 PyDoc_STRVAR(scribus_gettextlines__doc__,
00051 QT_TR_NOOP("getTextLines([\"name\"]) -> integer\n\
00052 \n\
00053 Returns the number of lines of the text in the text frame \"name\".\n\
00054 If \"name\" is not given the currently selected item is used.\n\
00055 "));
00057 PyObject *scribus_gettextlines(PyObject */*self*/, PyObject* args);
00058 
00060 PyDoc_STRVAR(scribus_getframetext__doc__,
00061 QT_TR_NOOP("getText([\"name\"]) -> string\n\
00062 \n\
00063 Returns the text of the text frame \"name\". If this text frame has some text\n\
00064 selected, the selected text is returned. All text in the frame, not just\n\
00065 currently visible text, is returned. If \"name\" is not given the currently\n\
00066 selected item is used.\n\
00067 "));
00069 PyObject *scribus_getframetext(PyObject */*self*/, PyObject* args);
00070 
00072 PyDoc_STRVAR(scribus_gettext__doc__,
00073 QT_TR_NOOP("getAllText([\"name\"]) -> string\n\
00074 \n\
00075 Returns the text of the text frame \"name\" and of all text frames which are\n\
00076 linked with this frame. If this textframe has some text selected, the selected\n\
00077 text is returned. If \"name\" is not given the currently selected item is\n\
00078 used.\n\
00079 "));
00081 PyObject *scribus_gettext(PyObject */*self*/, PyObject* args);
00082 
00084 PyDoc_STRVAR(scribus_getlinespace__doc__,
00085 QT_TR_NOOP("getLineSpacing([\"name\"]) -> float\n\
00086 \n\
00087 Returns the line spacing (\"leading\") of the text frame \"name\" expressed in\n\
00088 points. If \"name\" is not given the currently selected item is used.\n\
00089 "));
00091 PyObject *scribus_getlinespace(PyObject */*self*/, PyObject* args);
00092 
00094 PyDoc_STRVAR(scribus_getcolumngap__doc__,
00095 QT_TR_NOOP("getColumnGap([\"name\"]) -> float\n\
00096 \n\
00097 Returns the column gap size of the text frame \"name\" expressed in points. If\n\
00098 \"name\" is not given the currently selected item is used.\n\
00099 "));
00101 PyObject *scribus_getcolumngap(PyObject */*self*/, PyObject* args);
00102 
00104 PyDoc_STRVAR(scribus_getcolumns__doc__,
00105 QT_TR_NOOP("getColumns([\"name\"]) -> integer\n\
00106 \n\
00107 Gets the number of columns of the text frame \"name\". If \"name\" is not\n\
00108 given the currently selected item is used.\n\
00109 "));
00111 PyObject *scribus_getcolumns(PyObject */*self*/, PyObject* args);
00112 
00114 PyDoc_STRVAR(scribus_setboxtext__doc__,
00115 QT_TR_NOOP("setText(\"text\", [\"name\"])\n\
00116 \n\
00117 Sets the text of the text frame \"name\" to the text of the string \"text\".\n\
00118 Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ\n\
00119 for more details. If \"name\" is not given the currently selected item is\n\
00120 used.\n\
00121 "));
00123 PyObject *scribus_setboxtext(PyObject */*self*/, PyObject* args);
00124 
00126 PyDoc_STRVAR(scribus_inserttext__doc__,
00127 QT_TR_NOOP("insertText(\"text\", pos, [\"name\"])\n\
00128 \n\
00129 Inserts the text \"text\" at the position \"pos\" into the text frame \"name\".\n\
00130 Text must be UTF encoded (see setText() as reference) The first character has an\n\
00131 index of 0. Inserting text at position -1 appends it to the frame. If \"name\" is\n\
00132 not given the currently selected Item is used.\n\
00133 \n\
00134 May throw IndexError for an insertion out of bounds.\n\
00135 "));
00137 PyObject *scribus_inserttext(PyObject */*self*/, PyObject* args);
00138 
00140 PyDoc_STRVAR(scribus_setfont__doc__,
00141 QT_TR_NOOP("setFont(\"font\", [\"name\"])\n\
00142 \n\
00143 Sets the font of the text frame \"name\" to \"font\". If there is some text\n\
00144 selected only the selected text is changed.  If \"name\" is not given the\n\
00145 currently selected item is used.\n\
00146 \n\
00147 May throw ValueError if the font cannot be found.\n\
00148 "));
00150 PyObject *scribus_setfont(PyObject */*self*/, PyObject* args);
00151 
00153 PyDoc_STRVAR(scribus_setfontsize__doc__,
00154 QT_TR_NOOP("setFontSize(size, [\"name\"])\n\
00155 \n\
00156 Sets the font size of the text frame \"name\" to \"size\". \"size\" is treated\n\
00157 as a value in points. If there is some text selected only the selected text is\n\
00158 changed. \"size\" must be in the range 1 to 512. If \"name\" is not given the\n\
00159 currently selected item is used.\n\
00160 \n\
00161 May throw ValueError for a font size that's out of bounds.\n\
00162 "));
00164 PyObject *scribus_setfontsize(PyObject */*self*/, PyObject* args);
00165 
00167 PyDoc_STRVAR(scribus_setlinespace__doc__,
00168 QT_TR_NOOP("setLineSpacing(size, [\"name\"])\n\
00169 \n\
00170 Sets the line spacing (\"leading\") of the text frame \"name\" to \"size\".\n\
00171 \"size\" is a value in points. If \"name\" is not given the currently selected\n\
00172 item is used.\n\
00173 \n\
00174 May throw ValueError if the line spacing is out of bounds.\n\
00175 "));
00177 PyObject *scribus_setlinespace(PyObject */*self*/, PyObject* args);
00178 
00180 PyDoc_STRVAR(scribus_setcolumngap__doc__,
00181 QT_TR_NOOP("setColumnGap(size, [\"name\"])\n\
00182 \n\
00183 Sets the column gap of the text frame \"name\" to the value \"size\". If\n\
00184 \"name\" is not given the currently selected item is used.\n\
00185 \n\
00186 May throw ValueError if the column gap is out of bounds (must be positive).\n\
00187 "));
00189 PyObject *scribus_setcolumngap(PyObject */*self*/, PyObject* args);
00190 
00192 PyDoc_STRVAR(scribus_setcolumns__doc__,
00193 QT_TR_NOOP("setColumns(nr, [\"name\"])\n\
00194 \n\
00195 Sets the number of columns of the text frame \"name\" to the integer \"nr\".\n\
00196 If \"name\" is not given the currently selected item is used.\n\
00197 \n\
00198 May throw ValueError if number of columns is not at least one.\n\
00199 "));
00201 PyObject *scribus_setcolumns(PyObject */*self*/, PyObject* args);
00202 
00204 PyDoc_STRVAR(scribus_setalign__doc__,
00205 QT_TR_NOOP("setTextAlignment(align, [\"name\"])\n\
00206 \n\
00207 Sets the text alignment of the text frame \"name\" to the specified alignment.\n\
00208 If \"name\" is not given the currently selected item is used. \"align\" should\n\
00209 be one of the ALIGN_ constants defined in this module - see dir(scribus).\n\
00210 \n\
00211 May throw ValueError for an invalid alignment constant.\n\
00212 "));
00214 PyObject *scribus_setalign(PyObject */*self*/, PyObject* args);
00215 
00217 PyDoc_STRVAR(scribus_selecttext__doc__,
00218 QT_TR_NOOP("selectText(start, count, [\"name\"])\n\
00219 \n\
00220 Selects \"count\" characters of text in the text frame \"name\" starting from the\n\
00221 character \"start\". Character counting starts at 0. If \"count\" is zero, any\n\
00222 text selection will be cleared.  If \"name\" is not given the currently\n\
00223 selected item is used.\n\
00224 \n\
00225 May throw IndexError if the selection is outside the bounds of the text.\n\
00226 "));
00228 PyObject *scribus_selecttext(PyObject */*self*/, PyObject* args);
00229 
00231 PyDoc_STRVAR(scribus_deletetext__doc__,
00232 QT_TR_NOOP("deleteText([\"name\"])\n\
00233 \n\
00234 Deletes any text in the text frame \"name\". If there is some text selected,\n\
00235 only the selected text will be deleted. If \"name\" is not given the currently\n\
00236 selected item is used.\n\
00237 "));
00239 PyObject *scribus_deletetext(PyObject */*self*/, PyObject* args);
00240 
00242 PyDoc_STRVAR(scribus_settextfill__doc__,
00243 QT_TR_NOOP("setTextColor(\"color\", [\"name\"])\n\
00244 \n\
00245 Sets the text color of the text frame \"name\" to the color \"color\". If there\n\
00246 is some text selected only the selected text is changed. If \"name\" is not\n\
00247 given the currently selected item is used.\n\
00248 "));
00250 PyObject *scribus_settextfill(PyObject */*self*/, PyObject* args);
00251 
00253 PyDoc_STRVAR(scribus_settextstroke__doc__,
00254 QT_TR_NOOP("setTextStroke(\"color\", [\"name\"])\n\
00255 \n\
00256 Set \"color\" of the text stroke. If \"name\" is not given the currently\n\
00257 selected item is used.\n\
00258 "));
00260 PyObject *scribus_settextstroke(PyObject */*self*/, PyObject* args);
00261 
00263 PyDoc_STRVAR(scribus_settextshade__doc__,
00264 QT_TR_NOOP("setTextShade(shade, [\"name\"])\n\
00265 \n\
00266 Sets the shading of the text color of the object \"name\" to \"shade\". If\n\
00267 there is some text selected only the selected text is changed. \"shade\" must\n\
00268 be an integer value in the range from 0 (lightest) to 100 (full color\n\
00269 intensity). If \"name\" is not given the currently selected item is\n\
00270 used.\n\
00271 "));
00273 PyObject *scribus_settextshade(PyObject */*self*/, PyObject* args);
00274 
00276 PyDoc_STRVAR(scribus_linktextframes__doc__,
00277 QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\
00278 \n\
00279 Link two text frames. The frame named \"fromname\" is linked to the\n\
00280 frame named \"toname\". The target frame must be an empty text frame\n\
00281 and must not link to or be linked from any other frames already.\n\
00282 \n\
00283 May throw ScribusException if linking rules are violated.\n\
00284 "));
00290 PyObject *scribus_linktextframes(PyObject */*self*/, PyObject* args);
00291 
00293 PyDoc_STRVAR(scribus_unlinktextframes__doc__,
00294 QT_TR_NOOP("unlinkTextFrames(\"name\")\n\
00295 \n\
00296 Remove the specified (named) object from the text frame flow/linkage. If the\n\
00297 frame was in the middle of a chain, the previous and next frames will be\n\
00298 connected, eg 'a->b->c' becomes 'a->c' when you unlinkTextFrames(b)'\n\
00299 \n\
00300 May throw ScribusException if linking rules are violated.\n\
00301 "));
00307 PyObject *scribus_unlinktextframes(PyObject * self, PyObject* args);
00308 
00310 PyDoc_STRVAR(scribus_tracetext__doc__,
00311 QT_TR_NOOP("traceText([\"name\"])\n\
00312 \n\
00313 Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\
00314 currently selected item is used."));
00319 PyObject *scribus_tracetext(PyObject * self, PyObject* args);
00320 
00321 PyDoc_STRVAR(scribus_istextoverflowing__doc__,
00322 QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\
00323 \n\
00324 Returns the actual number of overflowing characters in text frame \"name\".\n\
00325 If is nolinks set to non zero value it takes only one frame - it doesn't\n\
00326 use text frame linking. Without this parameter it search all linking chain.\n\
00327 \n\
00328 May raise WrongFrameTypeError if the target frame is not an text frame\n"));
00332 PyObject *scribus_istextoverflowing(PyObject * self, PyObject* args, PyObject* kw);
00333 
00335 PyDoc_STRVAR(scribus_setpdfbookmark__doc__,
00336 QT_TR_NOOP("setPDFBookmark(\"toggle\", [\"name\"])\n\
00337 \n\
00338 Sets wether (toggle = 1) the text frame \"name\" is a bookmark nor not.\n\
00339 If \"name\" is not given the currently selected item is used.\n\
00340 \n\
00341 May raise WrongFrameTypeError if the target frame is not a text frame\n\
00342 "));
00344 PyObject *scribus_setpdfbookmark(PyObject */*self*/, PyObject* args);
00345 
00347 PyDoc_STRVAR(scribus_ispdfbookmark__doc__,
00348  QT_TR_NOOP("isPDFBookmark([\"name\"]) -> bool\n\
00349 \n\
00350 Returns true if the text frame \"name\" is a PDF bookmark.\n\
00351 If \"name\" is not given the currently selected item is used.\n\
00352 \n\
00353 May raise WrongFrameTypeError if the target frame is not a text frame\n\
00354 "));
00356 PyObject *scribus_ispdfbookmark(PyObject */*self*/, PyObject* args);
00357 
00358 #endif