summaryrefslogtreecommitdiff
path: root/action.h
diff options
context:
space:
mode:
Diffstat (limited to 'action.h')
-rw-r--r--action.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/action.h b/action.h
new file mode 100644
index 0000000..421adea
--- /dev/null
+++ b/action.h
@@ -0,0 +1,32 @@
+#ifndef ACTION_H
+#define ACTION_H
+
+#include <QObject>
+#include <QtSql/QSqlError>
+#include <QtSql/QSqlQuery>
+
+class Board;
+
+class Action : public QObject
+{
+ Q_OBJECT
+public:
+ explicit Action(Board *board);
+
+signals:
+ void finished(Action *self);
+ void error(Action *self, const QString& messsage);
+
+public slots:
+ virtual void execute() = 0;
+
+protected:
+ void handleDatabaseError(const char *what, const QSqlError& err);
+ void handleDatabaseError(const char *what, const QSqlQuery& query);
+
+protected:
+ Board *_board;
+
+};
+
+#endif // ACTION_H