Back to index

scribus-ng  1.3.4.dfsg+svn20071115
cmddoc.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 CMDDOC_H
00008 #define CMDDOC_H
00009 
00010 // Pulls in <Python.h> first
00011 #include "cmdvar.h"
00012 
00015 PyDoc_STRVAR(scribus_newdocument__doc__,
00016 QT_TR_NOOP("newDocument(size, margins, orientation, firstPageNumber,\n\
00017                         unit, pagesType, firstPageOrder, numPages) -> bool\n\
00018 \n\
00019 Creates a new document and returns true if successful. The parameters have the\n\
00020 following meaning:\n\
00021 \n\
00022 size = A tuple (width, height) describing the size of the document. You can\n\
00023 use predefined constants named PAPER_<paper_type> e.g. PAPER_A4 etc.\n\
00024 \n\
00025 margins = A tuple (left, right, top, bottom) describing the document\n\
00026 margins\n\
00027 \n\
00028 orientation = the page orientation - constants PORTRAIT, LANDSCAPE\n\
00029 \n\
00030 firstPageNumer = is the number of the first page in the document used for\n\
00031 pagenumbering. While you'll usually want 1, it's useful to have higher\n\
00032 numbers if you're creating a document in several parts.\n\
00033 \n\
00034 unit: this value sets the measurement units used by the document. Use a\n\
00035 predefined constant for this, one of: UNIT_INCHES, UNIT_MILLIMETERS,\n\
00036 UNIT_PICAS, UNIT_POINTS.\n\
00037 \n\
00038 pagesType = One of the predefined constants PAGE_n. PAGE_1 is single page,\n\
00039 PAGE_2 is for double sided documents, PAGE_3 is for 3 pages fold and\n\
00040 PAGE_4 is 4-fold.\n\
00041 \n\
00042 firstPageOrder = What is position of first page in the document.\n\
00043 Indexed from 0 (0 = first).\n\
00044 \n\
00045 numPage = Number of pages to be created.\n\
00046 \n\
00047 The values for width, height and the margins are expressed in the given unit\n\
00048 for the document. PAPER_* constants are expressed in points. If your document\n\
00049 is not in points, make sure to account for this.\n\
00050 \n\
00051 example: newDocument(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 7, UNIT_POINTS,\n\
00052 PAGE_4, 3, 1)\n\
00053 \n\
00054 May raise ScribusError if is firstPageOrder bigger than allowed by pagesType.\n\
00055 "));
00058 PyObject *scribus_newdocument(PyObject */*self*/, PyObject* args);
00059 
00061 PyDoc_STRVAR(scribus_newdoc__doc__,
00062 QT_TR_NOOP("newDoc(size, margins, orientation, firstPageNumber,\n\
00063                    unit, facingPages, firstSideLeft) -> bool\n\
00064 \n\
00065 WARNING: Obsolete procedure! Use newDocument instead.\n\
00066 \n\
00067 Creates a new document and returns true if successful. The parameters have the\n\
00068 following meaning:\n\
00069 \n\
00070     size = A tuple (width, height) describing the size of the document. You can\n\
00071     use predefined constants named PAPER_<paper_type> e.g. PAPER_A4 etc.\n\
00072 \n\
00073     margins = A tuple (left, right, top, bottom) describing the document\n\
00074     margins\n\
00075 \n\
00076     orientation = the page orientation - constants PORTRAIT, LANDSCAPE\n\
00077 \n\
00078     firstPageNumer = is the number of the first page in the document used for\n\
00079     pagenumbering. While you'll usually want 1, it's useful to have higher\n\
00080     numbers if you're creating a document in several parts.\n\
00081 \n\
00082     unit: this value sets the measurement units used by the document. Use a\n\
00083     predefined constant for this, one of: UNIT_INCHES, UNIT_MILLIMETERS,\n\
00084     UNIT_PICAS, UNIT_POINTS.\n\
00085 \n\
00086     facingPages = FACINGPAGES, NOFACINGPAGES\n\
00087 \n\
00088     firstSideLeft = FIRSTPAGELEFT, FIRSTPAGERIGHT\n\
00089 \n\
00090 The values for width, height and the margins are expressed in the given unit\n\
00091 for the document. PAPER_* constants are expressed in points. If your document\n\
00092 is not in points, make sure to account for this.\n\
00093 \n\
00094 example: newDoc(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 1, UNIT_POINTS,\n\
00095                 FACINGPAGES, FIRSTPAGERIGHT)\n\
00096 "));
00099 PyObject *scribus_newdoc(PyObject */*self*/, PyObject* args);
00100 
00102 PyDoc_STRVAR(scribus_closedoc__doc__,
00103 QT_TR_NOOP("closeDoc()\n\
00104 \n\
00105 Closes the current document without prompting to save.\n\
00106 \n\
00107 May throw NoDocOpenError if there is no document to close\n\
00108 "));
00110 PyObject *scribus_closedoc(PyObject */*self*/);
00111 
00113 PyDoc_STRVAR(scribus_havedoc__doc__,
00114 QT_TR_NOOP("haveDoc() -> bool\n\
00115 \n\
00116 Returns true if there is a document open.\n\
00117 "));
00119 PyObject *scribus_havedoc(PyObject */*self*/);
00120 
00122 PyDoc_STRVAR(scribus_opendoc__doc__,
00123 QT_TR_NOOP("openDoc(\"name\")\n\
00124 \n\
00125 Opens the document \"name\".\n\
00126 \n\
00127 May raise ScribusError if the document could not be opened.\n\
00128 "));
00130 PyObject *scribus_opendoc(PyObject */*self*/, PyObject* args);
00131 
00133 PyDoc_STRVAR(scribus_savedoc__doc__,
00134 QT_TR_NOOP("saveDoc()\n\
00135 \n\
00136 Saves the current document with its current name, returns true if successful.\n\
00137 If the document has not already been saved, this may bring up an interactive\n\
00138 save file dialog.\n\
00139 \n\
00140 If the save fails, there is currently no way to tell.\n\
00141 "));
00142 PyObject *scribus_savedoc(PyObject */*self*/);
00143 
00145 PyDoc_STRVAR(scribus_savedocas__doc__,
00146 QT_TR_NOOP("saveDocAs(\"name\")\n\
00147 \n\
00148 Saves the current document under the new name \"name\" (which may be a full or\n\
00149 relative path).\n\
00150 \n\
00151 May raise ScribusError if the save fails.\n\
00152 "));
00154 PyObject *scribus_savedocas(PyObject */*self*/, PyObject* args);
00155 
00157 PyDoc_STRVAR(scribus_setinfo__doc__,
00158 QT_TR_NOOP("setInfo(\"author\", \"info\", \"description\") -> bool\n\
00159 \n\
00160 Sets the document information. \"Author\", \"Info\", \"Description\" are\n\
00161 strings.\n\
00162 "));
00164 PyObject *scribus_setinfo(PyObject */*self*/, PyObject* args);
00165 
00167 PyDoc_STRVAR(scribus_setmargins__doc__,
00168 QT_TR_NOOP("setMargins(lr, rr, tr, br)\n\
00169 \n\
00170 Sets the margins of the document, Left(lr), Right(rr), Top(tr) and Bottom(br)\n\
00171 margins are given in the measurement units of the document - see UNIT_<type>\n\
00172 constants.\n\
00173 "));
00175 PyObject *scribus_setmargins(PyObject */*self*/, PyObject* args);
00176 
00178 PyDoc_STRVAR(scribus_setunit__doc__,
00179 QT_TR_NOOP("setUnit(type)\n\
00180 \n\
00181 Changes the measurement unit of the document. Possible values for \"unit\" are\n\
00182 defined as constants UNIT_<type>.\n\
00183 \n\
00184 May raise ValueError if an invalid unit is passed.\n\
00185 "));
00187 PyObject *scribus_setunit(PyObject */*self*/, PyObject* args);
00188 
00190 PyDoc_STRVAR(scribus_getunit__doc__,
00191 QT_TR_NOOP("getUnit() -> integer (Scribus unit constant)\n\
00192 \n\
00193 Returns the measurement units of the document. The returned value will be one\n\
00194 of the UNIT_* constants:\n\
00195 UNIT_INCHES, UNIT_MILLIMETERS, UNIT_PICAS, UNIT_POINTS.\n\
00196 "));
00198 PyObject *scribus_getunit(PyObject */*self*/);
00199 
00201 PyDoc_STRVAR(scribus_loadstylesfromfile__doc__,
00202 QT_TR_NOOP("loadStylesFromFile(\"filename\")\n\
00203 \n\
00204 Loads paragraph styles from the Scribus document at \"filename\" into the\n\
00205 current document.\n\
00206 "));
00208 PyObject *scribus_loadstylesfromfile(PyObject */*self*/, PyObject *args);
00209 
00211 PyDoc_STRVAR(scribus_setdoctype__doc__,
00212 QT_TR_NOOP("setDocType(facingPages, firstPageLeft)\n\
00213 \n\
00214 Sets the document type. To get facing pages set the first parameter to\n\
00215 FACINGPAGES, to switch facingPages off use NOFACINGPAGES instead.  If you want\n\
00216 to be the first page a left side set the second parameter to FIRSTPAGELEFT, for\n\
00217 a right page use FIRSTPAGERIGHT.\n\
00218 "));
00219 PyObject *scribus_setdoctype(PyObject */*self*/, PyObject* args);
00220 
00221 PyDoc_STRVAR(scribus_closemasterpage__doc__,
00222 QT_TR_NOOP("closeMasterPage()\n\
00223 \n\
00224 Closes the currently active master page, if any, and returns editing\n\
00225 to normal. Begin editing with editMasterPage().\n\
00226 "));
00227 PyObject* scribus_closemasterpage(PyObject* self);
00228 
00229 PyDoc_STRVAR(scribus_masterpagenames__doc__,
00230 QT_TR_NOOP("masterPageNames()\n\
00231 \n\
00232 Returns a list of the names of all master pages in the document.\n\
00233 "));
00234 PyObject* scribus_masterpagenames(PyObject* self);
00235 
00236 PyDoc_STRVAR(scribus_editmasterpage__doc__,
00237 QT_TR_NOOP("editMasterPage(pageName)\n\
00238 \n\
00239 Enables master page editing and opens the named master page\n\
00240 for editing. Finish editing with closeMasterPage().\n\
00241 "));
00242 PyObject* scribus_editmasterpage(PyObject* self, PyObject* args);
00243 
00244 PyDoc_STRVAR(scribus_createmasterpage__doc__,
00245 QT_TR_NOOP("createMasterPage(pageName)\n\
00246 \n\
00247 Creates a new master page named pageName and opens it for\n\
00248 editing.\n\
00249 "));
00250 PyObject* scribus_createmasterpage(PyObject* self, PyObject* args);
00251 
00252 PyDoc_STRVAR(scribus_deletemasterpage__doc__,
00253 QT_TR_NOOP("deleteMasterPage(pageName)\n\
00254 \n\
00255 Delete the named master page.\n\
00256 "));
00257 PyObject* scribus_deletemasterpage(PyObject* self, PyObject* args);
00258 
00259 #endif
00260