eVaf
app.h
Go to the documentation of this file.
1 
20 #ifndef __COMMON_APP_H
21 #define __COMMON_APP_H
22 
23 #include "iapp.h"
24 
25 #include <QObject>
26 #include <QString>
27 
28 class QEvent;
29 
30 namespace eVaf {
31 namespace Common {
32 namespace Internal {
33 
37 class App : public iApp
38 {
39  Q_OBJECT
40 
41 public:
42 
43  App();
44 
45  virtual ~App();
46 
51  bool init();
52 
53  virtual bool event(QEvent *);
54 
55  /*
56  iApp interface
57  */
58  virtual QString const name() const { return mName; }
59 
60  virtual QString const language() const { return mLanguage; }
61 
62  virtual QString const xmlFileName() const;
63 
64  virtual int exec();
65 
66  virtual void restart();
67 
68  virtual void quit(bool err = false);
69 
70  virtual bool isReady() const { return mReady; }
71 
72  virtual QString const rootDir() const { return mRootDir; }
73 
74  virtual QString const dataRootDir() const;
75 
76  virtual QString const binDir() const { return mBinDir; }
77 
78  virtual QString const etcDir() const;
79 
80  virtual QString const logDir() const;
81 
82  virtual QString const docDir() const;
83 
84  virtual QString const qtPluginsDir() const;
85 
86 
87 private: // Members
88 
90  bool mReady;
91 
93  QString mName;
94 
96  QString mLanguage;
97 
99  mutable QString mXmlFile;
100 
102  QString mRootDir;
103 
105  mutable QString mDataRootDir;
106 
108  QString mBinDir;
109 
111  mutable QString mQtPluginsDir;
112 
114  mutable QString mEtcDir;
115 
117  mutable QString mLogDir;
118 
120  mutable QString mDocDir;
121 
123  uint mEvQuit;
124  uint mEvRestart;
125  uint mEvReady;
126  uint mEvTerminating;
127 
128 
129 private: // Methods
130 
131  void setReady(bool value);
132 
133 };
134 
135 } // namespace eVaf::Common::Internal
136 } // namespace eVaf::Common
137 } // namespace eVaf
138 
139 #endif // app.h
virtual QString const xmlFileName() const
Returns the name of the application&#39;s XML file.
virtual QString const docDir() const
Returns the documentation directory.
virtual QString const qtPluginsDir() const
Returns the Qt plugins directory.
bool init()
Initializes the interface implementation.
virtual int exec()
Enters the main event loop of the Qt application.
virtual QString const logDir() const
Returns the log files directory.
virtual QString const language() const
Returns the current language and country used by the application.
Definition: app.h:60
virtual QString const dataRootDir() const
Returns the name of the eVaf data directory.
virtual void restart()
Requests the eVaf application to restart.
eVaf application interface
virtual QString const rootDir() const
Returns the name of the eVaf root directory.
Definition: app.h:72
virtual bool event(QEvent *)
virtual QString const etcDir() const
Returns the configuration files directory.
virtual QString const binDir() const
Returns the name of the binary files directory.
Definition: app.h:76
virtual bool isReady() const
Returns true if the eVaf application is ready.
Definition: app.h:70
iApp application interface implementation
Definition: app.h:37
virtual void quit(bool err=false)
Requests the eVaf application to quit.
virtual QString const name() const
Returns the name of the eVaf application.
Definition: app.h:58
Global eVaf namespace.
Definition: engine.h:37
eVaf application interface
Definition: iapp.h:51