-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch_config.h
129 lines (102 loc) · 3.96 KB
/
ch_config.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#ifndef ch_config_h__
#define ch_config_h__
/********************************************************************
created: 2014/08/13
created: 13:8:2014 18:59
filename: C:\prj\charlotte\src\ch_config.h
file path: C:\prj\charlotte\src
file base: ch_config
file ext: h
author: Yuri Volodine
purpose: Charlotte configuration
*********************************************************************/
#include <QDir>
#include "ch_object.h"
#include "ch_core.h"
struct module_desc : public ch_object
{
Q_OBJECT
virtual void read_settings() throw(ch_unknown_exc, ch_cfg_exc) = 0;
virtual void write_settings() throw(ch_unknown_exc, ch_cfg_exc) = 0;
public:
virtual void initialize() throw(ch_unknown_exc, ch_cfg_exc, ch_module_exc) = 0;
virtual void finalize() throw(ch_unknown_exc, ch_cfg_exc) = 0;
};
struct data_integration_desc : public module_desc
{
Q_OBJECT
void read_settings() throw(ch_unknown_exc, ch_cfg_exc);
void write_settings() throw(ch_unknown_exc, ch_cfg_exc);
public:
void initialize() throw(ch_unknown_exc, ch_module_exc);
void finalize();
};
struct report_designer_desc : public module_desc
{
Q_OBJECT
Q_PROPERTY(QDir jar_classpath READ jar_classpath)
Q_PROPERTY(QString jar_class READ jar_class)
Q_PROPERTY(QString jar_method READ jar_method)
Q_PROPERTY(QString jar_method_sgn READ jar_method_sgn)
void read_settings() throw(ch_unknown_exc, ch_cfg_exc);
void write_settings() throw(ch_unknown_exc, ch_cfg_exc);
public:
void initialize() throw(ch_unknown_exc, ch_module_exc);
void finalize();
QDir jar_classpath();
QString jar_class();
QString jar_method();
QString jar_method_sgn();
private:
QDir _jar_classpath;
QString _jar_class;
QString _jar_method;
QString _jar_method_sgn;
};
struct ch_config : ch_object
{
Q_OBJECT
Q_PROPERTY(QDir workspace_name READ QDir WRITE workspace_name)
Q_PROPERTY(QDir workspace_path READ QDir WRITE workspace_path)
Q_PROPERTY(QDir project_name READ QDir WRITE project_name)
Q_PROPERTY(QDir project_path READ QDir WRITE project_path)
Q_PROPERTY(StartupLoadProject startup_load_project READ StartupLoadProject WRITE startup_load_project)
Q_PROPERTY(data_integration_desc* data_integration READ data_integration)
Q_PROPERTY(report_designer_desc* report_designer READ report_designer)
static void read_settings() throw(ch_unknown_exc, ch_cfg_exc);
static void write_settings() throw(ch_unknown_exc, ch_cfg_exc);
public:
enum StartupLoadProject
{
slpNever,
slpNew,
slpLast
};
static void initialize(int argc, char* argv[]) throw(ch_unknown_exc, ch_cfg_exc, ch_module_exc);
static void finalize() throw(ch_unknown_exc, ch_cfg_exc);
static QDir workspace_name() throw(ch_unknown_exc, ch_cfg_exc);
static void workspace_name(QDir const& workspace_name) throw(ch_unknown_exc, ch_cfg_exc);
static QDir workspace_path() throw(ch_unknown_exc, ch_cfg_exc);
static void workspace_path(QDir const& workspace_path) throw(ch_unknown_exc, ch_cfg_exc);
static QDir project_name() throw(ch_unknown_exc, ch_cfg_exc);
static void project_name(QDir const& project_name) throw(ch_unknown_exc, ch_cfg_exc);
static QDir project_path() throw(ch_unknown_exc, ch_cfg_exc);
static void project_path(QDir const& project_path) throw(ch_unknown_exc, ch_cfg_exc);
static StartupLoadProject startup_load_project() throw(ch_unknown_exc, ch_cfg_exc);
static void startup_load_project(StartupLoadProject startup_load_project) throw(ch_unknown_exc, ch_cfg_exc);
static data_integration_desc* data_integration() throw(ch_unknown_exc, ch_cfg_exc);
static report_designer_desc* report_designer() throw(ch_unknown_exc, ch_cfg_exc);
private:
static QDir _workspace_name;
static QDir _workspace_path;
static QDir _project_name;
static QDir _project_path;
static StartupLoadProject _startup_load_project;
static data_integration_desc _data_integration;
static report_designer_desc _report_designer;
};
#define CHARLOTTE_INIT(argc, argv) \
ch_config::initialize(argc, argv);
#define CHARLOTTE_EXIT() \
ch_config::finalize();
#endif // ch_config_h__