summaryrefslogtreecommitdiffstats
path: root/kolf/objects/test/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'kolf/objects/test/test.h')
-rw-r--r--kolf/objects/test/test.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h
new file mode 100644
index 00000000..3086a578
--- /dev/null
+++ b/kolf/objects/test/test.h
@@ -0,0 +1,56 @@
+#ifndef KOLFTEST_H
+#define KOLFTEST_H
+
+#include <qcanvas.h>
+#include <qobject.h>
+
+#include <klibloader.h>
+
+#include <kolf/canvasitem.h>
+#include <kolf/object.h>
+
+class KConfig;
+
+class TestFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); };
+
+class Test : public QCanvasEllipse, public CanvasItem
+{
+public:
+ Test(QCanvas *canvas);
+
+ virtual Config *config(QWidget *parent);
+ virtual void save(KConfig *cfg);
+ virtual void load(KConfig *cfg);
+
+ virtual void advance(int phase);
+
+ int switchEvery() const { return m_switchEvery / 2; }
+ void setSwitchEvery(int news) { m_switchEvery = news * 2; }
+
+private:
+ int count;
+ int m_switchEvery;
+};
+
+class TestConfig : public Config
+{
+ Q_OBJECT
+
+public:
+ TestConfig(Test *test, QWidget *parent);
+
+private slots:
+ void switchEveryChanged(int news);
+
+private:
+ Test *m_test;
+};
+
+class TestObj : public Object
+{
+public:
+ TestObj() { m_name = i18n("Flash"); m__name = "flash"; m_author = "Jason Katz-Brown"; }
+ virtual QCanvasItem *newObject(QCanvas *canvas) { return new Test(canvas); }
+};
+
+#endif