00001 /* 00002 Copyright © 2010 guillaume belz 00003 00004 This file is part of QExtend. 00005 00006 QExtend is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 any later version. 00010 00011 QExtend is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with QExtend. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef QEXTEND_STANDARDAPPLICATION_H 00021 #define QEXTEND_STANDARDAPPLICATION_H 00022 00023 #include <QtGui/QApplication> 00024 #include <QExtend/Core/qextend_global> 00025 #include <QExtend/Core/ObjectList> 00026 00027 QT_BEGIN_NAMESPACE 00028 class QMainWindow; 00029 class QSettings; 00030 class QStatusBar; 00031 QT_END_NAMESPACE 00032 00033 namespace QExtend 00034 { 00035 class ActionManager; 00036 class PluginManager; 00037 00038 00039 00041 00042 00044 00052 class QEXTEND_EXPORT StandardApplication : public QApplication 00053 { 00054 Q_DISABLE_COPY(StandardApplication) 00055 Q_OBJECT 00056 00057 public: 00058 enum Option 00059 { 00060 NoOptions = 0x00, 00061 ObjectPool = 0x01, 00062 Settings = 0x02, 00063 MainWindow = 0x04, 00064 StatusBar = 0x08, 00065 Actions = 0x10, 00066 Plugins = 0x20 00067 }; 00068 Q_DECLARE_FLAGS(Options, Option) 00069 00070 StandardApplication(int &argc, char **argv); 00071 int exec(); 00072 void setOptions(Options options); 00073 00074 const ObjectList& getObjectPool() const; 00075 ObjectList& getObjectPool(); 00076 QSettings* getSettings() const; 00077 QMainWindow* getMainWindow() const; 00078 ActionManager* getActionManager() const; 00079 PluginManager* getPluginManager() const; 00080 00081 private: 00082 void saveObject(QObject* object); 00083 bool option(Option f); 00084 00085 Options m_options; 00086 00087 ObjectList m_objectPool; 00088 QSettings* m_settings; 00089 QMainWindow* m_mainWindow; 00090 ActionManager* m_actionManager; 00091 PluginManager* m_pluginManager; 00092 }; 00093 00094 Q_DECLARE_OPERATORS_FOR_FLAGS(StandardApplication::Options) 00095 00096 } 00097 00098 #endif // QEXTEND_STANDARDAPPLICATION_H
© 2000-2024 - www.developpez.com