QGIS API Documentation  2.99.0-Master (08c2e66)
qgspluginlayer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgspluginlayer.cpp
3  ---------------------
4  begin : January 2010
5  copyright : (C) 2010 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #include "qgspluginlayer.h"
16 
17 #include "qgsmaplayerlegend.h"
18 #include "qgsmaplayerrenderer.h"
19 
20 QgsPluginLayer::QgsPluginLayer( const QString& layerType, const QString& layerName )
21  : QgsMapLayer( PluginLayer, layerName )
22  , mPluginLayerType( layerType )
23 {
25 }
26 
28 {
29  // TODO: shall we move the responsibility of emitting the signal to plugin
30  // layer implementations before they start doing their part of cleanup...?
31  emit willBeDeleted();
32 }
33 
35 {
36  return mPluginLayerType;
37 }
38 
40 {
41  mExtent = extent;
42 }
43 
44 void QgsPluginLayer::setSource( const QString& source )
45 {
47 }
48 
50 {
51  Q_UNUSED( iconSize );
52  return QgsLegendSymbologyList();
53 }
void setExtent(const QgsRectangle &extent) override
Set extent of the layer.
A rectangle specified with double values.
Definition: qgsrectangle.h:36
Base class for all map layer types.
Definition: qgsmaplayer.h:52
static QgsMapLayerLegend * defaultPluginLegend(QgsPluginLayer *pl)
Create new legend implementation for raster layer.
void willBeDeleted()
Emitted in the destructor when the layer is about to be deleted, but it is still in a perfectly valid...
QString source() const
Returns the source for the layer.
QgsRectangle mExtent
Extent of the layer.
Definition: qgsmaplayer.h:871
virtual QgsRectangle extent() const
Returns the extent of the layer.
QString pluginLayerType()
Return plugin layer type (the same as used in QgsPluginLayerRegistry)
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
QString mDataSource
Data source description string, varies by layer type.
Definition: qgsmaplayer.h:877
QString mPluginLayerType
QgsPluginLayer(const QString &layerType, const QString &layerName=QString())
void setLegend(QgsMapLayerLegend *legend)
Assign a legend controller to the map layer.
void setSource(const QString &source)
Set source string.
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend (default implementation returns nothing) ...