summaryrefslogtreecommitdiff
path: root/action.h
blob: acfbc0529c92d2752244fba8793d86e76aa20ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#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);

	virtual bool isSupersetOf(Action *action) const = 0;

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