2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
class QgsPluginLayerType
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgspluginlayerregistry.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsPluginLayerType( QString name );
|
2010-01-26 15:43:54 +00:00
|
|
|
virtual ~QgsPluginLayerType();
|
|
|
|
|
|
|
|
QString name();
|
|
|
|
|
|
|
|
/** return new layer of this type. Return NULL on error */
|
|
|
|
virtual QgsPluginLayer* createLayer() /Factory/;
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** show plugin layer properties dialog. Return false if the dialog cannot be shown. */
|
|
|
|
virtual bool showLayerProperties( QgsPluginLayer* layer );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class QgsPluginLayerRegistry
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgspluginlayerregistry.h"
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2010-01-26 15:43:54 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
/** means of accessing canonical single instance */
|
|
|
|
static QgsPluginLayerRegistry* instance();
|
|
|
|
|
|
|
|
~QgsPluginLayerRegistry();
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** add plugin layer type (take ownership) and return true on success */
|
|
|
|
bool addPluginLayerType( QgsPluginLayerType* pluginLayerType /Transfer/ );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** remove plugin layer type and return true on success */
|
|
|
|
bool removePluginLayerType( QString typeName );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
/** return plugin layer type metadata or NULL if doesn't exist */
|
|
|
|
QgsPluginLayerType* pluginLayerType(QString typeName);
|
|
|
|
|
|
|
|
/** return new layer if corresponding plugin has been found, else return NULL */
|
2012-09-24 22:40:15 +02:00
|
|
|
QgsPluginLayer* createLayer(QString typeName) /Factory/;
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/** private since instance() creates it */
|
|
|
|
QgsPluginLayerRegistry();
|
|
|
|
};
|