QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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:
60
62
72 bool addSet( const QgsSelectiveMaskingSourceSet &set );
73
79 bool updateSet( const QgsSelectiveMaskingSourceSet &set );
80
92 bool removeSet( const QString &name );
93
99 void clear();
100
107 bool renameSet( const QString &oldName, const QString &newName );
108
112 QVector< QgsSelectiveMaskingSourceSet > sets() const;
113
118 QgsSelectiveMaskingSourceSet setById( const QString &id ) const;
119
124 QgsSelectiveMaskingSourceSet setByName( const QString &name ) const;
125
132 bool readXml( const QDomElement &element, const QDomDocument &doc, const QgsReadWriteContext &context );
133
139 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
140
145 QString generateUniqueTitle() const;
146
147 signals:
148
150 void changed();
151
153 void setAboutToBeAdded( const QString &name );
154
156 void setAdded( const QString &name );
157
159 void setRemoved( const QString &name );
160
162 void setAboutToBeRemoved( const QString &name );
163
165 void setRenamed( const QString &oldName, const QString &newName );
166};
167
168
169#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:52