-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgconfig.h
50 lines (39 loc) · 819 Bytes
/
gconfig.h
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
/**
* General configuration manager.
*
* vim:sw=2:ts=8:et
*/
#ifndef __GENERAL_CONFIG_H__
#define __GENERAL_CONFIG_H__
#include <qpe/config.h>
class QColor;
class QFont;
class QString;
enum { GCT_GROUP, GCT_STRING, GCT_BOOL, GCT_INT, GCT_COLOR, GCT_END };
struct CfgType {
int type;
int id;
const char *name;
const char *def;
};
struct CfgItem;
class GenConfig
{
protected:
QString m_name;
Config *m_file;
CfgItem *m_list;
CfgType *m_nameDB;
int m_count;
GenConfig() { }
public:
GenConfig(const QString &name, CfgType *);
QColor &getColor(int id);
QString &getString(int id);
int &getInt(int id);
bool &getBool(int id);
bool write(int id);
GenConfig *copy();
void apply(const GenConfig *cfg);
};
#endif