55 if ( _instance == NULL )
63 QgsPluginLayerRegistry::QgsPluginLayerRegistry()
69 if ( !mPluginLayerTypes.isEmpty() )
71 QgsDebugMsg(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" );
72 foreach ( QString typeName, mPluginLayerTypes.keys() )
73 removePluginLayerType( typeName );
79 return mPluginLayerTypes.keys();
86 if ( mPluginLayerTypes.contains( type->
name() ) )
89 mPluginLayerTypes[type->
name()] = type;
96 if ( !mPluginLayerTypes.contains( typeName ) )
109 QStringList() << layer->
id() );
114 delete mPluginLayerTypes.take( typeName );
120 return mPluginLayerTypes.value( typeName, NULL );
129 QgsDebugMsg(
"Unknown plugin layer type: " + typeName );
QgsPluginLayerType * pluginLayerType(QString typeName)
return plugin layer type metadata or NULL if doesn't exist
Base class for all map layer types.
QgsPluginLayer * createLayer(QString typeName)
return new layer if corresponding plugin has been found, else return NULL
QgsMapLayer::LayerType type() const
Get the type of the layer.
a registry of plugin layers types
Base class for plugin layers.
static QgsMapLayerRegistry * instance()
QgsPluginLayerType(QString name)
virtual QgsPluginLayer * createLayer()
return new layer of this type.
bool addPluginLayerType(QgsPluginLayerType *pluginLayerType)
add plugin layer type (take ownership) and return true on success
~QgsPluginLayerRegistry()
virtual ~QgsPluginLayerType()
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
QString pluginLayerType()
return plugin layer type (the same as used in QgsPluginLayerRegistry)
virtual bool showLayerProperties(QgsPluginLayer *layer)
show plugin layer properties dialog.
bool removePluginLayerType(QString typeName)
remove plugin layer type and return true on success
QStringList pluginLayerTypes()
list all known layer types
void removeMapLayers(QStringList theLayerIds)
Remove a set of layers from the registry.
const QMap< QString, QgsMapLayer * > & mapLayers()
Retrieve the mapLayers collection (mainly intended for use by projection)
static QgsPluginLayerRegistry * instance()
means of accessing canonical single instance
class for creating plugin specific layers