summaryrefslogtreecommitdiffstats
path: root/tests/libsample/objecttype.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-03 05:21:04 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-03 05:21:04 -0300
commit048498d28bf7a0451bfc490b9f1799d3d3751b40 (patch)
tree90102429b533478bda47213c8ad5b8d531d6204d /tests/libsample/objecttype.h
parent22ae136011c64b3da8f272e6f55574413064efae (diff)
downloadshiboken-048498d28bf7a0451bfc490b9f1799d3d3751b40.tar.gz
shiboken-048498d28bf7a0451bfc490b9f1799d3d3751b40.tar.xz
shiboken-048498d28bf7a0451bfc490b9f1799d3d3751b40.zip
* added the ObjectType example which adds some cases similar to
those on Qt's QObject (object name, parent and children list), although no ownership test was added yet. * added method Abstract::getObjectId(Abstract*) as a case of an argument that should be converted to an abstract type. * added ListUser::multiplyPointList(std::list<Point*>&, double), which tests the conversion from a Python list of Point wrappers to a C++ list whose items will be altered.
Diffstat (limited to 'tests/libsample/objecttype.h')
-rw-r--r--tests/libsample/objecttype.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/libsample/objecttype.h b/tests/libsample/objecttype.h
new file mode 100644
index 00000000..e5383524
--- /dev/null
+++ b/tests/libsample/objecttype.h
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef OBJECTTYPE_H
+#define OBJECTTYPE_H
+
+#include <list>
+#include "str.h"
+
+class ObjectType
+{
+public:
+ typedef std::list<ObjectType*> ObjectTypeList;
+
+ ObjectType(ObjectType* parent = 0);
+ virtual ~ObjectType();
+
+ void setParent(ObjectType* parent);
+ ObjectType* parent() const { return m_parent; }
+ const ObjectTypeList& children() const { return m_children; }
+
+ Str objectName() const;
+ void setObjectName(const Str& name);
+
+ virtual bool event();
+
+private:
+ ObjectType(const ObjectType&);
+ ObjectType& operator=(const ObjectType&);
+
+ Str* m_objectName;
+ ObjectType* m_parent;
+ ObjectTypeList m_children;
+};
+#endif // OBJECTTYPE_H
+