QGIS API Documentation
3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
src
gui
actions
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"
22
#include "
qgsmaplayeractioncontext.h
"
23
24
#include <QObject>
25
#include <QList>
26
#include <QMap>
27
28
class
QgsFeature
;
29
class
QgsMapLayer
;
30
class
QgsMapLayerAction
;
31
32
40
class
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
Qgis::MapLayerActionTargets
QFlags< MapLayerActionTarget > MapLayerActionTargets
Map layer action targets.
Definition
qgis.h:4368
Qgis::MapLayerActionTarget::AllActions
@ AllActions
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:58
QgsMapLayerActionContext
Encapsulates the context in which a QgsMapLayerAction action is executed.
Definition
qgsmaplayeractioncontext.h:34
QgsMapLayerActionRegistry
This class tracks map layer actions.
Definition
qgsmaplayeractionregistry.h:41
QgsMapLayerActionRegistry::changed
void changed()
Triggered when an action is added or removed from the registry.
QgsMapLayerActionRegistry::mMapLayerActionList
QList< QgsMapLayerAction * > mMapLayerActionList
Definition
qgsmaplayeractionregistry.h:72
QgsMapLayerAction
An action which can run on map layers The class can be used in two manners:
Definition
qgsmaplayeraction.h:42
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:76
qgis.h
qgis_sip.h
qgsmaplayeractioncontext.h
Generated on Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8