QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgsmasterlayoutinterface.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutinterface.h
3
--------------------
4
begin : December 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
/***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSLAYOUTINTERFACE_H
17
#define QGSLAYOUTINTERFACE_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
22
#include <QDomElement>
23
#include <QIcon>
24
#include <QString>
25
26
class
QgsProject
;
27
class
QgsReadWriteContext
;
28
class
QgsStyleEntityVisitorInterface
;
29
30
#ifdef SIP_RUN
31
// clang-format off
32
% ModuleHeaderCode
33
#include "
qgsprintlayout.h
"
34
#include "
qgsreport.h
"
35
% End
36
// clang-format on
37
#endif
38
44
class
CORE_EXPORT
QgsMasterLayoutInterface
45
{
46
#ifdef SIP_RUN
47
SIP_CONVERT_TO_SUBCLASS_CODE
48
switch
( sipCpp->layoutType() )
49
{
50
case
QgsMasterLayoutInterface::PrintLayout
:
51
sipType = sipType_QgsPrintLayout;
52
*sipCppRet =
static_cast<
QgsPrintLayout
*
>
( sipCpp );
53
break
;
54
case
QgsMasterLayoutInterface::Report
:
55
*sipCppRet =
static_cast<
QgsReport *
>
( sipCpp );
56
sipType = sipType_QgsReport;
57
break
;
58
default
:
59
sipType = NULL;
60
}
61
SIP_END
62
#endif
63
64
public
:
65
67
enum
Type
68
{
69
PrintLayout
= 0,
70
Report
= 1,
71
};
72
73
virtual
~QgsMasterLayoutInterface
() =
default
;
74
79
virtual
QgsMasterLayoutInterface
*
clone
()
const
= 0
SIP_FACTORY
;
80
84
virtual
QgsMasterLayoutInterface::Type
layoutType
()
const
= 0;
85
90
virtual
QString
name
()
const
= 0;
91
95
virtual
QIcon
icon
()
const
= 0;
96
101
virtual
void
setName
(
const
QString &
name
) = 0;
102
107
virtual
QgsProject
*
layoutProject
()
const
= 0;
108
113
virtual
QDomElement
writeLayoutXml
( QDomDocument &document,
const
QgsReadWriteContext
&context )
const
= 0;
114
119
virtual
bool
readLayoutXml
(
const
QDomElement &layoutElement,
const
QDomDocument &document,
const
QgsReadWriteContext
&context ) = 0;
120
124
virtual
void
updateSettings
() = 0;
125
135
virtual
bool
layoutAccept
(
QgsStyleEntityVisitorInterface
*visitor )
const
136
{
137
Q_UNUSED( visitor );
138
return
true
;
139
}
140
};
141
142
#endif
//QGSLAYOUTINTERFACE_H
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition
qgsmasterlayoutinterface.h:45
QgsMasterLayoutInterface::layoutProject
virtual QgsProject * layoutProject() const =0
The project associated with the layout.
QgsMasterLayoutInterface::writeLayoutXml
virtual QDomElement writeLayoutXml(QDomDocument &document, const QgsReadWriteContext &context) const =0
Returns the layout's state encapsulated in a DOM element.
QgsMasterLayoutInterface::name
virtual QString name() const =0
Returns the layout's name.
QgsMasterLayoutInterface::icon
virtual QIcon icon() const =0
Returns an icon for the layout.
QgsMasterLayoutInterface::layoutType
virtual QgsMasterLayoutInterface::Type layoutType() const =0
Returns the master layout type.
QgsMasterLayoutInterface::Type
Type
Master layout type.
Definition
qgsmasterlayoutinterface.h:68
QgsMasterLayoutInterface::Report
@ Report
Report (QgsReport).
Definition
qgsmasterlayoutinterface.h:70
QgsMasterLayoutInterface::PrintLayout
@ PrintLayout
Individual print layout (QgsPrintLayout).
Definition
qgsmasterlayoutinterface.h:69
QgsMasterLayoutInterface::updateSettings
virtual void updateSettings()=0
Refreshes the layout when global layout related options change.
QgsMasterLayoutInterface::clone
virtual QgsMasterLayoutInterface * clone() const =0
Creates a clone of the layout.
QgsMasterLayoutInterface::layoutAccept
virtual bool layoutAccept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified style entity visitor, causing it to visit all style entities associated with th...
Definition
qgsmasterlayoutinterface.h:135
QgsMasterLayoutInterface::setName
virtual void setName(const QString &name)=0
Sets the layout's name.
QgsMasterLayoutInterface::~QgsMasterLayoutInterface
virtual ~QgsMasterLayoutInterface()=default
QgsMasterLayoutInterface::readLayoutXml
virtual bool readLayoutXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the layout's state from a DOM element.
QgsPrintLayout
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Definition
qgsprintlayout.h:30
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:114
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition
qgsstyleentityvisitor.h:34
qgis_sip.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:203
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
SIP_END
#define SIP_END
Definition
qgis_sip.h:220
qgsprintlayout.h
qgsreport.h
Generated on
for QGIS API Documentation by
1.17.0