blob: b542205e3229722e17b274c3b6348e0805a4dd37 (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#ifndef BASE_FACTORY_H
#define BASE_FACTORY_H
#include <qglobal.h>
#include <kdemacros.h>
struct MainData {
const char *appName, *trName, *description, *homepage, *removedLabel,
*version, *longVersion;
};
struct BaseBoardInfo {
uint width, height;
bool withPieces;
uint beforeRemoveTime, afterRemoveTime;
uint nbToggles, nbFallStages;
uint nbArcadeStages;
const uint *histogram;
uint histogramSize;
bool scoreBound;
};
class BaseBoard;
class BaseInterface;
class QWidget;
class KAboutData;
#define bfactory BaseFactory::self()
class KDE_EXPORT BaseFactory
{
public:
BaseFactory(const MainData &, const BaseBoardInfo &);
virtual ~BaseFactory();
void init(int argc, char **argv);
static BaseFactory *self() { return _self; }
const MainData &mainData;
const BaseBoardInfo &bbi;
virtual BaseBoard *createBoard(bool graphic, QWidget *parent) = 0;
virtual BaseInterface *createInterface(QWidget *parent) = 0;
virtual QWidget *createAppearanceConfig();
virtual QWidget *createColorConfig();
virtual QWidget *createGameConfig() { return 0; }
protected:
KAboutData *_aboutData;
private:
static BaseFactory *_self;
};
#endif
|