Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
cmdtext.h File Reference
#include "cmdvar.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 PyDoc_STRVAR (scribus_getfontsize__doc__, QT_TR_NOOP("getFontSize([\"name\"]) -> float\n\ \n\ Returns the font size in points for the text frame \"name\". If this text\n\ frame has some text selected the value assigned to the first character of\n\ the selection is returned.\n\ If \"name\" is not given the currently selected item is used.\n\ "))
 Text frame handling.
PyObject * scribus_getfontsize (PyObject *, PyObject *args)
 Get font size.
 PyDoc_STRVAR (scribus_getfont__doc__, QT_TR_NOOP("getFont([\"name\"]) -> string\n\ \n\ Returns the font name for the text frame \"name\". If this text frame\n\ has some text selected the value assigned to the first character\n\ of the selection is returned. If \"name\" is not given the currently\n\ selected item is used.\n\ "))
 docstring
PyObject * scribus_getfont (PyObject *, PyObject *args)
 Get font.
 PyDoc_STRVAR (scribus_gettextsize__doc__, QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\ \n\ Returns the length of the text in the text frame \"name\".\n\ If \"name\" is not given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_gettextsize (PyObject *, PyObject *args)
 Get text size.
 PyDoc_STRVAR (scribus_gettextlines__doc__, QT_TR_NOOP("getTextLines([\"name\"]) -> integer\n\ \n\ Returns the number of lines of the text in the text frame \"name\".\n\ If \"name\" is not given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_gettextlines (PyObject *, PyObject *args)
 Get text lines.
 PyDoc_STRVAR (scribus_getframetext__doc__, QT_TR_NOOP("getText([\"name\"]) -> string\n\ \n\ Returns the text of the text frame \"name\". If this text frame has some text\n\ selected, the selected text is returned. All text in the frame, not just\n\ currently visible text, is returned. If \"name\" is not given the currently\n\ selected item is used.\n\ "))
 docstring
PyObject * scribus_getframetext (PyObject *, PyObject *args)
 Get frame text.
 PyDoc_STRVAR (scribus_gettext__doc__, QT_TR_NOOP("getAllText([\"name\"]) -> string\n\ \n\ Returns the text of the text frame \"name\" and of all text frames which are\n\ linked with this frame. If this textframe has some text selected, the selected\n\ text is returned. If \"name\" is not given the currently selected item is\n\ used.\n\ "))
 docstring
PyObject * scribus_gettext (PyObject *, PyObject *args)
 Get all text.
 PyDoc_STRVAR (scribus_getlinespace__doc__, QT_TR_NOOP("getLineSpacing([\"name\"]) -> float\n\ \n\ Returns the line spacing (\"leading\") of the text frame \"name\" expressed in\n\ points. If \"name\" is not given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_getlinespace (PyObject *, PyObject *args)
 Get line space.
 PyDoc_STRVAR (scribus_getcolumngap__doc__, QT_TR_NOOP("getColumnGap([\"name\"]) -> float\n\ \n\ Returns the column gap size of the text frame \"name\" expressed in points. If\n\ \"name\" is not given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_getcolumngap (PyObject *, PyObject *args)
 Get column gap.
 PyDoc_STRVAR (scribus_getcolumns__doc__, QT_TR_NOOP("getColumns([\"name\"]) -> integer\n\ \n\ Gets the number of columns of the text frame \"name\". If \"name\" is not\n\ given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_getcolumns (PyObject *, PyObject *args)
 Get columns.
 PyDoc_STRVAR (scribus_setboxtext__doc__, QT_TR_NOOP("setText(\"text\", [\"name\"])\n\ \n\ Sets the text of the text frame \"name\" to the text of the string \"text\".\n\ Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ\n\ for more details. If \"name\" is not given the currently selected item is\n\ used.\n\ "))
 docstring
PyObject * scribus_setboxtext (PyObject *, PyObject *args)
 Set text.
 PyDoc_STRVAR (scribus_inserttext__doc__, QT_TR_NOOP("insertText(\"text\", pos, [\"name\"])\n\ \n\ Inserts the text \"text\" at the position \"pos\" into the text frame \"name\".\n\ Text must be UTF encoded (see setText() as reference) The first character has an\n\ index of 0. Inserting text at position -1 appends it to the frame. If \"name\" is\n\ not given the currently selected Item is used.\n\ \n\ May throw IndexError for an insertion out of bounds.\n\ "))
 docstring
PyObject * scribus_inserttext (PyObject *, PyObject *args)
 Insert text.
 PyDoc_STRVAR (scribus_setfont__doc__, QT_TR_NOOP("setFont(\"font\", [\"name\"])\n\ \n\ Sets the font of the text frame \"name\" to \"font\". If there is some text\n\ selected only the selected text is changed. If \"name\" is not given the\n\ currently selected item is used.\n\ \n\ May throw ValueError if the font cannot be found.\n\ "))
 docstring
PyObject * scribus_setfont (PyObject *, PyObject *args)
 Set font.
 PyDoc_STRVAR (scribus_setfontsize__doc__, QT_TR_NOOP("setFontSize(size, [\"name\"])\n\ \n\ Sets the font size of the text frame \"name\" to \"size\". \"size\" is treated\n\ as a value in points. If there is some text selected only the selected text is\n\ changed. \"size\" must be in the range 1 to 512. If \"name\" is not given the\n\ currently selected item is used.\n\ \n\ May throw ValueError for a font size that's out of bounds.\n\ "))
 docstring
PyObject * scribus_setfontsize (PyObject *, PyObject *args)
 Set font size.
 PyDoc_STRVAR (scribus_setlinespace__doc__, QT_TR_NOOP("setLineSpacing(size, [\"name\"])\n\ \n\ Sets the line spacing (\"leading\") of the text frame \"name\" to \"size\".\n\ \"size\" is a value in points. If \"name\" is not given the currently selected\n\ item is used.\n\ \n\ May throw ValueError if the line spacing is out of bounds.\n\ "))
 docstring
PyObject * scribus_setlinespace (PyObject *, PyObject *args)
 Set line space.
 PyDoc_STRVAR (scribus_setcolumngap__doc__, QT_TR_NOOP("setColumnGap(size, [\"name\"])\n\ \n\ Sets the column gap of the text frame \"name\" to the value \"size\". If\n\ \"name\" is not given the currently selected item is used.\n\ \n\ May throw ValueError if the column gap is out of bounds (must be positive).\n\ "))
 docstring
PyObject * scribus_setcolumngap (PyObject *, PyObject *args)
 Set column gap.
 PyDoc_STRVAR (scribus_setcolumns__doc__, QT_TR_NOOP("setColumns(nr, [\"name\"])\n\ \n\ Sets the number of columns of the text frame \"name\" to the integer \"nr\".\n\ If \"name\" is not given the currently selected item is used.\n\ \n\ May throw ValueError if number of columns is not at least one.\n\ "))
 docstring
PyObject * scribus_setcolumns (PyObject *, PyObject *args)
 Set columns.
 PyDoc_STRVAR (scribus_setalign__doc__, QT_TR_NOOP("setTextAlignment(align, [\"name\"])\n\ \n\ Sets the text alignment of the text frame \"name\" to the specified alignment.\n\ If \"name\" is not given the currently selected item is used. \"align\" should\n\ be one of the ALIGN_ constants defined in this module - see dir(scribus).\n\ \n\ May throw ValueError for an invalid alignment constant.\n\ "))
 docstring
PyObject * scribus_setalign (PyObject *, PyObject *args)
 Set alignt.
 PyDoc_STRVAR (scribus_selecttext__doc__, QT_TR_NOOP("selectText(start, count, [\"name\"])\n\ \n\ Selects \"count\" characters of text in the text frame \"name\" starting from the\n\ character \"start\". Character counting starts at 0. If \"count\" is zero, any\n\ text selection will be cleared. If \"name\" is not given the currently\n\ selected item is used.\n\ \n\ May throw IndexError if the selection is outside the bounds of the text.\n\ "))
 docstring
PyObject * scribus_selecttext (PyObject *, PyObject *args)
 Select text.
 PyDoc_STRVAR (scribus_deletetext__doc__, QT_TR_NOOP("deleteText([\"name\"])\n\ \n\ Deletes any text in the text frame \"name\". If there is some text selected,\n\ only the selected text will be deleted. If \"name\" is not given the currently\n\ selected item is used.\n\ "))
 docstring
PyObject * scribus_deletetext (PyObject *, PyObject *args)
 Delete text.
 PyDoc_STRVAR (scribus_settextfill__doc__, QT_TR_NOOP("setTextColor(\"color\", [\"name\"])\n\ \n\ Sets the text color of the text frame \"name\" to the color \"color\". If there\n\ is some text selected only the selected text is changed. If \"name\" is not\n\ given the currently selected item is used.\n\ "))
 docstring
PyObject * scribus_settextfill (PyObject *, PyObject *args)
 Set text fill.
 PyDoc_STRVAR (scribus_settextstroke__doc__, QT_TR_NOOP("setTextStroke(\"color\", [\"name\"])\n\ \n\ Set \"color\" of the text stroke. If \"name\" is not given the currently\n\ selected item is used.\n\ "))
 docstring
PyObject * scribus_settextstroke (PyObject *, PyObject *args)
 Set text stroke.
 PyDoc_STRVAR (scribus_settextshade__doc__, QT_TR_NOOP("setTextShade(shade, [\"name\"])\n\ \n\ Sets the shading of the text color of the object \"name\" to \"shade\". If\n\ there is some text selected only the selected text is changed. \"shade\" must\n\ be an integer value in the range from 0 (lightest) to 100 (full color\n\ intensity). If \"name\" is not given the currently selected item is\n\ used.\n\ "))
 docstring
PyObject * scribus_settextshade (PyObject *, PyObject *args)
 Set text shde.
 PyDoc_STRVAR (scribus_linktextframes__doc__, QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\ \n\ Link two text frames. The frame named \"fromname\" is linked to the\n\ frame named \"toname\". The target frame must be an empty text frame\n\ and must not link to or be linked from any other frames already.\n\ \n\ May throw ScribusException if linking rules are violated.\n\ "))
 docstring
PyObject * scribus_linktextframes (PyObject *, PyObject *args)
 Link text frames via Scripter.
 PyDoc_STRVAR (scribus_unlinktextframes__doc__, QT_TR_NOOP("unlinkTextFrames(\"name\")\n\ \n\ Remove the specified (named) object from the text frame flow/linkage. If the\n\ frame was in the middle of a chain, the previous and next frames will be\n\ connected, eg 'a->b->c' becomes 'a->c' when you unlinkTextFrames(b)'\n\ \n\ May throw ScribusException if linking rules are violated.\n\ "))
 docstring
PyObject * scribus_unlinktextframes (PyObject *self, PyObject *args)
 (Un)Link text frames via Scripter.
 PyDoc_STRVAR (scribus_tracetext__doc__, QT_TR_NOOP("traceText([\"name\"])\n\ \n\ Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\ currently selected item is used."))
 docstring
PyObject * scribus_tracetext (PyObject *self, PyObject *args)
 Trace text frames via Scripter.
 PyDoc_STRVAR (scribus_istextoverflowing__doc__, QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\ \n\ Returns the actual number of overflowing characters in text frame \"name\".\n\ If is nolinks set to non zero value it takes only one frame - it doesn't\n\ use text frame linking. Without this parameter it search all linking chain.\n\ \n\ May raise WrongFrameTypeError if the target frame is not an text frame\n"))
PyObject * scribus_istextoverflowing (PyObject *self, PyObject *args, PyObject *kw)
 Check if is the text frame overflowind or not 2005-02-04 petr vanek.
 PyDoc_STRVAR (scribus_setpdfbookmark__doc__, QT_TR_NOOP("setPDFBookmark(\"toggle\", [\"name\"])\n\ \n\ Sets wether (toggle = 1) the text frame \"name\" is a bookmark nor not.\n\ If \"name\" is not given the currently selected item is used.\n\ \n\ May raise WrongFrameTypeError if the target frame is not a text frame\n\ "))
 docstring
PyObject * scribus_setpdfbookmark (PyObject *, PyObject *args)
 Set PDF bookmark.
 PyDoc_STRVAR (scribus_ispdfbookmark__doc__, QT_TR_NOOP("isPDFBookmark([\"name\"]) -> bool\n\ \n\ Returns true if the text frame \"name\" is a PDF bookmark.\n\ If \"name\" is not given the currently selected item is used.\n\ \n\ May raise WrongFrameTypeError if the target frame is not a text frame\n\ "))
 docstring
PyObject * scribus_ispdfbookmark (PyObject *, PyObject *args)
 Is PDF bookmark?

Function Documentation

PyDoc_STRVAR ( scribus_getfontsize__doc__  ,
QT_TR_NOOP("getFontSize([\"name\"]) -> float\n\\n\Returns the font size in points for the text frame \"name\". If this text\n\frame has some text selected the value assigned to the first character of\n\the selection is returned.\n\If \"name\" is not given the currently selected item is used.\n\")   
)

Text frame handling.

docstring

PyDoc_STRVAR ( scribus_getfont__doc__  ,
QT_TR_NOOP("getFont([\"name\"]) -> string\n\\n\Returns the font name for the text frame \"name\". If this text frame\n\has some text selected the value assigned to the first character\n\of the selection is returned. If \"name\" is not given the currently\n\selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_gettextsize__doc__  ,
QT_TR_NOOP("getTextLength([\"name\"]) -> integer\n\\n\Returns the length of the text in the text frame \"name\".\n\If \"name\" is not given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_gettextlines__doc__  ,
QT_TR_NOOP("getTextLines([\"name\"]) -> integer\n\\n\Returns the number of lines of the text in the text frame \"name\".\n\If \"name\" is not given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getframetext__doc__  ,
QT_TR_NOOP("getText([\"name\"]) -> string\n\\n\Returns the text of the text frame \"name\". If this text frame has some text\n\selected, the selected text is returned. All text in the frame, not just\n\currently visible text, is returned. If \"name\" is not given the currently\n\selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_gettext__doc__  ,
QT_TR_NOOP("getAllText([\"name\"]) -> string\n\\n\Returns the text of the text frame \"name\" and of all text frames which are\n\linked with this frame. If this textframe has some text selected, the selected\n\text is returned. If \"name\" is not given the currently selected item is\n\used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getlinespace__doc__  ,
QT_TR_NOOP("getLineSpacing([\"name\"]) -> float\n\\n\Returns the line spacing (\"leading\") of the text frame \"name\" expressed in\n\points. If \"name\" is not given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getcolumngap__doc__  ,
QT_TR_NOOP("getColumnGap([\"name\"]) -> float\n\\n\Returns the column gap size of the text frame \"name\" expressed in points. If\n\\"name\" is not given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_getcolumns__doc__  ,
QT_TR_NOOP("getColumns([\"name\"]) -> integer\n\\n\Gets the number of columns of the text frame \"name\". If \"name\" is not\n\given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setboxtext__doc__  ,
QT_TR_NOOP("setText(\"text\", [\"name\"])\n\\n\Sets the text of the text frame \"name\" to the text of the string \"text\".\n\Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ\n\for more details. If \"name\" is not given the currently selected item is\n\used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_inserttext__doc__  ,
QT_TR_NOOP("insertText(\"text\", pos, [\"name\"])\n\\n\Inserts the text \"text\" at the position \"pos\" into the text frame \"name\".\n\Text must be UTF encoded (see setText() as reference) The first character has an\n\index of 0. Inserting text at position -1 appends it to the frame. If \"name\" is\n\not given the currently selected Item is used.\n\\n\May throw IndexError for an insertion out of bounds.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setfont__doc__  ,
QT_TR_NOOP("setFont(\"font\", [\"name\"])\n\\n\Sets the font of the text frame \"name\" to \"font\". If there is some text\n\selected only the selected text is changed. If \"name\" is not given the\n\currently selected item is used.\n\\n\May throw ValueError if the font cannot be found.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setfontsize__doc__  ,
QT_TR_NOOP("setFontSize(size, [\"name\"])\n\\n\Sets the font size of the text frame \"name\" to \"size\". \"size\" is treated\n\as a value in points. If there is some text selected only the selected text is\n\changed. \"size\" must be in the range 1 to 512. If \"name\" is not given the\n\currently selected item is used.\n\\n\May throw ValueError for a font size that's out of bounds.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setlinespace__doc__  ,
QT_TR_NOOP("setLineSpacing(size, [\"name\"])\n\\n\Sets the line spacing (\"leading\") of the text frame \"name\" to \"size\".\n\\"size\" is a value in points. If \"name\" is not given the currently selected\n\item is used.\n\\n\May throw ValueError if the line spacing is out of bounds.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setcolumngap__doc__  ,
QT_TR_NOOP("setColumnGap(size, [\"name\"])\n\\n\Sets the column gap of the text frame \"name\" to the value \"size\". If\n\\"name\" is not given the currently selected item is used.\n\\n\May throw ValueError if the column gap is out of bounds (must be positive).\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setcolumns__doc__  ,
QT_TR_NOOP("setColumns(nr, [\"name\"])\n\\n\Sets the number of columns of the text frame \"name\" to the integer \"nr\".\n\If \"name\" is not given the currently selected item is used.\n\\n\May throw ValueError if number of columns is not at least one.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_setalign__doc__  ,
QT_TR_NOOP("setTextAlignment(align, [\"name\"])\n\\n\Sets the text alignment of the text frame \"name\" to the specified alignment.\n\If \"name\" is not given the currently selected item is used. \"align\" should\n\be one of the ALIGN_ constants defined in this module - see dir(scribus).\n\\n\May throw ValueError for an invalid alignment constant.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_selecttext__doc__  ,
QT_TR_NOOP("selectText(start, count, [\"name\"])\n\\n\Selects \"count\" characters of text in the text frame \"name\" starting from the\n\character \"start\". Character counting starts at 0. If \"count\" is zero, any\n\text selection will be cleared. If \"name\" is not given the currently\n\selected item is used.\n\\n\May throw IndexError if the selection is outside the bounds of the text.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_deletetext__doc__  ,
QT_TR_NOOP("deleteText([\"name\"])\n\\n\Deletes any text in the text frame \"name\". If there is some text selected,\n\only the selected text will be deleted. If \"name\" is not given the currently\n\selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_settextfill__doc__  ,
QT_TR_NOOP("setTextColor(\"color\", [\"name\"])\n\\n\Sets the text color of the text frame \"name\" to the color \"color\". If there\n\is some text selected only the selected text is changed. If \"name\" is not\n\given the currently selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_settextstroke__doc__  ,
QT_TR_NOOP("setTextStroke(\"color\", [\"name\"])\n\\n\Set \"color\" of the text stroke. If \"name\" is not given the currently\n\selected item is used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_settextshade__doc__  ,
QT_TR_NOOP("setTextShade(shade, [\"name\"])\n\\n\Sets the shading of the text color of the object \"name\" to \"shade\". If\n\there is some text selected only the selected text is changed. \"shade\" must\n\be an integer value in the range from 0 (lightest) to 100 (full color\n\intensity). If \"name\" is not given the currently selected item is\n\used.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_linktextframes__doc__  ,
QT_TR_NOOP("linkTextFrames(\"fromname\", \"toname\")\n\\n\Link two text frames. The frame named \"fromname\" is linked to the\n\frame named \"toname\". The target frame must be an empty text frame\n\and must not link to or be linked from any other frames already.\n\\n\May throw ScribusException if linking rules are violated.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_unlinktextframes__doc__  ,
QT_TR_NOOP("unlinkTextFrames(\"name\")\n\\n\Remove the specified (named) object from the text frame flow/linkage. If the\n\frame was in the middle of a chain, the previous and next frames will be\n\connected, eg 'a->b->c' becomes 'a->c' when you unlinkTextFrames(b)'\n\\n\May throw ScribusException if linking rules are violated.\n\")   
)

docstring

PyDoc_STRVAR ( scribus_tracetext__doc__  ,
QT_TR_NOOP("traceText([\"name\"])\n\\n\Convert the text frame \"name\" to outlines. If \"name\" is not given the\n\currently selected item is used.")   
)

docstring

PyDoc_STRVAR ( scribus_istextoverflowing__doc__  ,
QT_TR_NOOP("textOverflows([\"name\", nolinks]) -> integer\n\\n\Returns the actual number of overflowing characters in text frame \"name\".\n\If is nolinks set to non zero value it takes only one frame - it doesn't\n\use text frame linking. Without this parameter it search all linking chain.\n\\n\May raise WrongFrameTypeError if the target frame is not an text frame\n")   
)
PyDoc_STRVAR ( scribus_setpdfbookmark__doc__  ,
QT_TR_NOOP("setPDFBookmark(\"toggle\", [\"name\"])\n\\n\Sets wether (toggle = 1) the text frame \"name\" is a bookmark nor not.\n\If \"name\" is not given the currently selected item is used.\n\\n\May raise WrongFrameTypeError if the target frame is not a text frame\n\")   
)

docstring

PyDoc_STRVAR ( scribus_ispdfbookmark__doc__  ,
QT_TR_NOOP("isPDFBookmark([\"name\"]) -> bool\n\\n\Returns true if the text frame \"name\" is a PDF bookmark.\n\If \"name\" is not given the currently selected item is used.\n\\n\May raise WrongFrameTypeError if the target frame is not a text frame\n\")   
)

docstring

PyObject* scribus_deletetext ( PyObject *  ,
PyObject *  args 
)

Delete text.

Definition at line 530 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot delete text from a non-text frame.","python error"));
              return NULL;
       }
       if (it->HasSel)
              dynamic_cast<PageItem_TextFrame*>(it)->deleteSelectedTextFromFrame();
       else
       {
              it->itemText.clear();
              it->CPos = 0;
              for (uint a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
              {
                     ScCore->primaryMainWindow()->doc->FrameItems.at(a)->ItemNr = a;
              }
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_getcolumngap ( PyObject *  ,
PyObject *  args 
)

Get column gap.

Definition at line 139 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column gap of non-text frame.","python error"));
              return NULL;
       }
       return PyFloat_FromDouble(PointToValue(static_cast<double>(i->ColGap)));
}

Here is the call graph for this function:

PyObject* scribus_getcolumns ( PyObject *  ,
PyObject *  args 
)

Get columns.

Definition at line 103 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column count of non-text frame.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i->Cols));
}

Here is the call graph for this function:

PyObject* scribus_getfont ( PyObject *  ,
PyObject *  args 
)

Get font.

Definition at line 41 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font of non-text frame.","python error"));
              return NULL;
       }
       if (it->HasSel)
       {
              for (int b = 0; b < it->itemText.length(); b++)
                     if (it->itemText.selected(b))
                            return PyString_FromString(it->itemText.charStyle(b).font().scName().utf8());
              return NULL;
       }
       else
              return PyString_FromString(it->currentCharStyle().font().scName().utf8());
}

Here is the call graph for this function:

PyObject* scribus_getfontsize ( PyObject *  ,
PyObject *  args 
)

Get font size.

Definition at line 15 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font size of non-text frame.","python error"));
              return NULL;
       }
       if (it->HasSel)
       {
              for (int b = 0; b < it->itemText.length(); b++)
                     if (it->itemText.selected(b))
                            return PyFloat_FromDouble(static_cast<double>(it->itemText.charStyle(b).fontSize() / 10.0));
              return NULL;
       }
       else
              return PyFloat_FromDouble(static_cast<long>(it->currentCharStyle().fontSize() / 10.0));
}

Here is the call graph for this function:

PyObject* scribus_getframetext ( PyObject *  ,
PyObject *  args 
)

Get frame text.

Definition at line 157 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       QString text = "";
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
              return NULL;
       }
       for (int a = it->firstInFrame(); a < it->lastInFrame(); a++)
       {
              if (it->HasSel)
              {
                     if (it->itemText.selected(a))
                            text += it->itemText.text(a);
              }
              else
              {
                     text += it->itemText.text(a);
              }
       }
       return PyString_FromString(text.utf8());
}

Here is the call graph for this function:

PyObject* scribus_getlinespace ( PyObject *  ,
PyObject *  args 
)

Get line space.

Definition at line 121 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get line space of non-text frame.","python error"));
              return NULL;
       }
       return PyFloat_FromDouble(static_cast<double>(i->currentStyle().lineSpacing()));
}

Here is the call graph for this function:

PyObject* scribus_gettext ( PyObject *  ,
PyObject *  args 
)

Get all text.

Definition at line 188 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       QString text = "";
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
              return NULL;
       }

       // collect all chars from a storytext
       for (int a = 0; a < it->itemText.length(); a++)
       {
              if (it->HasSel)
              {
                     if (it->itemText.selected(a))
                            text += it->itemText.text(a);
              }
              else
              {
                     text += it->itemText.text(a);
              }
       } // for
       return PyString_FromString(text.utf8());
}

Here is the call graph for this function:

PyObject* scribus_gettextlines ( PyObject *  ,
PyObject *  args 
)

Get text lines.

Definition at line 85 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!(i->asTextFrame()) && !(i->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get number of lines of non-text frame.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i->itemText.lines()));
}

Here is the call graph for this function:

PyObject* scribus_gettextsize ( PyObject *  ,
PyObject *  args 
)

Get text size.

Definition at line 67 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!(i->asTextFrame()) && !(i->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text size of non-text frame.","python error"));
              return NULL;
       }
       return PyInt_FromLong(static_cast<long>(i->itemText.length()));
}

Here is the call graph for this function:

PyObject* scribus_inserttext ( PyObject *  ,
PyObject *  args 
)

Insert text.

Definition at line 252 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       char *Text;
       int pos;
       if (!PyArg_ParseTuple(args, "esi|es", "utf-8", &Text, &pos, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot insert text into non-text frame.","python error"));
              return NULL;
       }
       QString Daten = QString::fromUtf8(Text);
       PyMem_Free(Text);
       if ((pos < -1) || (pos > static_cast<int>(it->itemText.length())))
       {
              PyErr_SetString(PyExc_IndexError, QObject::tr("Insert index out of bounds.","python error"));
              return NULL;
       }
       if (pos == -1)
              pos = it->itemText.length();
       it->itemText.insertChars(pos, Daten);
       it->CPos = pos + Daten.length();
       it->Dirty = true;
       if (ScCore->primaryMainWindow()->doc->DoDrawing)
       {
              it->paintObj();
              it->Dirty = false;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_ispdfbookmark ( PyObject *  ,
PyObject *  args 
)

Is PDF bookmark?

Definition at line 882 of file cmdtext.cpp.

{
       char *name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
              return NULL;
       if (!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(name));
       if (i == NULL)
              return NULL;
       if (i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't get info from a non-text frame", "python error"));
              return NULL;
       }
       if (i->isBookmark)
              return PyBool_FromLong(1);
       return PyBool_FromLong(0);
}

Here is the call graph for this function:

PyObject* scribus_istextoverflowing ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)

Check if is the text frame overflowind or not 2005-02-04 petr vanek.

Definition at line 803 of file cmdtext.cpp.

{
       char *name = const_cast<char*>("");
       bool nolinks = false;
       char *kwargs[] = {const_cast<char*>("name"), const_cast<char*>("nolinks"), NULL};
       if (!PyArg_ParseTupleAndKeywords(args, kw, "|esi", kwargs, "utf-8", &name, &nolinks))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(name));
       if (item == NULL)
              return NULL;
       if (!item->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Only text frames can be checked for overflowing", "python error"));
              return NULL;
       }
       /* original solution
       if (item->itemText.count() > item->MaxChars)
       return PyBool_FromLong(static_cast<long>(true));
       return PyBool_FromLong(static_cast<long>(false)); */
       /*
        uint firstFrame = 0;
       if (nolinks)
              firstFrame = item->itemText.count();
       uint chars = item->itemText.count();
       uint maxchars = item->MaxChars;
       while (item->NextBox != 0) {
              item = item->NextBox;
              chars += item->itemText.count();
              maxchars += item->MaxChars;
       }
       // no overrun
       if (nolinks)
              return PyInt_FromLong(maxchars - firstFrame);

       if (maxchars > chars)
              return PyInt_FromLong(0);
       // number of overrunning letters
       return PyInt_FromLong(static_cast<long>(chars - maxchars));
        */
       return PyInt_FromLong(static_cast<long>(item->frameOverflows()));
}

Here is the call graph for this function:

PyObject* scribus_linktextframes ( PyObject *  ,
PyObject *  args 
)

Link text frames via Scripter.

02/22/04 (petr vanek) TODO: PDF bookmarks handling

Definition at line 675 of file cmdtext.cpp.

{
       char *name1;
       char *name2;

       if (!PyArg_ParseTuple(args, "eses", "utf-8", &name1, "utf-8", &name2))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *fromitem = GetUniqueItem(QString::fromUtf8(name1));
       if (fromitem == NULL)
              return NULL;
       PageItem *toitem = GetUniqueItem(QString::fromUtf8(name2));
       if (toitem == NULL)
              return NULL;
       if (!(fromitem->asTextFrame()) || !(toitem->asTextFrame()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames.","python error"));
              return NULL;
       }
/*     if (toitem->itemText.length() > 0)
       {
              PyErr_SetString(ScribusException, QObject::tr("Target frame must be empty.","python error"));
              return NULL;
       }*/
       if (toitem->nextInChain() != 0)
       {
              PyErr_SetString(ScribusException, QObject::tr("Target frame links to another frame.","python error"));
              return NULL;
       }
       if (toitem->prevInChain() != 0)
       {
              PyErr_SetString(ScribusException, QObject::tr("Target frame is linked to by another frame.","python error"));
              return NULL;
       }
       if (toitem == fromitem)
       {
              PyErr_SetString(ScribusException, QObject::tr("Source and target are the same object.","python error"));
              return NULL;
       }
       // references to the others boxes
       fromitem->link(toitem);
       ScCore->primaryMainWindow()->view->DrawNew();
       // enable 'save icon' stuff
       ScCore->primaryMainWindow()->slotDocCh();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_selecttext ( PyObject *  ,
PyObject *  args 
)

Select text.

Definition at line 478 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       int start, selcount;
       if (!PyArg_ParseTuple(args, "ii|es", &start, &selcount, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (selcount == -1)
       {
              // user wants to select all after the start point -- CR
              selcount = it->itemText.length() - start;
              if (selcount < 0)
                     // user passed start that's > text in the frame
                     selcount = 0;
       }
       // cr 2005-01-18 fixed off-by-one with end bound that made selecting the last char impossible
       if ((start < 0) || ((start + selcount) > static_cast<int>(it->itemText.length())))
       {
              PyErr_SetString(PyExc_IndexError, QObject::tr("Selection index out of bounds", "python error"));
              return NULL;
       }
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot select text in a non-text frame", "python error"));
              return NULL;
       }
       /* FIXME: not sure if we should make this check or not
       if (start > ende)
       {
              PyErr_SetString(PyExc_ValueError, QString("Selection start > selection end"));
              return NULL;
       }
       */
       it->itemText.deselectAll();
       if (selcount == 0)
       {
              it->HasSel = false;
//            Py_INCREF(Py_None);
//            return Py_None;
              Py_RETURN_NONE;
       }
       it->itemText.select(start, selcount, true);
       it->HasSel = true;
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setalign ( PyObject *  ,
PyObject *  args 
)

Set alignt.

Definition at line 291 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       int alignment;
       if (!PyArg_ParseTuple(args, "i|es", &alignment, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if ((alignment > 4) || (alignment < 0))
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Alignment out of range. Use one of the scribus.ALIGN* constants.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text alignment on a non-text frame.","python error"));
              return NULL;
       }
       int Apm = ScCore->primaryMainWindow()->doc->appMode;
       ScCore->primaryMainWindow()->doc->m_Selection->clear();
       ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
       if (i->HasSel)
              ScCore->primaryMainWindow()->doc->appMode = modeEdit;
       ScCore->primaryMainWindow()->setNewAlignment(alignment);
       ScCore->primaryMainWindow()->doc->appMode = Apm;
       ScCore->primaryMainWindow()->view->Deselect();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setboxtext ( PyObject *  ,
PyObject *  args 
)

Set text.

Definition at line 221 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       char *Text;
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Text, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
       if (currItem == NULL)
              return NULL;
       if (!(currItem->asTextFrame()) && !(currItem->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text of non-text frame.","python error"));
              return NULL;
       }
       QString Daten = QString::fromUtf8(Text);
       PyMem_Free(Text);
       currItem->itemText.clear();
       currItem->CPos = 0;
       for (uint a = 0; a < ScCore->primaryMainWindow()->doc->FrameItems.count(); ++a)
       {
              ScCore->primaryMainWindow()->doc->FrameItems.at(a)->ItemNr = a;
       }
       currItem->itemText.insertChars(0, Daten);
       currItem->Dirty = false;
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setcolumngap ( PyObject *  ,
PyObject *  args 
)

Set column gap.

Definition at line 424 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       double w;
       if (!PyArg_ParseTuple(args, "d|es", &w, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (w < 0.0)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Column gap out of bounds, must be positive.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set column gap on a non-text frame.","python error"));
              return NULL;
       }
       i->ColGap = ValueToPoint(w);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setcolumns ( PyObject *  ,
PyObject *  args 
)

Set columns.

Definition at line 451 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       int w;
       if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (w < 1)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Column count out of bounds, must be > 1.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set number of columns on a non-text frame.","python error"));
              return NULL;
       }
       i->Cols = w;
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setfont ( PyObject *  ,
PyObject *  args 
)

Set font.

Definition at line 360 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       char *Font = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Font, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!(i->asTextFrame()) && !(i->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set font on a non-text frame.","python error"));
              return NULL;
       }
       if (PrefsManager::instance()->appPrefs.AvailFonts.contains(QString::fromUtf8(Font)))
       {
              int Apm = ScCore->primaryMainWindow()->doc->appMode;
              ScCore->primaryMainWindow()->doc->m_Selection->clear();
              ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
              if (i->HasSel)
                     ScCore->primaryMainWindow()->doc->appMode = modeEdit;
              ScCore->primaryMainWindow()->SetNewFont(QString::fromUtf8(Font));
              ScCore->primaryMainWindow()->doc->appMode = Apm;
              ScCore->primaryMainWindow()->view->Deselect();
       }
       else
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Font not found.","python error"));
              return NULL;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setfontsize ( PyObject *  ,
PyObject *  args 
)

Set font size.

Definition at line 325 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       double size;
       if (!PyArg_ParseTuple(args, "d|es", &size, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if ((size > 512) || (size < 1))
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Font size out of bounds - must be 1 <= size <= 512.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;

       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set font size on a non-text frame.","python error"));
              return NULL;
       }
       int Apm = ScCore->primaryMainWindow()->doc->appMode;
       ScCore->primaryMainWindow()->doc->m_Selection->clear();
       ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
       if (i->HasSel)
              ScCore->primaryMainWindow()->doc->appMode = modeEdit;
       ScCore->primaryMainWindow()->doc->itemSelection_SetFontSize(qRound(size * 10.0));
       ScCore->primaryMainWindow()->doc->appMode = Apm;
       ScCore->primaryMainWindow()->view->Deselect();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setlinespace ( PyObject *  ,
PyObject *  args 
)

Set line space.

Definition at line 397 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       double w;
       if (!PyArg_ParseTuple(args, "d|es", &w, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if (w < 0.1)
       {
              PyErr_SetString(PyExc_ValueError, QObject::tr("Line space out of bounds, must be >= 0.1.","python error"));
              return NULL;
       }
       PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set line spacing on a non-text frame.","python error"));
              return NULL;
       }
//     i->setLineSpacing(w);
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_setpdfbookmark ( PyObject *  ,
PyObject *  args 
)

Set PDF bookmark.

Definition at line 847 of file cmdtext.cpp.

{
       char *name = const_cast<char*>("");
       bool toggle;
       if (!PyArg_ParseTuple(args, "b|es", &toggle, "utf-8", &name))
              return NULL;
       if (!checkHaveDocument())
              return NULL;
       PageItem *i = GetUniqueItem(QString::fromUtf8(name));
       if (i == NULL)
              return NULL;
       if (!i->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set bookmark on a non-text frame", "python error"));
              return NULL;
       }
       if (i->isBookmark == toggle)
       {
//            Py_INCREF(Py_None);
//            return Py_None;
              Py_RETURN_NONE;
       }
       if (toggle)
       {
              i->setIsAnnotation(false);
              ScCore->primaryMainWindow()->AddBookMark(i);
       }
       else
              ScCore->primaryMainWindow()->DelBookMark(i);
       i->isBookmark = toggle;
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_settextfill ( PyObject *  ,
PyObject *  args 
)

Set text fill.

Definition at line 561 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       char *Color;
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Color, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text fill on a non-text frame.","python error"));
              return NULL;
       }
       else
       {
              for (int b = 0; b < it->itemText.length(); b++)
              {
                     //FIXME: doc method
                     if (it->HasSel)
                     {
                            if (it->itemText.selected(b))
                                   it->itemText.item(b)->setFillColor(QString::fromUtf8(Color));
                     }
                     else
                            it->itemText.item(b)->setFillColor(QString::fromUtf8(Color));
              }
//            it->TxtFill = QString::fromUtf8(Color);
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_settextshade ( PyObject *  ,
PyObject *  args 
)

Set text shde.

Definition at line 633 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       int w;
       if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       if ((w < 0) || (w > 100))
       {
//            Py_INCREF(Py_None);
//            return Py_None;
              Py_RETURN_NONE;
       }
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && !(it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text shade on a non-text frame.","python error"));
              return NULL;
       }
       else
       {
              //FIXME:NLS use document method for that
              for (int b = 0; b < it->itemText.length(); ++b)
              {
                     if (it->HasSel)
                     {
                            if (it->itemText.selected(b))
                                   it->itemText.item(b)->setFillShade(w);
                     }
                     else
                            it->itemText.item(b)->setFillShade(w);
              }
//     it->ShTxtFill = w;
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_settextstroke ( PyObject *  ,
PyObject *  args 
)

Set text stroke.

Definition at line 597 of file cmdtext.cpp.

{
       char *Name = const_cast<char*>("");
       char *Color;
       if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Color, "utf-8", &Name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
       if (it == NULL)
              return NULL;
       if (!(it->asTextFrame()) && (it->asPathText()))
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text stroke on a non-text frame.","python error"));
              return NULL;
       }
       else
       {
              for (int b = 0; b < it->itemText.length(); b++)
              {
                     //FIXME:NLS use document method for this
                     if (it->HasSel)
                     {
                            if (it->itemText.selected(b))
                                   it->itemText.item(b)->setStrokeColor(QString::fromUtf8(Color));
                     }
                     else
                            it->itemText.item(b)->setStrokeColor(QString::fromUtf8(Color));
              }
//            it->TxtStroke = QString::fromUtf8(Color);
       }
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_tracetext ( PyObject *  self,
PyObject *  args 
)

Trace text frames via Scripter.

2004-09-07 (Craig Ringer)

Definition at line 780 of file cmdtext.cpp.

{
       char *name = const_cast<char*>("");
       if (!PyArg_ParseTuple(args, "|es", "utf-8", &name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(name));
       if (item == NULL)
              return NULL;
       if (!item->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot convert a non-text frame to outlines.","python error"));
              return NULL;
       }
       ScCore->primaryMainWindow()->view->Deselect(true);
       ScCore->primaryMainWindow()->view->SelectItemNr(item->ItemNr);
       ScCore->primaryMainWindow()->view->TextToPath();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function:

PyObject* scribus_unlinktextframes ( PyObject *  self,
PyObject *  args 
)

(Un)Link text frames via Scripter.

02/22/04 (petr vanek) TODO: PDF bookmarks handling

Definition at line 725 of file cmdtext.cpp.

{
       char *name;
       if (!PyArg_ParseTuple(args, "es", "utf-8", &name))
              return NULL;
       if(!checkHaveDocument())
              return NULL;
       PageItem *item = GetUniqueItem(QString::fromUtf8(name));
       if (item == NULL)
              return NULL;
       if (!item->asTextFrame())
       {
              PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot unlink a non-text frame.","python error"));
              return NULL;
       }
       // only linked
       if (item->prevInChain() == 0)
       {
              PyErr_SetString(ScribusException, QObject::tr("Object is not a linked text frame, can't unlink.","python error"));
              return NULL;
       }
/*     if (item->NextBox == 0)
       {
              PyErr_SetString(ScribusException, QObject::tr("Object the last frame in a series, can't unlink. Unlink the previous frame instead.","python error"));
              return NULL;
       }
       */
/*     PageItem* nextbox = item->NextBox;

       while (nextbox != 0)
       {
              uint a = nextbox->itemText.count();
              for (uint s=0; s<a; ++s)
                     item->itemText.append(nextbox->itemText.take(0));
              nextbox = nextbox->NextBox;
       } // while
       uint a2 = item->itemText.count();
       for (uint s = 0; s < a2; ++s)
              item->BackBox->itemText.append(item->itemText.take(0));
*/
       item->prevInChain()->unlink();
       // enable 'save icon' stuff
       ScCore->primaryMainWindow()->slotDocCh();
       ScCore->primaryMainWindow()->view->DrawNew();
//     Py_INCREF(Py_None);
//     return Py_None;
       Py_RETURN_NONE;
}

Here is the call graph for this function: