QGIS/python/core/symbology/qgssymbollayerregistry.sip

173 lines
5.4 KiB
Plaintext
Raw Normal View History

2017-06-07 16:07:17 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgssymbollayerregistry.h *
2017-06-07 16:07:17 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2016-08-05 08:08:39 +02:00
class QgsSymbolLayerWidget /External/;
class QgsSymbolLayerAbstractMetadata
{
2017-06-07 16:07:17 +02:00
%Docstring
Stores metadata about one symbol layer class.
.. note::
It's necessary to implement createSymbolLayer() function.
In C++ you can use QgsSymbolLayerMetadata convenience class.
%End
2016-08-05 08:08:39 +02:00
%TypeHeaderCode
2017-06-07 16:07:17 +02:00
#include "qgssymbollayerregistry.h"
2016-08-05 08:08:39 +02:00
%End
public:
QgsSymbolLayerAbstractMetadata( const QString &name, const QString &visibleName, QgsSymbol::SymbolType type );
2016-08-05 08:08:39 +02:00
virtual ~QgsSymbolLayerAbstractMetadata();
QString name() const;
2017-06-07 16:07:17 +02:00
%Docstring
:rtype: str
%End
2016-08-05 08:08:39 +02:00
QString visibleName() const;
2017-06-07 16:07:17 +02:00
%Docstring
:rtype: str
%End
2016-08-05 08:09:43 +02:00
QgsSymbol::SymbolType type() const;
2017-06-07 16:07:17 +02:00
%Docstring
:rtype: QgsSymbol.SymbolType
%End
2016-08-05 08:08:39 +02:00
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) = 0 /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
%End
2017-09-01 15:34:16 +01:00
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer * ) /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
Create widget for symbol layer of this type. Can return NULL if there's no GUI
:rtype: QgsSymbolLayerWidget
%End
2017-07-24 13:02:20 +10:00
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
%End
virtual void resolvePaths( QgsStringMap &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
2017-06-07 16:07:17 +02:00
instances the paths are always absolute
.. versionadded:: 3.0
%End
protected:
2016-08-05 08:08:39 +02:00
};
class QgsSymbolLayerMetadata : QgsSymbolLayerAbstractMetadata
{
2017-06-07 16:07:17 +02:00
%Docstring
Convenience metadata class that uses static functions to create symbol layer and its widget.
2016-08-05 08:08:39 +02:00
%End
2017-06-07 16:07:17 +02:00
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
2016-08-05 08:08:39 +02:00
public:
2017-06-07 16:07:17 +02:00
2017-07-24 13:02:20 +10:00
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) /Factory/;
2017-09-01 15:34:16 +01:00
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer *vl ) /Factory/;
2017-07-24 13:02:20 +10:00
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) /Factory/;
2017-06-07 16:07:17 +02:00
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
protected:
2016-08-05 08:08:39 +02:00
private:
2017-06-07 16:07:17 +02:00
QgsSymbolLayerMetadata();
2016-08-05 08:08:39 +02:00
};
class QgsSymbolLayerRegistry
{
2017-06-07 16:07:17 +02:00
%Docstring
Registry of available symbol layer classes.
QgsSymbolLayerRegistry is not usually directly created, but rather accessed through
QgsApplication.symbolLayerRegistry().
2016-08-05 08:08:39 +02:00
%End
2017-06-07 16:07:17 +02:00
%TypeHeaderCode
#include "qgssymbollayerregistry.h"
%End
2016-08-05 08:08:39 +02:00
public:
QgsSymbolLayerRegistry();
~QgsSymbolLayerRegistry();
2016-08-05 08:08:39 +02:00
2017-06-07 16:07:17 +02:00
QgsSymbolLayerAbstractMetadata *symbolLayerMetadata( const QString &name ) const;
2017-06-07 16:07:17 +02:00
%Docstring
return metadata for specified symbol layer. Returns NULL if not found
:rtype: QgsSymbolLayerAbstractMetadata
%End
2016-08-05 08:08:39 +02:00
bool addSymbolLayerType( QgsSymbolLayerAbstractMetadata *metadata /Transfer/ );
2017-06-07 16:07:17 +02:00
%Docstring
register a new symbol layer type. Takes ownership of the metadata instance.
:rtype: bool
%End
2016-08-05 08:08:39 +02:00
QgsSymbolLayer *createSymbolLayer( const QString &name, const QgsStringMap &properties = QgsStringMap() ) const /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
create a new instance of symbol layer given symbol layer name and properties
:rtype: QgsSymbolLayer
%End
2016-08-05 08:08:39 +02:00
2017-07-24 13:02:20 +10:00
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
create a new instance of symbol layer given symbol layer name and SLD
:rtype: QgsSymbolLayer
%End
2016-08-05 08:08:39 +02:00
2017-06-07 16:07:17 +02:00
void resolvePaths( const QString &name, QgsStringMap &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.
.. versionadded:: 3.0
%End
2016-08-05 08:09:43 +02:00
QStringList symbolLayersForType( QgsSymbol::SymbolType type );
2017-06-07 16:07:17 +02:00
%Docstring
return a list of available symbol layers for a specified symbol type
:rtype: list of str
%End
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer *defaultSymbolLayer( QgsSymbol::SymbolType type ) /Factory/;
2017-06-07 16:07:17 +02:00
%Docstring
create a new instance of symbol layer for specified symbol type with default settings
:rtype: QgsSymbolLayer
%End
2016-08-05 08:08:39 +02:00
private:
QgsSymbolLayerRegistry( const QgsSymbolLayerRegistry &rh );
2016-08-05 08:08:39 +02:00
};
2017-06-07 16:07:17 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgssymbollayerregistry.h *
2017-06-07 16:07:17 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/