/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef CMDPAGE_H
#define CMDPAGE_H

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

/** Page related Commands */

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

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

 /*! docstring */
 PyDoc_STRVAR(scribus_currentpagenumberforsection__doc__,
 QT_TR_NOOP("currentPage() -> integer\n\
 \n\
 Returns the number of the current working page based on the section of the document.\n\
\n\
 "));
 /*! get actual page */
 PyObject *scribus_currentpagenumberforsection(PyObject * /*self*/);

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

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

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

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

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

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

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

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

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

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

/*! docstring */
PyDoc_STRVAR(scribus_getColumnGuides__doc__,
QT_TR_NOOP("getColumnGuides()\n\
\n\
Return the column guides for the current page.\n\
\n\
The return a dictionary containing:\n\
{'number': int, 'gap': int, 'reference': 0|1|2, guides: [real]}\n\
"));
/*! get column guides */
PyObject *scribus_getColumnGuides(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_getRowGuides__doc__,
QT_TR_NOOP("getRowGuides()\n\
\n\
Return the row guides for the current page.\n\
\n\
The return a dictionary containing:\n\
{'number': int, 'gap': int, 'reference': 0|1|2, guides: [real]}\n\
"));
/*! get row guides */
PyObject *scribus_getRowGuides(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_setColumnGuides__doc__,
QT_TR_NOOP("setColumnGuides(number, gap=0.0, refer_to=0)\n\
\n\
Set the column guides for the current page.\n\
\n\
number is the number of guides to be defined (if 0, all values get reset to their default)\n\
\n\
refer_to can have the values 0 (page), 1 (margin), 2 (selection)\n\
"));
/*! set column guides */
PyObject *scribus_setColumnGuides(PyObject * /*self*/, PyObject* args, PyObject* kw);

/*! docstring */
PyDoc_STRVAR(scribus_setRowGuides__doc__,
QT_TR_NOOP("setRowGuides(number, gap=0.0, refer_to=0)\n\
\n\
Set the row guides for the current page.\n\
\n\
number is the number of guides to be defined (if 0, all values get reset to their default)\n\
\n\
refer_to can have the values 0 (page), 1 (margin), 2 (selection)\n\
"));
/*! set row guides */
PyObject *scribus_setRowGuides(PyObject * /*self*/, PyObject* args, PyObject* kw);

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

/*! docstring */
PyDoc_STRVAR(scribus_getcurrentpagesize__doc__,
QT_TR_NOOP("getCurrentPageSize() ->  (width, height)\n\
\n\
Returns a tuple with current page dimensions measured in the document's current units.\n\
See UNIT_<type> constants and getPageMargins()\n\
"));
PyObject *scribus_getcurrentpagesize(PyObject * /*self*/);


/*! docstring */
PyDoc_STRVAR(scribus_setcurrentpagesize__doc__,
QT_TR_NOOP("setCurrentPageSize(width, height)\n\
\n\
Sets the current page dimensions measured in the document's current units.\n\
See UNIT_<type> constants and getPageMargins()\n\
"));
PyObject *scribus_setcurrentpagesize(PyObject * /*self*/, PyObject* args);

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

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

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

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

/*! importpage */
PyDoc_STRVAR(scribus_importpage__doc__,
QT_TR_NOOP("importPage(\"fromDoc\", (pageList), [create, imortwhere, importwherePage])\n\
\n\
Imports a set of pages (given as a tuple) from an existing document (the file name must be given). This function maps the \"Page->Import\" dropdown menu function.\n\
fromDoc: string; the filename of the document to import pages from\n\
pageList: tuple; page numbers of pages to import\n\
create: number; 0 to replace existing pages, 1 (default) to insert new pages\n\
importWhere: number; used if create==1; 0 to create pages before importWherePage, 1 to create pages after importWherePage, 2 (default) to create pages at the end of the document\n\
importWherePage: number; used if create==1 and importWhere==0|1; zero-based page number (of the current document) before or after which to import the pages\n\
"));
PyObject *scribus_importpage(PyObject */*self*/, PyObject* args);


#endif

