QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgslayoutserializableobject.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutserializableobject.h
3
-----------------------------
4
begin : July 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 QGSLAYOUTSERIALIZABLEOBJECT_H
19
#define QGSLAYOUTSERIALIZABLEOBJECT_H
20
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
#include "
qgslayoutundocommand.h
"
24
25
class
QDomElement;
26
class
QDomDocument;
27
class
QgsReadWriteContext
;
28
class
QgsAbstractLayoutUndoCommand
;
29
34
class
CORE_EXPORT
QgsLayoutSerializableObject
:
public
QgsLayoutUndoObjectInterface
35
{
36
public
:
42
virtual
QString
stringType
()
const
= 0;
43
47
virtual
QgsLayout
*
layout
() = 0;
48
53
virtual
bool
writeXml
( QDomElement &parentElement, QDomDocument &document,
const
QgsReadWriteContext
&context )
const
= 0;
54
59
virtual
bool
readXml
(
const
QDomElement &element,
const
QDomDocument &document,
const
QgsReadWriteContext
&context ) = 0;
60
61
QgsAbstractLayoutUndoCommand
*
createCommand
(
const
QString &text,
int
id
, QUndoCommand *parent =
nullptr
) override
SIP_FACTORY
;
62
63
private:
64
friend class
QgsLayoutSerializableObjectUndoCommand
;
65
};
66
67
#endif
// QGSLAYOUTSERIALIZABLEOBJECT_H
QgsAbstractLayoutUndoCommand
Base class for commands to undo/redo layout and layout object changes.
Definition
qgslayoutundocommand.h:34
QgsLayoutSerializableObject
An interface for layout objects which can be stored and read from DOM elements.
Definition
qgslayoutserializableobject.h:35
QgsLayoutSerializableObject::writeXml
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
QgsLayoutSerializableObject::readXml
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
QgsLayoutSerializableObject::QgsLayoutSerializableObjectUndoCommand
friend class QgsLayoutSerializableObjectUndoCommand
Definition
qgslayoutserializableobject.h:64
QgsLayoutSerializableObject::stringType
virtual QString stringType() const =0
Returns the object type as a string.
QgsLayoutSerializableObject::layout
virtual QgsLayout * layout()=0
Returns the layout the object belongs to.
QgsLayoutUndoObjectInterface
Interface for layout objects which support undo/redo commands.
Definition
qgslayoutundocommand.h:123
QgsLayoutUndoObjectInterface::createCommand
virtual QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id=0, QUndoCommand *parent=nullptr)=0
Creates a new layout undo command with the specified text and parent.
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition
qgslayout.h:51
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
qgis_sip.h
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgslayoutundocommand.h
Generated on
for QGIS API Documentation by
1.17.0