QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
qgsselectivemaskingsourcesetmanager.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsselectivemaskingsourcesetmanager.h
3 ------------------
4 Date : January 2026
5 Copyright : (C) 2026 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSSELECTIVEMASKINGSOURCESETMANAGER_H
17#define QGSSELECTIVEMASKINGSOURCESETMANAGER_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
23
24#include <QObject>
25
26class QDomElement;
27class QDomDocument;
29
45#ifdef SIP_RUN
46class CORE_EXPORT QgsSelectiveMaskingSourceSetManager : public QgsProjectStoredObjectManagerBase // for sip we skip to the base class and avoid the template difficulty
47{
48#else
49class CORE_EXPORT QgsSelectiveMaskingSourceSetManager : public QgsAbstractProjectStoredObjectManager< QgsSelectiveMaskingSourceSet >
50{
51#endif
52 Q_OBJECT
53
54 public:
55
61
63
73 bool addSet( const QgsSelectiveMaskingSourceSet &set );
74
80 bool updateSet( const QgsSelectiveMaskingSourceSet &set );
81
93 bool removeSet( const QString &name );
94
100 void clear();
101
108 bool renameSet( const QString &oldName, const QString &newName );
109
113 QVector< QgsSelectiveMaskingSourceSet > sets() const;
114
119 QgsSelectiveMaskingSourceSet setById( const QString &id ) const;
120
125 QgsSelectiveMaskingSourceSet setByName( const QString &name ) const;
126
133 bool readXml( const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context );
134
140 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
141
146 QString generateUniqueTitle() const;
147
148 signals:
149
151 void changed();
152
154 void setAboutToBeAdded( const QString &name );
155
157 void setAdded( const QString &name );
158
160 void setRemoved( const QString &name );
161
163 void setAboutToBeRemoved( const QString &name );
164
166 void setRenamed( const QString &oldName, const QString &newName );
167
168};
169
170
171#endif // QGSSELECTIVEMASKINGSOURCESETMANAGER_H
Manages storage of a set of objects attached to a QgsProject.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:113
A container for the context for various read/write operations on objects.
Manages storage of a set of selective masking source sets.
bool renameSet(const QString &oldName, const QString &newName)
Renames a set in the manager from oldName to newName.
QVector< QgsSelectiveMaskingSourceSet > sets() const
Returns a list of all sets contained in the manager.
void setRemoved(const QString &name)
Emitted when a set was removed from the manager.
QgsSelectiveMaskingSourceSet setByName(const QString &name) const
Returns the set with a matching name, or an invalid set if no matching sets were found.
void setRenamed(const QString &oldName, const QString &newName)
Emitted when a set is renamed.
void clear()
Removes and deletes all sets from the manager.
bool readXml(const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context)
Reads the manager's state from a DOM element, restoring all sets present in the XML document.
QgsSelectiveMaskingSourceSet setById(const QString &id) const
Returns the set with a matching id, or an invalid set if no matching sets were found.
QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const
Returns a DOM element representing the state of the manager.
void setAdded(const QString &name)
Emitted when a set has been added to the manager.
QgsSelectiveMaskingSourceSetManager(QgsProject *project=nullptr)
Constructor for QgsSelectiveMaskingSourceSetManager.
bool addSet(const QgsSelectiveMaskingSourceSet &set)
Adds a set to the manager.
QString generateUniqueTitle() const
Generates a unique title for a new set, which does not clash with any already contained by the manage...
void setAboutToBeAdded(const QString &name)
Emitted when a set is about to be added to the manager.
bool removeSet(const QString &name)
Removes the set with matching name from the manager.
void setAboutToBeRemoved(const QString &name)
Emitted when a set is about to be removed from the manager.
void changed()
Emitted whenever sets stored within the manager are changed.
bool updateSet(const QgsSelectiveMaskingSourceSet &set)
Updates the definition of a set already in the manager.
Represents a named set of selective masking sources (QgsSelectiveMaskSource).
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53