summaryrefslogtreecommitdiff
path: root/action.h
blob: 421adeadcfb52bfbcfddd592099233ec30abb26c (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
#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