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_ACTIONMANAGER_H 00021 #define QEXTEND_ACTIONMANAGER_H 00022 00023 #include <QObject> 00024 #include <QExtend/Core/qextend_global> 00025 #include <QExtend/Core/ObjectList> 00026 00027 QT_BEGIN_NAMESPACE 00028 class QMenu; 00029 class QAction; 00030 class QMainWindow; 00031 QT_END_NAMESPACE 00032 00033 namespace QExtend 00034 { 00035 00036 00038 00039 00041 00049 class QEXTEND_EXPORT ActionManager : public QObject 00050 { 00051 Q_DISABLE_COPY(ActionManager) 00052 Q_OBJECT 00053 00054 public: 00055 enum Option 00056 { 00057 NoOptions = 0x0, 00058 File = 0x1, 00059 New = 0x2, 00060 Open = 0x4, 00061 Save = 0x8, 00062 SaveAs = 0x10, 00063 Close = 0x20, 00064 Print = 0x40, 00065 Settings = 0x80, 00066 Edit = 0x0100, 00067 Undo = 0x0200, 00068 Redo = 0x0400, 00069 Cut = 0x0800, 00070 Copy = 0x1000, 00071 Paste = 0x2000, 00072 SelectAll = 0x4000, 00073 Find = 0x8000, 00074 Help = 0x10000, 00075 Index = 0x20000, 00076 About = 0x40000 00077 }; 00078 Q_DECLARE_FLAGS(Options, Option) 00079 00080 /*ActionManager(QMainWindow* mainWindow); 00081 ~ActionManager(); 00082 00083 QAction* addAction(); 00084 QMenu* addMenu(); 00085 00086 QAction* action(QString name); 00087 QMenu* menu(QString name); 00088 00089 void remove(QString name); 00090 00091 void sort(const char* property, bool inverse = false); 00092 00093 void setOptions(const Options options);*/ 00094 00095 Q_SIGNALS: 00096 void newFile(); 00097 void openFile(); 00098 void save(); 00099 void saveAs(); 00100 void closeFile(); 00101 void print(); 00102 void options(); 00103 00104 void undo(); 00105 void redo(); 00106 void cut(); 00107 void copy(); 00108 void paste(); 00109 void selectAll(); 00110 void find(); 00111 00112 void help(); 00113 void about(); 00114 00115 private: 00116 bool option(Option f); 00117 void update(); 00118 00119 ObjectList m_actions; 00120 QMainWindow* m_mainWindow; 00121 Options m_options; 00122 }; 00123 00124 Q_DECLARE_OPERATORS_FOR_FLAGS(ActionManager::Options) 00125 00126 } 00127 00128 #endif // QEXTEND_ACTIONMANAGER_H
© 2000-2025 - www.developpez.com