2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
class QgsPluginLayerType
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgspluginlayerregistry.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsPluginLayerType( const QString &name );
|
2010-01-26 15:43:54 +00:00
|
|
|
virtual ~QgsPluginLayerType();
|
|
|
|
|
|
|
|
QString name();
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return new layer of this type. Return NULL on error */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsPluginLayer *createLayer() /Factory/;
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return new layer of this type, using layer URI (specific to this plugin layer type). Return NULL on error.
|
2015-03-18 14:17:32 +07:00
|
|
|
* @note added in 2.10
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QgsPluginLayer *createLayer( const QString &uri ) /Factory/;
|
2015-03-18 14:17:32 +07:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Show plugin layer properties dialog. Return false if the dialog cannot be shown. */
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool showLayerProperties( QgsPluginLayer *layer );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
//=============================================================================
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
/** \ingroup core
|
|
|
|
a registry of plugin layers types
|
|
|
|
*/
|
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:
|
|
|
|
|
2016-12-28 16:09:05 +10:00
|
|
|
QgsPluginLayerRegistry();
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
~QgsPluginLayerRegistry();
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** List all known layer types
|
2013-10-08 17:57:54 +07:00
|
|
|
* \note added in v2.1 */
|
|
|
|
QStringList pluginLayerTypes();
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Add plugin layer type (take ownership) and return true on success */
|
2017-05-01 16:42:33 +02:00
|
|
|
bool addPluginLayerType( QgsPluginLayerType *pluginLayerType /Transfer/ );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Remove plugin layer type and return true on success */
|
2017-05-01 16:42:33 +02:00
|
|
|
bool removePluginLayerType( const QString &typeName );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return plugin layer type metadata or NULL if doesn't exist */
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsPluginLayerType *pluginLayerType( const QString &typeName );
|
2010-01-26 15:43:54 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Return new layer if corresponding plugin has been found, else return NULL.
|
2015-03-18 14:17:32 +07:00
|
|
|
* @note optional param uri added in 2.10
|
|
|
|
*/
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsPluginLayer *createLayer( const QString &typeName, const QString &uri = QString() ) /Factory/;
|
2010-01-26 15:43:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsPluginLayerRegistry( const QgsPluginLayerRegistry &rh );
|
2016-01-22 18:45:45 +11:00
|
|
|
|
2010-01-26 15:43:54 +00:00
|
|
|
};
|