20 mSingleLayer( false ),
22 mSpecificLayerType( false )
30 mActionLayer( layer ),
31 mSpecificLayerType( false )
38 mSingleLayer( false ),
40 mSpecificLayerType( true ),
41 mLayerType( layerType )
124 QList< QgsMapLayerAction* > validActions;
125 QList<QgsMapLayerAction*>::iterator actionIt;
128 if (( *actionIt )->canRunUsingLayer( layer ) )
130 validActions.append(( *actionIt ) );
144 QMap<QgsMapLayer*, QgsMapLayerAction*>::iterator defaultIt;
147 if ( defaultIt.value() == action )
149 defaultIt.value() = 0;
QgsMapLayer * mActionLayer
QgsMapLayerAction * defaultActionForLayer(QgsMapLayer *layer)
Returns the default action for a layer.
Base class for all map layer types.
QgsMapLayer::LayerType type() const
Get the type of the layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
~QgsMapLayerActionRegistry()
void triggerForFeature(QgsMapLayer *layer, QgsFeature *feature)
Triggers the action with the specified layer and feature.
QMap< QgsMapLayer *, QgsMapLayerAction * > mDefaultLayerActionMap
QgsMapLayer::LayerType mLayerType
bool canRunUsingLayer(QgsMapLayer *layer) const
True if action can run using the specified layer.
void triggeredForLayer(QgsMapLayer *layer)
Triggered when action has been run for a specific layer.
LayerType
Layers enum defining the types of layers that can be added to a map.
QList< QgsMapLayerAction * > mapLayerActions(QgsMapLayer *layer)
Returns the map layer actions which can run on the specified layer.
void setDefaultActionForLayer(QgsMapLayer *layer, QgsMapLayerAction *action)
Sets the default action for a layer.
QList< QgsMapLayerAction * > mMapLayerActionList
void triggeredForFeature(QgsMapLayer *layer, QgsFeature *feature)
Triggered when action has been run for a specific feature.
void changed()
Triggered when an action is added or removed from the registry.
This class tracks map layer actions.
QgsMapLayerActionRegistry(QObject *parent=0)
protected constructor
QgsMapLayerAction(QString name, QObject *parent)
Creates a map layer action which can run on any layer.
void addMapLayerAction(QgsMapLayerAction *action)
Adds a map layer action to the registry.
static QgsMapLayerActionRegistry * instance()
Returns the instance pointer, creating the object on the first call.
bool removeMapLayerAction(QgsMapLayerAction *action)
Removes a map layer action from the registry.
static QgsMapLayerActionRegistry * mInstance
void triggerForLayer(QgsMapLayer *layer)
Triggers the action with the specified layer.
An action which can run on map layers.