61 if ( _instance == NULL )
69 QgsPluginLayerRegistry::QgsPluginLayerRegistry()
75 if ( !mPluginLayerTypes.
isEmpty() )
77 QgsDebugMsg(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" );
78 foreach (
QString typeName, mPluginLayerTypes.
keys() )
85 return mPluginLayerTypes.
keys();
95 mPluginLayerTypes[type->
name()] = type;
102 if ( !mPluginLayerTypes.
contains( typeName ) )
120 delete mPluginLayerTypes.
take( typeName );
126 return mPluginLayerTypes.
value( typeName, NULL );
135 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.
QgsMapLayer::LayerType type() const
Get the type of the layer.
bool contains(const Key &key) const
a registry of plugin layers types
QList< T > values() const
Base class for plugin layers.
QgsPluginLayerType(QString name)
virtual QgsPluginLayer * createLayer()
return new layer of this type.
QgsPluginLayer * createLayer(QString typeName, const QString &uri=QString())
return new layer if corresponding plugin has been found, else return NULL.
QList< Key > keys() const
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
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
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
const T value(const Key &key) const
class for creating plugin specific layers