16 #ifndef QGSMAPLAYERACTIONREGISTRY_H 17 #define QGSMAPLAYERACTIONREGISTRY_H 44 AllActions = Layer | SingleFeature | MultipleFeatures
46 Q_DECLARE_FLAGS( Targets,
Target )
55 EnabledOnlyWhenEditable = 1 << 1,
62 Q_DECLARE_FLAGS( Flags,
Flag )
69 QgsMapLayerAction(
const QString &name, QObject *parent
SIP_TRANSFERTHIS, Targets targets = AllActions,
const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags =
nullptr );
72 QgsMapLayerAction(
const QString &name, QObject *parent SIP_TRANSFERTHIS,
QgsMapLayer *layer, Targets targets = AllActions,
const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags =
nullptr );
75 QgsMapLayerAction(
const QString &name, QObject *parent SIP_TRANSFERTHIS,
QgsMapLayer::LayerType layerType, Targets targets = AllActions,
const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags =
nullptr );
83 QgsMapLayerAction::Flags flags()
const;
89 void triggerForFeatures(
QgsMapLayer *layer,
const QList<QgsFeature> &featureList );
100 const Targets &
targets()
const {
return mTargets;}
106 bool isEnabledOnlyWhenEditable()
const;
110 void triggeredForFeatures(
QgsMapLayer *layer,
const QList<QgsFeature> &featureList );
121 bool mSingleLayer =
false;
126 bool mSpecificLayerType =
false;
131 Targets mTargets =
nullptr;
133 QgsMapLayerAction::Flags mFlags =
nullptr;
136 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayerAction::Targets )
183 QMap< QgsMapLayer *, QgsMapLayerAction * > mDefaultLayerActionMap;
187 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapLayerAction::Flags )
189 #endif // QGSMAPLAYERACTIONREGISTRY_H void setTargets(Targets targets)
Define the targets of the action.
Base class for all map layer types.
QList< QgsMapLayerAction *> mMapLayerActionList
Flag
Flags which control action behavior /since QGIS 3.0.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
LayerType
Types of layers that can be added to a map.
This class tracks map layer actions.
const Targets & targets() const
Returns availibity of action.
An action which can run on map layers.