61 if ( _instance == NULL )
69 QgsPluginLayerRegistry::QgsPluginLayerRegistry()
75 if ( !mPluginLayerTypes.
isEmpty() )
77 QgsDebugMsg(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" );
78 Q_FOREACH (
const 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 );
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.
bool removePluginLayerType(const QString &typeName)
Remove plugin layer type and return true on success.
QgsPluginLayerType(const QString &name)
void removeMapLayers(const QStringList &theLayerIds)
Remove a set of layers from the registry.
virtual QgsPluginLayer * createLayer()
Return new layer of this type.
QgsPluginLayerType * pluginLayerType(const QString &typeName)
Return plugin layer type metadata or NULL if doesn't exist.
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.
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QStringList pluginLayerTypes()
List all known layer types.
const QMap< QString, QgsMapLayer * > & mapLayers()
Retrieve the mapLayers collection (mainly intended for use by projection)
static QgsPluginLayerRegistry * instance()
Means of accessing canonical single instance.
QgsPluginLayer * createLayer(const QString &typeName, const QString &uri=QString())
Return new layer if corresponding plugin has been found, else return NULL.
const T value(const Key &key) const
class for creating plugin specific layers