Scribus
Open source desktop publishing at your fingertips
cmdgetsetprop.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef CMD_GETSETPROP_H
8 #define CMD_GETSETPROP_H
9 
10 // Pulls in Python.h first
11 #include "cmdvar.h"
12 #include <QStringList>
13 
14 
34 QObject* getQObjectFromPyArg(PyObject* arg);
35 
36 
42 PyObject* wrapQObject(QObject* obj);
43 
44 
49 PyObject* convert_QStringList_to_PyListObject(QStringList& origlist);
50 
55 PyObject* convert_QObjectList_to_PyListObject(QObjectList* origlist);
56 
69 const char* getpropertytype(QObject* obj, const char* propname, bool includesuper = true);
70 
76 PyDoc_STRVAR(scribus_propertyctype__doc__,
77 QT_TR_NOOP("getPropertyCType(object, property, includesuper=True)\n\
78 \n\
79 Returns the name of the C type of `property' of `object'. See getProperty()\n\
80 for details of arguments.\n\
81 \n\
82 If `includesuper' is true, search inherited properties too.\n\
83 "));
84 PyObject* scribus_propertyctype(PyObject* /*self*/, PyObject* args, PyObject* kw);
85 
86 
95 PyDoc_STRVAR(scribus_getpropertynames__doc__,
96 QT_TR_NOOP("getPropertyNames(object, includesuper=True)\n\
97 \n\
98 Return a list of property names supported by `object'.\n\
99 If `includesuper' is true, return properties supported\n\
100 by parent classes as well.\n\
101 "));
102 PyObject* scribus_getpropertynames(PyObject* self, PyObject* args, PyObject* kw);
103 
104 
122 PyDoc_STRVAR(scribus_getproperty__doc__,
123 QT_TR_NOOP("getProperty(object, property)\n\
124 \n\
125 Return the value of the property `property' of the passed `object'.\n\
126 \n\
127 The `object' argument may be a string, in which case the named PageItem\n\
128 is searched for. It may also be a PyCObject, which may point to any\n\
129 C++ QObject instance.\n\
130 \n\
131 The `property' argument must be a string, and is the name of the property\n\
132 to look up on `object'.\n\
133 \n\
134 The return value varies depending on the type of the property.\n\
135 "));
136 PyObject* scribus_getproperty(PyObject* /*self*/, PyObject* args, PyObject* kw);
137 
138 
157 PyDoc_STRVAR(scribus_setproperty__doc__,
158 QT_TR_NOOP("setProperty(object, property, value)\n\
159 \n\
160 Set `property' of `object' to `value'. If `value' cannot be converted to a type\n\
161 compatible with the type of `property', an exception is raised. An exception may\n\
162 also be raised if the underlying setter fails.\n\
163 \n\
164 See getProperty() for more information.\n\
165 "));
166 PyObject* scribus_setproperty(PyObject* /*self*/, PyObject* args, PyObject* kw);
167 
168 
176 /*Qt4
177 PyDoc_STRVAR(scribus_getchildren__doc__,
178 QT_TR_NOOP("getChildren(object, ofclass=None, ofname=None, regexpmatch=False, recursive=True)\n\
179 \n\
180 Return a list of children of `object', possibly restricted to children\n\
181 of class named `ofclass' or children named `ofname'. If `recursive' is true,\n\
182 search recursively through children, grandchildren, etc.\n\
183 \n\
184 See QObject::children() in the Qt docs for more information.\n\
185 "));
186 PyObject* scribus_getchildren(PyObject* self, PyObject* args, PyObject* kw);
187 */
188 
196 /*Qt4
197 PyDoc_STRVAR(scribus_getchild__doc__,
198 QT_TR_NOOP("getChild(object, childname, ofclass=None, recursive=True)\n\
199 \n\
200 Return the first child of `object' named `childname', possibly restricting\n\
201 the search to children of type name `ofclass'. If `recursive' is true,\n\
202 search recursively through children, grandchildren, etc.\n\
203 "));
204 PyObject* scribus_getchild(PyObject* self, PyObject* args, PyObject* kw);
205 */
206 #endif