QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgslabelingengineruleregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelingengineruleregistry.h
3 ---------------------
4 Date : August 2024
5 Copyright : (C) 2024 by 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#ifndef QGSLABELINGENGINERULEREGISTRY_H
16#define QGSLABELINGENGINERULEREGISTRY_H
17
18#include "qgis.h"
19#include "qgis_core.h"
20#include "qgis_sip.h"
21
23
39{
40 public:
47
52
56 QStringList ruleIds() const;
57
61 QString displayType( const QString &id ) const;
62
69 bool isAvailable( const QString &id ) const;
70
78 QgsAbstractLabelingEngineRule *create( const QString &id ) const SIP_TRANSFERBACK;
79
90
96 void removeRule( const QString &id );
97
98 private:
99#ifdef SIP_RUN
101#endif
102
103 std::map< QString, std::unique_ptr< QgsAbstractLabelingEngineRule > > mRules;
104};
105
106#endif // QGSLABELINGENGINERULEREGISTRY_H
Abstract base class for labeling engine rules.
QgsAbstractLabelingEngineRule * create(const QString &id) const
Creates a new rule from the type with matching id.
QgsLabelingEngineRuleRegistry(const QgsLabelingEngineRuleRegistry &other)=delete
QgsLabelingEngineRuleRegistry cannot be copied.
QgsLabelingEngineRuleRegistry()
Constructor for QgsLabelingEngineRuleRegistry, containing a set of default rules.
QgsLabelingEngineRuleRegistry & operator=(const QgsLabelingEngineRuleRegistry &other)=delete
QgsLabelingEngineRuleRegistry cannot be copied.
bool isAvailable(const QString &id) const
Returns true if the rule is with matching id is available for use within the current QGIS environment...
bool addRule(QgsAbstractLabelingEngineRule *rule)
Adds a new rule type to the registry.
QString displayType(const QString &id) const
Returns a user-friendly, translated string representing the rule type with matching id.
QStringList ruleIds() const
Returns a list of the rule IDs for rules present in the registry.
void removeRule(const QString &id)
Removes the rule with matching id from the registry.
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_TRANSFERBACK
Definition qgis_sip.h:47