QGIS API Documentation  2.99.0-Master (f867b65)
qgsaddremovemultiframecommand.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsaddremovemultiframecommand.h
3  -------------------------------
4  begin : 2012-07-31
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
7 ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSADDREMOVEMULTIFRAMECOMMAND_H
19 #define QGSADDREMOVEMULTIFRAMECOMMAND_H
20 
21 #include <QUndoCommand>
22 #include "qgis.h"
23 
24 #include "qgis_core.h"
25 
27 class QgsComposition;
28 
32 class CORE_EXPORT QgsAddRemoveMultiFrameCommand: public QUndoCommand
33 {
34  public:
35 
36  enum State
37  {
38  Added = 0,
39  Removed
40  };
41 
42  QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame *multiFrame, QgsComposition *c, const QString &text, QUndoCommand *parent SIP_TRANSFERTHIS = 0 );
44  void redo() override;
45  void undo() override;
46 
47  private:
49 
50  //changes between added / removed state
51  void switchState();
52  bool checkFirstRun();
53 
54  QgsComposerMultiFrame *mMultiFrame = nullptr;
55  QgsComposition *mComposition = nullptr;
56  State mState;
57  bool mFirstRun;
58 };
59 
60 #endif // QGSADDREMOVEMULTIFRAMECOMMAND_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Abstract base class for composer items with the ability to distribute the content to several frames (...
Graphics scene for map printing.