]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/app.h
Mac OS changes and switched to c++11.
[evaf] / src / libs / Common / app.h
index 5d8886e9e629808b1abb24f519e750ddeb6d1752..58b3401d0b8451280137b86f83d9d7d3b1ecc9b6 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Application interface implementation
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -25,6 +25,8 @@
 #include <QObject>
 #include <QString>
 
+class QEvent;
+
 namespace eVaf {
 namespace Common {
 namespace Internal {
@@ -38,6 +40,11 @@ class App : public iApp
 
 public:
 
+    /**
+     * Destroys the iApp interface instance
+     */
+    static void destroyInstance();
+
     App();
 
     virtual ~App();
@@ -48,6 +55,8 @@ public:
      */
     bool init();
 
+    virtual bool event(QEvent *);
+
     /*
         iApp interface
     */
@@ -57,14 +66,30 @@ public:
 
     virtual QString const xmlFileName() const;
 
+    virtual int exec();
+
     virtual void restart();
 
     virtual void quit(bool err = false);
 
     virtual bool isReady() const { return mReady; }
 
+    virtual QString const rootDir() const { return mRootDir; }
+
+    virtual QString const dataRootDir() const;
+
+    virtual QString const binDir() const { return mBinDir; }
+
+    virtual QString const etcDir() const;
+
+    virtual QString const logDir() const;
+
+    virtual QString const docDir() const;
+
+    virtual QString const qtPluginsDir() const;
 
-private:
+
+private: // Members
 
     /// Flag indicating that the eVaf application is ready
     bool mReady;
@@ -78,6 +103,38 @@ private:
     /// Name of the application's XML file
     mutable QString mXmlFile;
 
+    /// Name of the root directry
+    QString mRootDir;
+
+    /// Name of the data root directory
+    mutable QString mDataRootDir;
+
+    /// Name of the binary directory
+    QString mBinDir;
+
+    /// Name of the Qt plugins directory
+    mutable QString mQtPluginsDir;
+
+    /// Name of the configuration files directory
+    mutable QString mEtcDir;
+
+    /// Name of the log files directory
+    mutable QString mLogDir;
+
+    /// Name of the documentation directory
+    mutable QString mDocDir;
+
+    /// Event numbers
+    uint mEvQuit;
+    uint mEvRestart;
+    uint mEvReady;
+    uint mEvTerminating;
+
+
+private: // Methods
+
+    void setReady(bool value);
+
 };
 
 } // namespace eVaf::Common::Internal