]> vaikene.ee Git - evaf/blob - src/libs/Common/app.h
3bcde5aaa045c422acaeff53658b9529e40c6be7
[evaf] / src / libs / Common / app.h
1 /**
2 * @file Common/app.h
3 * @brief Application interface implementation
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #ifndef __COMMON_APP_H
21 #define __COMMON_APP_H
22
23 #include "iapp.h"
24
25 #include <QObject>
26 #include <QString>
27
28 namespace eVaf {
29 namespace Common {
30 namespace Internal {
31
32 /**
33 * iApp application interface implementation
34 */
35 class App : public iApp
36 {
37 Q_OBJECT
38
39 public:
40
41 App();
42
43 virtual ~App();
44
45 /**
46 * Initializes the interface implementation
47 * @return True if ok; false if initialization failed
48 */
49 bool init();
50
51 /*
52 iApp interface
53 */
54 virtual QString const name() const { return mName; }
55
56 virtual QString const language() const { return mLanguage; }
57
58 virtual QString const xmlFileName() const;
59
60 virtual void restart();
61
62 virtual void quit(bool err = false);
63
64 virtual bool isReady() const { return mReady; }
65
66 virtual QString const rootDir() const { return mRootDir; }
67
68 virtual QString const dataRootDir() const;
69
70 virtual QString const binDir() const { return mBinDir; }
71
72 virtual QString const etcDir() const;
73
74 virtual QString const logDir() const;
75
76 virtual QString const docDir() const;
77
78 virtual QString const qtPluginsDir() const;
79
80
81 private:
82
83 /// Flag indicating that the eVaf application is ready
84 bool mReady;
85
86 /// Name of the application
87 QString mName;
88
89 /// Language for the application
90 QString mLanguage;
91
92 /// Name of the application's XML file
93 mutable QString mXmlFile;
94
95 /// Name of the root directry
96 QString mRootDir;
97
98 /// Name of the data root directory
99 mutable QString mDataRootDir;
100
101 /// Name of the binary directory
102 QString mBinDir;
103
104 /// Name of the Qt plugins directory
105 mutable QString mQtPluginsDir;
106
107 /// Name of the configuration files directory
108 mutable QString mEtcDir;
109
110 /// Name of the log files directory
111 mutable QString mLogDir;
112
113 /// Name of the documentation directory
114 mutable QString mDocDir;
115
116 };
117
118 } // namespace eVaf::Common::Internal
119 } // namespace eVaf::Common
120 } // namespace eVaf
121
122 #endif // app.h