1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgssymbollayerregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsSymbolLayerWidget /External/;
class QgsSymbolLayerAbstractMetadata
{
%Docstring(signature="appended")
Stores metadata about one symbol layer class.
.. note::
It's necessary to implement :py:func:`~createSymbolLayer` function.
In C++ you can use :py:class:`QgsSymbolLayerMetadata` convenience class.
%End
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
public:
QgsSymbolLayerAbstractMetadata( const QString &name, const QString &visibleName, Qgis::SymbolType type );
%Docstring
Constructor for QgsSymbolLayerAbstractMetadata.
:param name: internal symbol layer name (unique identifier)
:param visibleName: user visible, translated name for symbol layer
:param type: associated symbol type
%End
virtual ~QgsSymbolLayerAbstractMetadata();
QString name() const;
QString visibleName() const;
Qgis::SymbolType type() const;
virtual QgsSymbolLayer *createSymbolLayer( const QVariantMap &map ) = 0 /Factory/;
%Docstring
Create a symbol layer of this type given the map of properties.
%End
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer * ) /Factory/;
%Docstring
Create widget for symbol layer of this type. Can return ``None`` if
there's no GUI
%End
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) /Factory/;
%Docstring
Create a symbol layer of this type given the map of properties.
%End
virtual void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
Resolve paths in symbol layer's properties (if there are any paths).
When saving is ``True``, paths are converted from absolute to relative,
when saving is ``False``, paths are converted from relative to absolute.
This ensures that paths in project files can be relative, but in symbol
layer instances the paths are always absolute
%End
virtual void resolveFonts( const QVariantMap &properties, const QgsReadWriteContext &context );
%Docstring
Resolve fonts from the symbol layer's ``properties``.
This tests whether the required fonts from the encoded ``properties``
are available on the system, and records warnings in the ``context`` if
not.
.. versionadded:: 3.20
%End
protected:
};
class QgsSymbolLayerMetadata : QgsSymbolLayerAbstractMetadata
{
%Docstring(signature="appended")
Convenience metadata class that uses static functions to create symbol
layer and its widget.
%End
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
public:
virtual QgsSymbolLayer *createSymbolLayer( const QVariantMap &map ) /Factory/;
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer *vl ) /Factory/;
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) /Factory/;
virtual void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
virtual void resolveFonts( const QVariantMap &properties, const QgsReadWriteContext &context );
protected:
private:
QgsSymbolLayerMetadata();
};
class QgsSymbolLayerRegistry
{
%Docstring(signature="appended")
Registry of available symbol layer classes.
:py:class:`QgsSymbolLayerRegistry` is not usually directly created, but
rather accessed through :py:func:`QgsApplication.symbolLayerRegistry()`.
%End
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
public:
QgsSymbolLayerRegistry();
~QgsSymbolLayerRegistry();
QgsSymbolLayerAbstractMetadata *symbolLayerMetadata( const QString &name ) const;
%Docstring
Returns metadata for specified symbol layer. Returns ``None`` if not
found
%End
bool addSymbolLayerType( QgsSymbolLayerAbstractMetadata *metadata /Transfer/ );
%Docstring
Registers a new symbol layer type. Takes ownership of the metadata
instance.
%End
bool removeSymbolLayerType( QgsSymbolLayerAbstractMetadata *metadata );
%Docstring
Removes a symbol layer type
.. versionadded:: 3.22.2
%End
QgsSymbolLayer *createSymbolLayer( const QString &name, const QVariantMap &properties = QVariantMap() ) const /Factory/;
%Docstring
create a new instance of symbol layer given symbol layer name and
properties
%End
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const /Factory/;
%Docstring
create a new instance of symbol layer given symbol layer name and SLD
%End
void resolvePaths( const QString &name, QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving ) const;
%Docstring
Resolve paths in properties of a particular symbol layer. This normally
means converting relative paths to absolute paths when loading and
converting absolute paths to relative paths when saving.
%End
void resolveFonts( const QString &name, QVariantMap &properties, const QgsReadWriteContext &context ) const;
%Docstring
Resolve fonts from the ``properties`` of a particular symbol layer.
This tests whether the required fonts from the encoded ``properties``
are available on the system, and records warnings in the ``context`` if
not.
.. versionadded:: 3.20
%End
QStringList symbolLayersForType( Qgis::SymbolType type );
%Docstring
Returns a list of available symbol layers for a specified symbol type
%End
static QgsSymbolLayer *defaultSymbolLayer( Qgis::SymbolType type ) /Factory/;
%Docstring
create a new instance of symbol layer for specified symbol type with
default settings
%End
private:
QgsSymbolLayerRegistry( const QgsSymbolLayerRegistry &rh );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgssymbollayerregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|