83 void setLayerName(
const QString & name );
88 const QString & name()
const;
95 void setTitle(
const QString& title ) { mTitle = title; }
96 const QString&
title()
const {
return mTitle; }
98 void setAbstract(
const QString&
abstract ) { mAbstract =
abstract; }
99 const QString&
abstract()
const {
return mAbstract; }
105 void setDataUrl(
const QString& dataUrl ) { mDataUrl = dataUrl; }
106 const QString&
dataUrl()
const {
return mDataUrl; }
125 void setBlendMode(
const QPainter::CompositionMode &blendMode );
127 QPainter::CompositionMode blendMode()
const;
164 QString publicSource()
const;
167 const QString &source()
const;
173 virtual QStringList subLayers()
const;
179 virtual void setLayerOrder(
const QStringList &layers );
182 virtual void setSubLayerVisibility( QString name,
bool vis );
185 virtual bool isEditable()
const;
201 bool readLayerXML(
const QDomElement& layerElement );
219 bool writeLayerXML( QDomElement& layerElement, QDomDocument& document );
226 static QDomDocument asLayerDefinition( QList<QgsMapLayer*> layers );
230 static QList<QgsMapLayer*> fromLayerDefinition( QDomDocument& document );
231 static QList<QgsMapLayer*> fromLayerDefinitionFile(
const QString qlrfile );
235 void setCustomProperty(
const QString& key,
const QVariant& value );
238 QVariant customProperty(
const QString& value,
const QVariant& defaultValue = QVariant() )
const;
241 void removeCustomProperty(
const QString& key );
245 Q_DECL_DEPRECATED
virtual QString lastErrorTitle();
248 Q_DECL_DEPRECATED
virtual QString lastError();
266 static QString capitaliseLayerName(
const QString& name );
275 virtual QString styleURI( );
285 virtual QString loadDefaultStyle(
bool & theResultFlag );
300 virtual QString loadNamedStyle(
const QString &theURI,
bool &theResultFlag );
302 virtual bool loadNamedStyleFromDb(
const QString &db,
const QString &theURI, QString &qml );
311 virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg );
320 virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
330 virtual QString saveDefaultStyle(
bool & theResultFlag );
345 virtual QString saveNamedStyle(
const QString &theURI,
bool &theResultFlag );
347 virtual QString saveSldStyle(
const QString &theURI,
bool &theResultFlag );
348 virtual QString loadSldStyle(
const QString &theURI,
bool &theResultFlag );
350 virtual bool readSld(
const QDomNode &node, QString &errorMessage )
351 { Q_UNUSED( node ); errorMessage = QString(
"Layer type %1 not supported" ).arg( type() );
return false; }
359 virtual bool readSymbology(
const QDomNode& node, QString& errorMessage ) = 0;
367 virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage )
const = 0;
370 QUndoStack *undoStack();
373 void setLegendUrl(
const QString& legendUrl ) { mLegendUrl = legendUrl; }
381 Q_DECL_DEPRECATED
void setCacheImage( QImage * );
388 virtual void invalidTransformInput();
391 void setMinimumScale(
float theMinScale );
392 float minimumScale()
const;
395 void setMaximumScale(
float theMaxScale );
396 float maximumScale()
const;
399 void toggleScaleBasedVisibility(
bool theVisibilityFlag );
400 bool hasScaleBasedVisibility()
const;
404 Q_DECL_DEPRECATED
void clearCacheImage();
407 virtual QString metadata();
410 virtual QDateTime
timestamp()
const {
return QDateTime() ; }
415 void drawingProgress(
int theProgress,
int theTotalSteps );
418 void statusChanged( QString theStatus );
421 void layerNameChanged();
426 void layerCrsChanged();
431 void repaintRequested();
434 void screenUpdateRequested();
437 void recalculateExtents();
444 void blendModeChanged(
const QPainter::CompositionMode &blendMode );
447 void rendererChanged();
455 void setValid(
bool valid );
460 virtual bool readXml(
const QDomNode& layer_node );
465 virtual bool writeXml( QDomNode & layer_node, QDomDocument & document );
471 void readCustomProperties(
const QDomNode& layerNode,
const QString& keyStartsWith =
"" );
474 void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc )
const;
477 void connectNotify(
const char * signal );
void setMetadataUrl(const QString &metaUrl)
A rectangle specified with double values.
Base class for all map layer types.
QString mID
Unique ID of this layer - used to refer to this layer in map layer registry.
const QString & originalName() const
Get the original name of the layer.
virtual void reload()
Synchronises with changes in the datasource.
bool mScaleBasedVisibility
A flag that tells us whether to use the above vars to restrict layer visibility.
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...
QUndoStack mUndoStack
Collection of undoable operations for this layer.
QString mLayerName
Name of the layer - used for display.
const QString & legendUrl() const
QgsRectangle mExtent
Extent of the layer.
QPainter::CompositionMode mBlendMode
Blend mode for 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.
QgsObjectCustomProperties mCustomProperties
Layer's persistent storage of additional properties (may be used by plugins)
QString mDataUrl
DataUrl of the layer.
const QString & metadataUrl() const
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).
float mMaxScale
Maximum scale denominator at which this layer should be displayed.
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.
QgsMapLayer::LayerType mLayerType
Type of the layer (eg.
QgsCoordinateReferenceSystem * mCRS
layer's spatial reference system.
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
const QString & metadataUrlFormat() const
const QString & legendUrlFormat() const
const QString & title() const
void setDataUrl(const QString &dataUrl)
QString mLayerOrigName
Original name of the layer.
QString mTag
Tag for embedding additional information.
const QString & keywordList() const
float mMinScale
Minimum scale denominator at which this layer should be displayed.
void setAbstract(const QString &abstract)
const QString & dataUrlFormat() const