QGIS API Documentation 3.41.0-Master (af5edcb665c)
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_sip.h"
20#include "qgis.h"
21#include "qgis_gui.h"
23
24#include <QObject>
25#include <QList>
26#include <QMap>
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
54 void addMapLayerAction( QgsMapLayerAction *action );
55
61 QList<QgsMapLayerAction *> mapLayerActions( QgsMapLayer *layer, Qgis::MapLayerActionTargets targets = Qgis::MapLayerActionTarget::AllActions, const QgsMapLayerActionContext &context = QgsMapLayerActionContext() );
62
64 bool removeMapLayerAction( QgsMapLayerAction *action );
65
67 void setDefaultActionForLayer( QgsMapLayer *layer, QgsMapLayerAction *action );
69 QgsMapLayerAction *defaultActionForLayer( QgsMapLayer *layer );
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:4368
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.
This class tracks map layer actions.
void changed()
Triggered when an action is added or removed from the registry.
QList< QgsMapLayerAction * > mMapLayerActionList
An action which can run on map layers The class can be used in two manners:
Base class for all map layer types.
Definition qgsmaplayer.h:76