81 void setLayerName(
const QString & name );
86 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;
157 QString publicSource()
const;
160 const QString &source()
const;
166 virtual QStringList subLayers()
const;
172 virtual void setLayerOrder(
const QStringList &layers );
175 virtual void setSubLayerVisibility( QString name,
bool vis );
178 virtual bool isEditable()
const;
194 bool readLayerXML(
const QDomElement& layerElement );
212 bool writeLayerXML( QDomElement& layerElement, QDomDocument& document );
216 void setCustomProperty(
const QString& key,
const QVariant& value );
219 QVariant customProperty(
const QString& value,
const QVariant& defaultValue = QVariant() )
const;
222 void removeCustomProperty(
const QString& key );
231 virtual QString lastErrorTitle();
239 virtual QString lastError();
257 static QString capitaliseLayerName(
const QString& name );
266 virtual QString styleURI( );
276 virtual QString loadDefaultStyle(
bool & theResultFlag );
291 virtual QString loadNamedStyle(
const QString &theURI,
bool &theResultFlag );
293 virtual bool loadNamedStyleFromDb(
const QString &db,
const QString &theURI, QString &qml );
302 virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg );
311 virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
321 virtual QString saveDefaultStyle(
bool & theResultFlag );
336 virtual QString saveNamedStyle(
const QString &theURI,
bool &theResultFlag );
338 virtual QString saveSldStyle(
const QString &theURI,
bool &theResultFlag );
339 virtual QString loadSldStyle(
const QString &theURI,
bool &theResultFlag );
341 virtual bool readSld(
const QDomNode &node, QString &errorMessage )
342 { Q_UNUSED( node ); errorMessage = QString(
"Layer type %1 not supported" ).arg( type() );
return false; }
350 virtual bool readSymbology(
const QDomNode& node, QString& errorMessage ) = 0;
358 virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage )
const = 0;
361 QUndoStack *undoStack();
368 void setCacheImage( QImage * thepImage );
379 virtual void invalidTransformInput();
382 void setMinimumScale(
float theMinScale );
383 float minimumScale()
const;
386 void setMaximumScale(
float theMaxScale );
387 float maximumScale()
const;
390 void toggleScaleBasedVisibility(
bool theVisibilityFlag );
391 bool hasScaleBasedVisibility()
const;
395 void clearCacheImage();
398 virtual QString metadata();
401 virtual QDateTime
timestamp()
const {
return QDateTime() ; }
406 void drawingProgress(
int theProgress,
int theTotalSteps );
409 void statusChanged( QString theStatus );
412 void layerNameChanged();
417 void layerCrsChanged();
422 void repaintRequested();
426 void screenUpdateRequested();
429 void recalculateExtents();
436 void blendModeChanged(
const QPainter::CompositionMode &blendMode );
444 void setValid(
bool valid );
449 virtual bool readXml(
const QDomNode& layer_node );
454 virtual bool writeXml( QDomNode & layer_node, QDomDocument & document );
460 void readCustomProperties(
const QDomNode& layerNode,
const QString& keyStartsWith =
"" );
463 void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc )
const;
466 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.
QImage * cacheImage()
Get the QImage used for caching render operations.
const QString & attribution() const
void setMetadataUrlType(const QString &metaUrlType)
QUndoStack mUndoStack
Collection of undoable operations for this layer.
QString mLayerName
Name of the layer - used for display.
QgsRectangle mExtent
Extent of the layer.
QPainter::CompositionMode mBlendMode
Blend mode for the layer.
QString mMetadataUrl
MetadataUrl of the layer.
void setError(const QgsError &theError)
Set error message.
void setKeywordList(const QString &keywords)
const QString & dataUrl() const
void setTitle(const QString &title)
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
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 setMetadataUrlFormat(const QString &metaUrlFormat)
QString mAttribution
Attribution of the layer.
QString mAbstract
Description of the layer.
QMap< QString, QVariant > mCustomProperties
Contains information about the context of a rendering operation.
QString mDataSource
data source description string, varies by layer type
virtual void onCacheImageDelete()
Is called when the cache image is being deleted.
QgsError is container for error messages (report).
float mMaxScale
Maximum scale denominator at which this layer should be displayed.
Class for storing a coordinate reference system (CRS)
void setAttributionUrl(const QString &attribUrl)
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 & 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
QImage * mpCacheImage
QImage for caching of rendering operations.