QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Signals | Public Member Functions | Private Attributes | List of all members
QgsMapLayerAction Class Reference

An action which can run on map layers. More...

#include <qgsmaplayeractionregistry.h>

Inheritance diagram for QgsMapLayerAction:
Inheritance graph
[legend]
Collaboration diagram for QgsMapLayerAction:
Collaboration graph
[legend]

Public Types

enum  AvailabityFlag { Layer = 1, Feature = 2, LayerAndFeature = Layer | Feature }
 

Signals

void triggeredForFeature (QgsMapLayer *layer, QgsFeature *feature)
 Triggered when action has been run for a specific feature. More...
 
void triggeredForLayer (QgsMapLayer *layer)
 Triggered when action has been run for a specific layer. More...
 

Public Member Functions

 QgsMapLayerAction (QString name, QObject *parent, Availability availability=LayerAndFeature)
 Creates a map layer action which can run on any layer. More...
 
 QgsMapLayerAction (QString name, QObject *parent, QgsMapLayer *layer, Availability availability=LayerAndFeature)
 Creates a map layer action which can run only on a specific layer. More...
 
 QgsMapLayerAction (QString name, QObject *parent, QgsMapLayer::LayerType layerType, Availability availability=LayerAndFeature)
 Creates a map layer action which can run on a specific type of layer. More...
 
 ~QgsMapLayerAction ()
 
bool canRunUsingLayer (QgsMapLayer *layer) const
 True if action can run using the specified layer. More...
 
void triggerForFeature (QgsMapLayer *layer, QgsFeature *feature)
 Triggers the action with the specified layer and feature. More...
 
void triggerForLayer (QgsMapLayer *layer)
 Triggers the action with the specified layer. More...
 
void setAvailability (Availability availability)
 Define the availibility of the action. More...
 
Availability availability () const
 Return availibity of action. More...
 

Private Attributes

bool mSingleLayer
 
QgsMapLayermActionLayer
 
bool mSpecificLayerType
 
QgsMapLayer::LayerType mLayerType
 
Availability mAvailability
 

Detailed Description

An action which can run on map layers.

Definition at line 31 of file qgsmaplayeractionregistry.h.

Member Enumeration Documentation

Enumerator
Layer 
Feature 
LayerAndFeature 

Definition at line 37 of file qgsmaplayeractionregistry.h.

Constructor & Destructor Documentation

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject *  parent,
Availability  availability = LayerAndFeature 
)

Creates a map layer action which can run on any layer.

Definition at line 19 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject *  parent,
QgsMapLayer layer,
Availability  availability = LayerAndFeature 
)

Creates a map layer action which can run only on a specific layer.

Definition at line 28 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::QgsMapLayerAction ( QString  name,
QObject *  parent,
QgsMapLayer::LayerType  layerType,
Availability  availability = LayerAndFeature 
)

Creates a map layer action which can run on a specific type of layer.

Definition at line 37 of file qgsmaplayeractionregistry.cpp.

QgsMapLayerAction::~QgsMapLayerAction ( )

Member Function Documentation

Availability QgsMapLayerAction::availability ( ) const
inline

Return availibity of action.

Definition at line 67 of file qgsmaplayeractionregistry.h.

bool QgsMapLayerAction::canRunUsingLayer ( QgsMapLayer layer) const

True if action can run using the specified layer.

Definition at line 52 of file qgsmaplayeractionregistry.cpp.

References mActionLayer, mLayerType, mSingleLayer, mSpecificLayerType, and QgsMapLayer::type().

void QgsMapLayerAction::setAvailability ( Availability  availability)
inline

Define the availibility of the action.

Definition at line 65 of file qgsmaplayeractionregistry.h.

void QgsMapLayerAction::triggeredForFeature ( QgsMapLayer layer,
QgsFeature feature 
)
signal

Triggered when action has been run for a specific feature.

Referenced by triggerForFeature().

void QgsMapLayerAction::triggeredForLayer ( QgsMapLayer layer)
signal

Triggered when action has been run for a specific layer.

Referenced by triggerForLayer().

void QgsMapLayerAction::triggerForFeature ( QgsMapLayer layer,
QgsFeature feature 
)

Triggers the action with the specified layer and feature.

This also emits the triggeredForLayer( QgsMapLayer *) and triggered() slots

Definition at line 75 of file qgsmaplayeractionregistry.cpp.

References triggeredForFeature(), and triggerForLayer().

Referenced by QgsAttributeTableModel::executeMapLayerAction().

void QgsMapLayerAction::triggerForLayer ( QgsMapLayer layer)

Triggers the action with the specified layer.

This also emits the triggered() slot.

Definition at line 82 of file qgsmaplayeractionregistry.cpp.

References triggeredForLayer().

Referenced by triggerForFeature().

Member Data Documentation

QgsMapLayer* QgsMapLayerAction::mActionLayer
private

Definition at line 81 of file qgsmaplayeractionregistry.h.

Referenced by canRunUsingLayer().

Availability QgsMapLayerAction::mAvailability
private

Definition at line 89 of file qgsmaplayeractionregistry.h.

QgsMapLayer::LayerType QgsMapLayerAction::mLayerType
private

Definition at line 86 of file qgsmaplayeractionregistry.h.

Referenced by canRunUsingLayer().

bool QgsMapLayerAction::mSingleLayer
private

Definition at line 79 of file qgsmaplayeractionregistry.h.

Referenced by canRunUsingLayer().

bool QgsMapLayerAction::mSpecificLayerType
private

Definition at line 84 of file qgsmaplayeractionregistry.h.

Referenced by canRunUsingLayer().


The documentation for this class was generated from the following files: