|
QGIS API Documentation
master-6227475
|
00001 /*************************************************************************** 00002 qgsaddremovemultiframecommand.h 00003 ------------------------------- 00004 begin : 2012-07-31 00005 copyright : (C) 2012 by Marco Hugentobler 00006 email : marco dot hugentobler at sourcepole dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QGSADDREMOVEMULTIFRAMECOMMAND_H 00019 #define QGSADDREMOVEMULTIFRAMECOMMAND_H 00020 00021 #include <QUndoCommand> 00022 00023 class QgsComposerMultiFrame; 00024 class QgsComposition; 00025 00026 class CORE_EXPORT QgsAddRemoveMultiFrameCommand: public QUndoCommand 00027 { 00028 public: 00029 00030 enum State 00031 { 00032 Added = 0, 00033 Removed 00034 }; 00035 00036 QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent = 0 ); 00037 ~QgsAddRemoveMultiFrameCommand(); 00038 void redo(); 00039 void undo(); 00040 00041 private: 00042 QgsAddRemoveMultiFrameCommand(); 00043 00044 //changes between added / removed state 00045 void switchState(); 00046 bool checkFirstRun(); 00047 00048 QgsComposerMultiFrame* mMultiFrame; 00049 QgsComposition* mComposition; 00050 State mState; 00051 bool mFirstRun; 00052 }; 00053 00054 #endif // QGSADDREMOVEMULTIFRAMECOMMAND_H