QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgslayoutmultiframeundocommand.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutmultiframeundocommand.h
3
----------------------
4
begin : October 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
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 QGSLAYOUTMULTIFRAMEUNDOCOMMAND_H
19
#define QGSLAYOUTMULTIFRAMEUNDOCOMMAND_H
20
21
#include "qgis_core.h"
22
#include "
qgslayoutundocommand.h
"
23
24
class
QgsLayout
;
25
class
QgsLayoutMultiFrame
;
26
27
SIP_NO_FILE
28
30
41
class
CORE_EXPORT QgsLayoutMultiFrameUndoCommand :
public
QgsAbstractLayoutUndoCommand
42
{
43
public
:
51
QgsLayoutMultiFrameUndoCommand( QgsLayoutMultiFrame *frame,
const
QString &text,
int
id
= 0, QUndoCommand *parent
SIP_TRANSFERTHIS
=
nullptr
);
52
53
bool
mergeWith(
const
QUndoCommand *command )
override
;
54
58
QgsLayout *layout()
const
;
59
64
QString multiFrameUuid()
const
;
65
66
protected
:
67
void
saveState
( QDomDocument &stateDoc )
const override
;
68
void
restoreState
( QDomDocument &stateDoc )
override
;
69
70
virtual
QgsLayoutMultiFrame *recreateItem(
int
itemType, QgsLayout *layout )
SIP_FACTORY
;
71
72
private
:
73
QString mFrameUuid;
74
QgsLayout *mLayout =
nullptr
;
75
int
mItemType = 0;
76
};
77
87
class
CORE_EXPORT QgsLayoutMultiFrameDeleteUndoCommand :
public
QgsLayoutMultiFrameUndoCommand
88
{
89
public
:
97
QgsLayoutMultiFrameDeleteUndoCommand( QgsLayoutMultiFrame *frame,
const
QString &text,
int
id
= 0, QUndoCommand *parent
SIP_TRANSFERTHIS
=
nullptr
);
98
bool
mergeWith(
const
QUndoCommand *command )
override
;
99
void
redo
()
override
;
100
};
101
102
112
class
CORE_EXPORT QgsLayoutMultiFrameAddItemCommand :
public
QgsLayoutMultiFrameUndoCommand
113
{
114
public
:
122
QgsLayoutMultiFrameAddItemCommand( QgsLayoutMultiFrame *frame,
const
QString &text,
int
id
= 0, QUndoCommand *parent
SIP_TRANSFERTHIS
=
nullptr
);
123
bool
containsChange
()
const override
;
124
bool
mergeWith(
const
QUndoCommand *command )
override
;
125
void
undo
()
override
;
126
};
127
129
130
#endif
//QGSLAYOUTMULTIFRAMEUNDOCOMMAND_H
QgsAbstractLayoutUndoCommand
Base class for commands to undo/redo layout and layout object changes.
Definition
qgslayoutundocommand.h:34
QgsAbstractLayoutUndoCommand::containsChange
virtual bool containsChange() const
Returns true if both the before and after states are valid and different.
Definition
qgslayoutundocommand.cpp:52
QgsAbstractLayoutUndoCommand::saveState
virtual void saveState(QDomDocument &stateDoc) const =0
Saves the state of the object to the specified stateDoc.
QgsAbstractLayoutUndoCommand::restoreState
virtual void restoreState(QDomDocument &stateDoc)=0
Restores the state of the object from the specified stateDoc.
QgsAbstractLayoutUndoCommand::undo
void undo() override
Definition
qgslayoutundocommand.cpp:25
QgsAbstractLayoutUndoCommand::redo
void redo() override
Definition
qgslayoutundocommand.cpp:31
QgsLayoutMultiFrame
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
Definition
qgslayoutmultiframe.h:52
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition
qgslayout.h:51
SIP_NO_FILE
#define SIP_NO_FILE
Definition
fromencodedcomponenthelper.h:23
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgslayoutundocommand.h
Generated on
for QGIS API Documentation by
1.17.0