83 void setLayerName(
const QString & name );
88 const QString & name()
const;
93 void setTitle(
const QString& title ) { mTitle = title; }
94 const QString&
title()
const {
return mTitle; }
96 void setAbstract(
const QString&
abstract ) { mAbstract =
abstract; }
97 const QString&
abstract()
const {
return mAbstract; }
103 void setDataUrl(
const QString& dataUrl ) { mDataUrl = dataUrl; }
104 const QString&
dataUrl()
const {
return mDataUrl; }
123 void setBlendMode(
const QPainter::CompositionMode &blendMode );
125 QPainter::CompositionMode blendMode()
const;
162 QString publicSource()
const;
165 const QString &source()
const;
171 virtual QStringList subLayers()
const;
177 virtual void setLayerOrder(
const QStringList &layers );
180 virtual void setSubLayerVisibility( QString name,
bool vis );
183 virtual bool isEditable()
const;
199 bool readLayerXML(
const QDomElement& layerElement );
218 bool writeLayerXML( QDomElement& layerElement, QDomDocument& document, QString relativeBasePath = QString::null );
225 static QDomDocument asLayerDefinition( QList<QgsMapLayer*> layers, QString relativeBasePath = QString::null );
229 static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document );
230 static QList<QgsMapLayer*> fromLayerDefinitionFile(
const QString &qlrfile );
233 void setCustomProperty(
const QString& key,
const QVariant& value );
235 QVariant customProperty(
const QString& value,
const QVariant& defaultValue = QVariant() )
const;
237 void removeCustomProperty(
const QString& key );
241 Q_DECL_DEPRECATED
virtual QString lastErrorTitle();
244 Q_DECL_DEPRECATED
virtual QString lastError();
261 static QString capitaliseLayerName(
const QString& name );
269 virtual QString styleURI();
279 virtual QString loadDefaultStyle(
bool & theResultFlag );
294 virtual QString loadNamedStyle(
const QString &theURI,
bool &theResultFlag );
296 virtual bool loadNamedStyleFromDb(
const QString &db,
const QString &theURI, QString &qml );
306 virtual bool importNamedStyle( QDomDocument& doc, QString &errorMsg );
314 virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg );
323 virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
333 virtual QString saveDefaultStyle(
bool & theResultFlag );
348 virtual QString saveNamedStyle(
const QString &theURI,
bool &theResultFlag );
350 virtual QString saveSldStyle(
const QString &theURI,
bool &theResultFlag );
351 virtual QString loadSldStyle(
const QString &theURI,
bool &theResultFlag );
353 virtual bool readSld(
const QDomNode &node, QString &errorMessage )
354 { Q_UNUSED( node ); errorMessage = QString(
"Layer type %1 not supported" ).arg( type() );
return false; }
362 virtual bool readSymbology(
const QDomNode& node, QString& errorMessage ) = 0;
370 virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage )
const = 0;
373 QUndoStack *undoStack();
376 void setLegendUrl(
const QString& legendUrl ) { mLegendUrl = legendUrl; }
384 Q_DECL_DEPRECATED
void setCacheImage( QImage * );
413 float minimumScale()
const;
422 float maximumScale()
const;
430 bool hasScaleBasedVisibility()
const;
435 virtual void invalidTransformInput();
444 void setMinimumScale(
const float theMinScale );
453 void setMaximumScale(
const float theMaxScale );
461 void setScaleBasedVisibility(
const bool enabled );
466 Q_DECL_DEPRECATED
void toggleScaleBasedVisibility(
bool theVisibilityFlag );
470 Q_DECL_DEPRECATED
void clearCacheImage();
478 void triggerRepaint();
481 virtual QString metadata();
484 virtual QDateTime
timestamp()
const {
return QDateTime() ; }
489 void drawingProgress(
int theProgress,
int theTotalSteps );
492 void statusChanged( QString theStatus );
495 void layerNameChanged();
498 void layerCrsChanged();
503 void repaintRequested();
506 void screenUpdateRequested();
509 void recalculateExtents();
515 void blendModeChanged(
const QPainter::CompositionMode &blendMode );
518 void rendererChanged();
524 void legendChanged();
531 void setValid(
bool valid );
536 virtual bool readXml(
const QDomNode& layer_node );
541 virtual bool writeXml( QDomNode & layer_node, QDomDocument & document );
547 void readCustomProperties(
const QDomNode& layerNode,
const QString& keyStartsWith =
"" );
550 void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc )
const;
553 void readStyleManager(
const QDomNode& layerNode );
555 void writeStyleManager( QDomNode& layerNode, QDomDocument& doc )
const;
559 void connectNotify(
const char * signal )
override;
627 QPainter::CompositionMode mBlendMode;
637 bool mScaleBasedVisibility;
640 QUndoStack mUndoStack;
void setMetadataUrl(const QString &metaUrl)
A rectangle specified with double values.
Base class for all map layer types.
const QString & originalName() const
Get the original name of the layer.
virtual void reload()
Synchronises with changes in the datasource.
const QString & attribution() const
void setMetadataUrlType(const QString &metaUrlType)
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
QString mLayerName
Name of the layer - used for display.
const QString & legendUrl() const
QgsRectangle mExtent
Extent of the layer.
QString mMetadataUrl
MetadataUrl of the layer.
void setLegendUrlFormat(const QString &legendUrlFormat)
void setError(const QgsError &theError)
Set error message.
void setKeywordList(const QString &keywords)
const QString & dataUrl() const
void setTitle(const QString &title)
Q_DECL_DEPRECATED QImage * cacheImage()
const QString & metadataUrlType() const
LayerType
Layers enum defining the types of layers that can be added to a map.
QString mDataUrl
DataUrl of the layer.
const QString & metadataUrl() const
The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer...
QgsErrorMessage represents single error message.
bool mValid
Indicates if the layer is valid and can be drawn.
void setDataUrlFormat(const QString &dataUrlFormat)
virtual QgsError error() const
Get current status error.
virtual bool readSld(const QDomNode &node, QString &errorMessage)
QString mMetadataUrlFormat
void setLegendUrl(const QString &legendUrl)
void setMetadataUrlFormat(const QString &metaUrlFormat)
QString mAttribution
Attribution of the layer.
QString mAbstract
Description of the layer.
virtual Q_DECL_DEPRECATED void onCacheImageDelete()
Contains information about the context of a rendering operation.
QString mDataSource
data source description string, varies by layer type
QgsError is container for error messages (report).
QString mLegendUrl
WMS legend.
Class for storing a coordinate reference system (CRS)
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...
void setAttributionUrl(const QString &attribUrl)
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void appendError(const QgsErrorMessage &theMessage)
Add error message.
virtual QDateTime timestamp() const
Time stamp of data source in the moment when data/metadata were loaded by provider.
void setAttribution(const QString &attrib)
const QString & attributionUrl() const
Management of styles for use with one map layer.
const QString & metadataUrlFormat() const
const QString & legendUrlFormat() const
const QString & title() const
void setDataUrl(const QString &dataUrl)
QString mLayerOrigName
Original name of the layer.
const QString & keywordList() const
void setAbstract(const QString &abstract)
const QString & dataUrlFormat() const