QGIS/python/core/qgspluginlayerregistry.sip
wonder 8f32f25a90 [FEATURE] Support for custom plugin layers. Applied patch from #2392 contributed by Mathias Walker. Thanks!
Some parts modified to make plugin layers easier to use and more robust.


git-svn-id: http://svn.osgeo.org/qgis/trunk@12834 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-01-26 15:43:54 +00:00

53 lines
1.3 KiB
Plaintext

class QgsPluginLayerType
{
%TypeHeaderCode
#include "qgspluginlayerregistry.h"
%End
public:
QgsPluginLayerType(QString name);
virtual ~QgsPluginLayerType();
QString name();
/** return new layer of this type. Return NULL on error */
virtual QgsPluginLayer* createLayer() /Factory/;
/** show plugin layer properties dialog. Return FALSE if the dialog cannot be shown. */
virtual bool showLayerProperties(QgsPluginLayer* layer);
};
class QgsPluginLayerRegistry
{
%TypeHeaderCode
#include "qgspluginlayerregistry.h"
%End
public:
/** means of accessing canonical single instance */
static QgsPluginLayerRegistry* instance();
~QgsPluginLayerRegistry();
/** add plugin layer type (take ownership) and return TRUE on success */
bool addPluginLayerType(QgsPluginLayerType* pluginLayerType /Transfer/);
/** remove plugin layer type and return TRUE on success */
bool removePluginLayerType(QString typeName);
/** 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 */
// to be resolved
//QgsPluginLayer* createLayer(QString typeName);
private:
/** private since instance() creates it */
QgsPluginLayerRegistry();
};