QGIS/python/gui/qgsmaplayeractionregistry.sip.in

168 lines
4.8 KiB
Plaintext
Raw Normal View History

2017-05-23 14:49:24 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaplayeractionregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerAction : QAction
{
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
An action which can run on map layers
%End
2017-05-23 14:49:24 +02:00
%TypeHeaderCode
#include "qgsmaplayeractionregistry.h"
%End
public:
enum Target
{
Layer,
SingleFeature,
MultipleFeatures,
AllActions
};
typedef QFlags<QgsMapLayerAction::Target> Targets;
2017-05-23 14:49:24 +02:00
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, Targets targets = AllActions, const QIcon &icon = QIcon() );
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a map layer action which can run on any layer
2017-05-23 14:49:24 +02:00
.. note::
using AllActions as a target probably does not make a lot of sense. This default action was settled for API compatibility reasons.
%End
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, QgsMapLayer *layer, Targets targets = AllActions, const QIcon &icon = QIcon() );
2017-05-23 14:49:24 +02:00
%Docstring
Creates a map layer action which can run only on a specific layer
%End
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, QgsMapLayer::LayerType layerType, Targets targets = AllActions, const QIcon &icon = QIcon() );
2017-05-23 14:49:24 +02:00
%Docstring
Creates a map layer action which can run on a specific type of layer
%End
~QgsMapLayerAction();
bool canRunUsingLayer( QgsMapLayer *layer ) const;
2017-05-23 14:49:24 +02:00
%Docstring
True if action can run using the specified layer
%End
void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
2017-05-23 14:49:24 +02:00
%Docstring
Triggers the action with the specified layer and list of feature.
%End
void triggerForFeature( QgsMapLayer *layer, const QgsFeature *feature );
2017-05-23 14:49:24 +02:00
%Docstring
Triggers the action with the specified layer and feature.
%End
void triggerForLayer( QgsMapLayer *layer );
2017-05-23 14:49:24 +02:00
%Docstring
Triggers the action with the specified layer.
%End
void setTargets( Targets targets );
2017-05-23 14:49:24 +02:00
%Docstring
Define the targets of the action
%End
const Targets &targets() const;
2017-05-23 14:49:24 +02:00
%Docstring
Return availibity of action
%End
2014-08-17 13:37:26 +02:00
signals:
void triggeredForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
2017-05-23 14:49:24 +02:00
%Docstring
Triggered when action has been run for a specific list of features
%End
2014-09-17 09:18:53 +02:00
void triggeredForFeature( QgsMapLayer *layer, const QgsFeature &feature );
2017-05-23 14:49:24 +02:00
%Docstring
Triggered when action has been run for a specific feature
%End
void triggeredForLayer( QgsMapLayer *layer );
2017-05-23 14:49:24 +02:00
%Docstring
Triggered when action has been run for a specific layer
%End
};
QFlags<QgsMapLayerAction::Target> operator|(QgsMapLayerAction::Target f1, QFlags<QgsMapLayerAction::Target> f2);
2017-05-23 14:49:24 +02:00
class QgsMapLayerActionRegistry : QObject
{
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
This class tracks map layer actions.
2017-05-23 14:49:24 +02:00
2017-12-15 10:36:55 -04:00
QgsMapLayerActionRegistry is not usually directly created, but rather accessed through
2017-12-19 11:43:52 -04:00
:py:func:`QgsGui.mapLayerActionRegistry()`
%End
2017-05-23 14:49:24 +02:00
%TypeHeaderCode
#include "qgsmaplayeractionregistry.h"
%End
public:
QgsMapLayerActionRegistry( QObject *parent = 0 );
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsMapLayerActionRegistry.
2017-12-15 10:36:55 -04:00
QgsMapLayerActionRegistry is not usually directly created, but rather accessed through
2017-12-19 11:43:52 -04:00
:py:func:`QgsGui.mapLayerActionRegistry()`
2017-05-23 14:49:24 +02:00
%End
void addMapLayerAction( QgsMapLayerAction *action );
2017-05-23 14:49:24 +02:00
%Docstring
Adds a map layer action to the registry
%End
QList<QgsMapLayerAction *> mapLayerActions( QgsMapLayer *layer, QgsMapLayerAction::Targets targets = QgsMapLayerAction::AllActions );
2017-05-23 14:49:24 +02:00
%Docstring
Returns the map layer actions which can run on the specified layer
%End
bool removeMapLayerAction( QgsMapLayerAction *action );
2017-05-23 14:49:24 +02:00
%Docstring
Removes a map layer action from the registry
%End
void setDefaultActionForLayer( QgsMapLayer *layer, QgsMapLayerAction *action );
2017-05-23 14:49:24 +02:00
%Docstring
Sets the default action for a layer
%End
QgsMapLayerAction *defaultActionForLayer( QgsMapLayer *layer );
2017-05-23 14:49:24 +02:00
%Docstring
Returns the default action for a layer
%End
protected:
signals:
void changed();
2017-05-23 14:49:24 +02:00
%Docstring
Triggered when an action is added or removed from the registry
%End
};
2017-05-23 14:49:24 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaplayeractionregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/