eVaf
iapp.h
Go to the documentation of this file.
1 
20 #ifndef __COMMON_IAPP_H
21 #define __COMMON_IAPP_H
22 
23 #include "libcommon.h"
24 
25 #include <QObject>
26 #include <QString>
27 
28 namespace eVaf {
29 namespace Common {
30 
51 class COMMON_EXPORT iApp : public QObject
52 {
53  Q_OBJECT
54 
55 public:
56 
58  enum {
59  RC_Quit = 0,
60  RC_Error = 1,
61  RC_Restart = 2
62  };
63 
65  static char const * const EV_QUIT;
66 
68  static char const * const EV_RESTART;
69 
71  static char const * const EV_READY;
72 
74  static char const * const EV_TERMINATING;
75 
77  iApp() : QObject() {}
78 
80  virtual ~iApp() {}
81 
90  static iApp * instance();
91 
101  virtual QString const name() const = 0;
102 
114  virtual QString const language() const = 0;
115 
130  virtual QString const xmlFileName() const = 0;
131 
139  virtual int exec() = 0;
140 
147  virtual void restart() = 0;
148 
155  virtual void quit(bool err = false) = 0;
156 
160  virtual bool isReady() const = 0;
161 
173  virtual QString const rootDir() const = 0;
174 
186  virtual QString const dataRootDir() const = 0;
187 
196  virtual QString const binDir() const = 0;
197 
207  virtual QString const etcDir() const = 0;
208 
218  virtual QString const logDir() const = 0;
219 
229  virtual QString const docDir() const = 0;
230 
242  virtual QString const qtPluginsDir() const = 0;
243 
244 
245 signals:
246 
253  void ready();
254 
260  void terminating();
261 
262 };
263 
264 } // namespace eVaf::Common
265 } // namespace eVaf
266 
267 #endif
#define COMMON_EXPORT
Definition: libcommon.h:27
static char const *const EV_QUIT
Event that requests the eVaf application to quit.
Definition: iapp.h:65
static char const *const EV_READY
Event informing that the eVaf application is ready.
Definition: iapp.h:71
static char const *const EV_RESTART
Event that requests the eVaf application to restart.
Definition: iapp.h:68
Global eVaf namespace.
Definition: engine.h:37
iApp()
Interface constructor.
Definition: iapp.h:77
static char const *const EV_TERMINATING
Event informing that the eVaf application is restarting.
Definition: iapp.h:74
virtual ~iApp()
Empty virtual destructor.
Definition: iapp.h:80
eVaf application interface
Definition: iapp.h:51