QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
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
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() )
68 , entity( entity )
69 {}
70
82 QString identifier;
83
95 QString description;
96
101 };
102
139
141
149 {
150 Q_UNUSED( entity )
151 return true;
152 }
153
165 {
166 Q_UNUSED( node )
167 return true;
168 }
169
179 {
180 Q_UNUSED( node )
181 return true;
182 }
183};
184
185#endif // QGSSTYLEENTITYVISITOR_H
An interface for entities which can be placed in a QgsStyle database.
Definition qgsstyle.h:1347
An interface for classes which can visit style entity (e.g.
NodeType
Describes the types of nodes which may be visited by the visitor.
virtual bool visitExit(const QgsStyleEntityVisitorInterface::Node &node)
Called when the visitor stops visiting a node.
virtual bool visitEnter(const QgsStyleEntityVisitorInterface::Node &node)
Called when the visitor starts visiting a node.
virtual bool visit(const QgsStyleEntityVisitorInterface::StyleLeaf &entity)
Called when the visitor will visit a style entity.
virtual ~QgsStyleEntityVisitorInterface()=default
Contains information relating to a node (i.e.
Node(QgsStyleEntityVisitorInterface::NodeType type, const QString &identifier, const QString &description)
Constructor for Node, visiting the node with the specified identifier and description.
QString identifier
A string identifying the node.
QString description
A string describing the node.
QgsStyleEntityVisitorInterface::NodeType type
Node type.
Contains information relating to the style entity currently being visited.
QString description
A string describing the style entity.
const QgsStyleEntityInterface * entity
Reference to style entity being visited.
QString identifier
A string identifying the style entity.
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...