QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmaplayeractionregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayeractionregistry.h
3 ---------------------------
4 begin : January 2014
5 copyright : (C) 2014 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMAPLAYERACTIONREGISTRY_H
17#define QGSMAPLAYERACTIONREGISTRY_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "qgis_sip.h"
23
24#include <QList>
25#include <QMap>
26#include <QObject>
27
28class QgsFeature;
29class QgsMapLayer;
31
32
40class GUI_EXPORT QgsMapLayerActionRegistry : public QObject
41{
42 Q_OBJECT
43
44 public:
51 QgsMapLayerActionRegistry( QObject *parent = nullptr );
52
55
62
65
70
71 protected:
72 QList<QgsMapLayerAction *> mMapLayerActionList;
73
74 signals:
76 void changed();
77
78 private:
79 QMap<QgsMapLayer *, QgsMapLayerAction *> mDefaultLayerActionMap;
80};
81
82#endif // QGSMAPLAYERACTIONREGISTRY_H
QFlags< MapLayerActionTarget > MapLayerActionTargets
Map layer action targets.
Definition qgis.h:4640
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Encapsulates the context in which a QgsMapLayerAction action is executed.
void addMapLayerAction(QgsMapLayerAction *action)
Adds a map layer action to the registry.
void changed()
Triggered when an action is added or removed from the registry.
bool removeMapLayerAction(QgsMapLayerAction *action)
Removes a map layer action from the registry.
QgsMapLayerActionRegistry(QObject *parent=nullptr)
Constructor for QgsMapLayerActionRegistry.
void setDefaultActionForLayer(QgsMapLayer *layer, QgsMapLayerAction *action)
Sets the default action for a layer.
QgsMapLayerAction * defaultActionForLayer(QgsMapLayer *layer)
Returns the default action for a layer.
QList< QgsMapLayerAction * > mapLayerActions(QgsMapLayer *layer, Qgis::MapLayerActionTargets targets=Qgis::MapLayerActionTarget::AllActions, const QgsMapLayerActionContext &context=QgsMapLayerActionContext())
Returns the map layer actions which can run on the specified layer.
QList< QgsMapLayerAction * > mMapLayerActionList
An action which can run on map layers.
Base class for all map layer types.
Definition qgsmaplayer.h:80