/** * @file Common/app.h * @brief Application interface implementation * @author Enar Vaikene * * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * * This file can be used under the terms of the GNU General Public License * version 3.0 as published by the Free Software Foundation and appearing in * the file LICENSE included in the packaging of this file. Please review the * the following information to ensure the GNU General Public License version * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. * * Alternatively, this file may be used in accordance with the Commercial License * Agreement provided with the Software. */ #ifndef __COMMON_APP_H #define __COMMON_APP_H #include "iapp.h" #include #include class QEvent; namespace eVaf { namespace Common { namespace Internal { /** * iApp application interface implementation */ class App : public iApp { Q_OBJECT public: /** * Destroys the iApp interface instance */ static void destroyInstance(); App(); virtual ~App(); /** * Initializes the interface implementation * @return True if ok; false if initialization failed */ bool init(); virtual bool event(QEvent *); /* iApp interface */ virtual QString const name() const { return mName; } virtual QString const language() const { return mLanguage; } 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: // Members /// Flag indicating that the eVaf application is ready bool mReady; /// Name of the application QString mName; /// Language for the application QString mLanguage; /// 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 } // namespace eVaf::Common } // namespace eVaf #endif // app.h