mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
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
53 lines
1.3 KiB
Plaintext
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();
|
|
};
|