Skip to content
Permalink
Browse files

fix QgsSymbolLayerV2Metadata sip bindings

  • Loading branch information
jef-n committed Sep 24, 2012
1 parent f99cf89 commit 86217d0a1ad3618a00885838a78b2be8342414b9
@@ -1,3 +1,5 @@
class QgsSymbolLayerV2Widget /External/;

typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMap& );
typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )( const QgsVectorLayer* );
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
@@ -36,28 +38,15 @@ class QgsSymbolLayerV2Metadata : QgsSymbolLayerV2AbstractMetadata
%End

public:
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );

QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2CreateFromSldFunc pfCreateFromSld,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );

QgsSymbolLayerV2CreateFunc createFunction() const;
QgsSymbolLayerV2WidgetFunc widgetFunction() const;
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const;

void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f );

virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) /Factory/;
virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVectorLayer* vl ) /Factory/;
virtual QgsSymbolLayerV2* createSymbolLayerFromSld( QDomElement& elem ) /Factory/;

private:
QgsSymbolLayerV2Metadata(); // pretend this is private
};


/**
Registry of available symbol layer classes.
Implemented as a singleton.
@@ -63,6 +63,7 @@ typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMetadata
{
public:
//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
@@ -73,6 +74,7 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( NULL )
{}

//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
@@ -84,10 +86,14 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( pfCreateFromSld )
{}

//! not available in python bindings
QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc; }
//! not available in python bindings
QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc; }
//! not available in python bindings
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const { return mCreateFromSldFunc; }

//! not available in python bindings
void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f ) { mWidgetFunc = f; }

virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) { return mCreateFunc ? mCreateFunc( map ) : NULL; }

0 comments on commit 86217d0

Please sign in to comment.
You can’t perform that action at this time.