summaryrefslogtreecommitdiffstats
path: root/kolf/objects/poolball/poolball.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /kolf/objects/poolball/poolball.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kolf/objects/poolball/poolball.h')
-rw-r--r--kolf/objects/poolball/poolball.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h
new file mode 100644
index 00000000..eeb851b2
--- /dev/null
+++ b/kolf/objects/poolball/poolball.h
@@ -0,0 +1,63 @@
+#ifndef KOLFPOOLBALL_H
+#define KOLFPOOLBALL_H
+
+#include <qcanvas.h>
+#include <qobject.h>
+#include <qpainter.h>
+
+#include <klibloader.h>
+
+#include <kolf/ball.h>
+#include <kolf/canvasitem.h>
+#include <kolf/config.h>
+#include <kolf/object.h>
+
+class StateDB;
+class KConfig;
+
+class PoolBallFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); };
+
+class PoolBall : public Ball
+{
+public:
+ PoolBall(QCanvas *canvas);
+
+ virtual bool deleteable() const { return true; }
+
+ virtual Config *config(QWidget *parent);
+ virtual void saveState(StateDB *);
+ virtual void save(KConfig *cfg);
+ virtual void loadState(StateDB *);
+ virtual void load(KConfig *cfg);
+ virtual void draw(QPainter &);
+ virtual bool fastAdvance() const { return true; }
+
+ int number() const { return m_number; }
+ void setNumber(int newNumber) { m_number = newNumber; update(); }
+
+private:
+ int m_number;
+};
+
+class PoolBallConfig : public Config
+{
+ Q_OBJECT
+
+public:
+ PoolBallConfig(PoolBall *poolBall, QWidget *parent);
+
+private slots:
+ void numberChanged(int);
+
+private:
+ PoolBall *m_poolBall;
+};
+
+class PoolBallObj : public Object
+{
+public:
+ PoolBallObj() { m_name = i18n("Pool Ball"); m__name = "poolball"; m_author = "Jason Katz-Brown"; }
+ virtual QCanvasItem *newObject(QCanvas *canvas) { return new PoolBall(canvas); }
+};
+
+#endif