X-Git-Url: https://vaikene.ee/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Fiapp.h;h=4c7caed14cd80dfdf2c605a50eab663eb012e0c8;hb=4d81227da330c21c7aa0badc88bd5ad4467067fb;hp=55269e1498ae84b885bf3fad1fa0ec7d8229372d;hpb=441d1b38e0900f56891f495a94a08dc8d48e0a32;p=evaf diff --git a/src/libs/Common/iapp.h b/src/libs/Common/iapp.h index 55269e1..4c7caed 100644 --- a/src/libs/Common/iapp.h +++ b/src/libs/Common/iapp.h @@ -45,6 +45,25 @@ class COMMON_EXPORT iApp : public QObject public: + /// Application return values + enum { + RC_Quit = 0, ///< Normal exit + RC_Error = 1, ///< Exit due to an error + RC_Restart = 2 ///< The application is restarting + }; + + /// Event that requests the eVaf application to quit + static char const * const EV_QUIT; + + /// Event that requests the eVaf application to restart + static char const * const EV_RESTART; + + /// Event informing that the eVaf application is ready + static char const * const EV_READY; + + /// Event informing that the eVaf application is restarting + static char const * const EV_TERMINATING; + /// Interface constructor iApp() : QObject() {} @@ -101,6 +120,27 @@ public: */ virtual QString const xmlFileName() const = 0; + /** + * Requests the eVaf application to restart. + * + * This function requests the eVaf application to restart itself. Restarting the application + * reloads all the plugins and re-initializes them. + */ + virtual void restart() = 0; + + /** + * Requests the eVaf application to quit. + * @param err If true, then indicates that the application exits due to a fatal error + * + * This function requests the eVaf application to quit. + */ + virtual void quit(bool err = false) = 0; + + /** + * Returns true if the eVaf application is ready. + */ + virtual bool isReady() const = 0; + signals: