QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
symbology
qgsstyleentityvisitor.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsstyleentityvisitor.h
3
---------------
4
begin : July 2019
5
copyright : (C) 2019 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 QGSSTYLEENTITYVISITOR_H
19
#define QGSSTYLEENTITYVISITOR_H
20
21
#include "qgis_core.h"
22
#include "
qgsstyle.h
"
23
32
33
class
CORE_EXPORT
QgsStyleEntityVisitorInterface
34
{
35
public
:
39
enum class
NodeType
:
int
40
{
41
Project,
42
Layer,
43
SymbolRule,
44
Layouts,
45
PrintLayout,
46
LayoutItem,
47
Report,
48
ReportHeader,
49
ReportFooter,
50
ReportSection,
51
Annotations,
52
Annotation,
53
};
54
58
struct
StyleLeaf
59
{
65
StyleLeaf
(
const
QgsStyleEntityInterface
*
entity
,
const
QString &
identifier
= QString(),
const
QString &
description
= QString() )
66
:
identifier
(
identifier
)
67
,
description
(
description
)
68
,
entity
(
entity
)
69
{}
70
82
QString
identifier
;
83
95
QString
description
;
96
100
const
QgsStyleEntityInterface
*
entity
=
nullptr
;
101
};
102
107
struct
Node
108
{
112
Node
(
QgsStyleEntityVisitorInterface::NodeType
type
,
const
QString &
identifier
,
const
QString &
description
)
113
:
type
(
type
)
114
,
identifier
(
identifier
)
115
,
description
(
description
)
116
{}
117
121
QgsStyleEntityVisitorInterface::NodeType
type
=
QgsStyleEntityVisitorInterface::NodeType::Project
;
122
129
QString
identifier
;
130
137
QString
description
;
138
};
139
140
virtual
~QgsStyleEntityVisitorInterface
() =
default
;
141
148
virtual
bool
visit
(
const
QgsStyleEntityVisitorInterface::StyleLeaf
&entity )
149
{
150
Q_UNUSED( entity )
151
return
true
;
152
}
153
164
virtual
bool
visitEnter
(
const
QgsStyleEntityVisitorInterface::Node
&node )
165
{
166
Q_UNUSED( node )
167
return
true
;
168
}
169
178
virtual
bool
visitExit
(
const
QgsStyleEntityVisitorInterface::Node
&node )
179
{
180
Q_UNUSED( node )
181
return
true
;
182
}
183
};
184
185
#endif
// QGSSTYLEENTITYVISITOR_H
QgsStyleEntityInterface
An interface for entities which can be placed in a QgsStyle database.
Definition
qgsstyle.h:1404
QgsStyleEntityVisitorInterface
An interface for classes which can visit style entity (e.g.
Definition
qgsstyleentityvisitor.h:34
QgsStyleEntityVisitorInterface::NodeType
NodeType
Describes the types of nodes which may be visited by the visitor.
Definition
qgsstyleentityvisitor.h:40
QgsStyleEntityVisitorInterface::NodeType::Project
@ Project
QGIS Project node.
Definition
qgsstyleentityvisitor.h:41
QgsStyleEntityVisitorInterface::visitExit
virtual bool visitExit(const QgsStyleEntityVisitorInterface::Node &node)
Called when the visitor stops visiting a node.
Definition
qgsstyleentityvisitor.h:178
QgsStyleEntityVisitorInterface::visitEnter
virtual bool visitEnter(const QgsStyleEntityVisitorInterface::Node &node)
Called when the visitor starts visiting a node.
Definition
qgsstyleentityvisitor.h:164
QgsStyleEntityVisitorInterface::visit
virtual bool visit(const QgsStyleEntityVisitorInterface::StyleLeaf &entity)
Called when the visitor will visit a style entity.
Definition
qgsstyleentityvisitor.h:148
QgsStyleEntityVisitorInterface::~QgsStyleEntityVisitorInterface
virtual ~QgsStyleEntityVisitorInterface()=default
qgsstyle.h
QgsStyleEntityVisitorInterface::Node
Contains information relating to a node (i.e.
Definition
qgsstyleentityvisitor.h:108
QgsStyleEntityVisitorInterface::Node::Node
Node(QgsStyleEntityVisitorInterface::NodeType type, const QString &identifier, const QString &description)
Constructor for Node, visiting the node with the specified identifier and description.
Definition
qgsstyleentityvisitor.h:112
QgsStyleEntityVisitorInterface::Node::identifier
QString identifier
A string identifying the node.
Definition
qgsstyleentityvisitor.h:129
QgsStyleEntityVisitorInterface::Node::description
QString description
A string describing the node.
Definition
qgsstyleentityvisitor.h:137
QgsStyleEntityVisitorInterface::Node::type
QgsStyleEntityVisitorInterface::NodeType type
Node type.
Definition
qgsstyleentityvisitor.h:121
QgsStyleEntityVisitorInterface::StyleLeaf
Contains information relating to the style entity currently being visited.
Definition
qgsstyleentityvisitor.h:59
QgsStyleEntityVisitorInterface::StyleLeaf::description
QString description
A string describing the style entity.
Definition
qgsstyleentityvisitor.h:95
QgsStyleEntityVisitorInterface::StyleLeaf::entity
const QgsStyleEntityInterface * entity
Reference to style entity being visited.
Definition
qgsstyleentityvisitor.h:100
QgsStyleEntityVisitorInterface::StyleLeaf::identifier
QString identifier
A string identifying the style entity.
Definition
qgsstyleentityvisitor.h:82
QgsStyleEntityVisitorInterface::StyleLeaf::StyleLeaf
StyleLeaf(const QgsStyleEntityInterface *entity, const QString &identifier=QString(), const QString &description=QString())
Constructor for StyleLeaf, visiting the given style entity with the specified identifier and descript...
Definition
qgsstyleentityvisitor.h:65
Generated on
for QGIS API Documentation by
1.17.0