summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/scriptplugin/cmdutil.h
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
commit7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch)
tree4430b556abac0ad660a0aacf1887d77f85d8be02 /scribus/plugins/scriptplugin/cmdutil.h
downloadscribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/scriptplugin/cmdutil.h')
-rw-r--r--scribus/plugins/scriptplugin/cmdutil.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/scribus/plugins/scriptplugin/cmdutil.h b/scribus/plugins/scriptplugin/cmdutil.h
new file mode 100644
index 0000000..f15072f
--- /dev/null
+++ b/scribus/plugins/scriptplugin/cmdutil.h
@@ -0,0 +1,71 @@
+/*
+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 CMDUTIL_H
+#define CMDUTIL_H
+
+// Pulls in <Python.h> first
+#include "cmdvar.h"
+
+double PointToValue(double Val);
+double ValueToPoint(double Val);
+
+/*! \brief Convert an X co-ordinate part in page units to a document co-ordinate in system units.
+*/
+double pageUnitXToDocX(double pageUnitX);
+/// \brief Doc units -> page-relative units
+double docUnitXToPageX(double pageUnitX);
+
+/*! \brief Convert a Y co-ordinate part in page units to a document co-ordinate
+in system units. The document co-ordinates have their origin somewere
+up and left of the first page, where page co-ordinates have their
+origin on the top left of the current page. */
+double pageUnitYToDocY(double pageUnitY);
+/// \brief Doc units -> page-relative units
+double docUnitYToPageY(double pageUnitY);
+
+int GetItem(QString Name);
+void ReplaceColor(QString col, QString rep);
+/*!
+ * @brief Returns named PageItem, or selection if name '', or exception and NULL if no item.
+ *
+ * Returns a pointer to a PageItem by looking it up by name - page independent.
+ * If `name' is empty, returns selected item. If the named item is not found,
+ * or `name' is empty and no item is selected, sets an exception and returns
+ * NULL.
+ *
+ * @author 03/10/2004 petr vanek
+ * @author 05/02/02 Craig Ringer
+ */
+PageItem* GetUniqueItem(QString name);
+
+/*!
+ * @brief Returns named PageItem, or exception and NULL if not found.
+ *
+ * @author 03/10/2004 Petr Vanek
+ * @author 05/02/02 Craig Ringer
+ */
+PageItem* getPageItemByName(QString name);
+
+// 2004-10-27 Craig Ringer see cmdutil.cpp for description
+bool checkHaveDocument();
+
+// 2004-11-12 Craig Ringer see cmdutil.cpp for description
+bool ItemExists(QString name);
+
+/*!
+ * @brief Returns a list of the names of all selected PageItems
+ */
+QStringList getSelectedItemsByName();
+/*!
+ * @brief Replaces the current selection by selecting all the items named in the passed QStringList
+ *
+ * Returns false if one or more items can't be selected, true if all were selected.
+ * Selection state is undefined on failure.
+ */
+bool setSelectedItemsByName(QStringList& itemNames);
+
+#endif