QGIS API Documentation
3.41.0-Master (181b2f43d8e)
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
:
45
52
QgsMapLayerActionRegistry
( QObject *parent =
nullptr
);
53
55
void
addMapLayerAction(
QgsMapLayerAction
*action );
56
62
QList<QgsMapLayerAction *> mapLayerActions(
QgsMapLayer
*layer,
Qgis::MapLayerActionTargets
targets =
Qgis::MapLayerActionTarget::AllActions
,
const
QgsMapLayerActionContext
&context =
QgsMapLayerActionContext
() );
63
65
bool
removeMapLayerAction(
QgsMapLayerAction
*action );
66
68
void
setDefaultActionForLayer(
QgsMapLayer
*layer,
QgsMapLayerAction
*action );
70
QgsMapLayerAction
*defaultActionForLayer(
QgsMapLayer
*layer );
71
72
protected
:
73
74
QList< QgsMapLayerAction * >
mMapLayerActionList
;
75
76
signals:
78
void
changed
();
79
80
private
:
81
82
QMap< QgsMapLayer *, QgsMapLayerAction * > mDefaultLayerActionMap;
83
84
};
85
86
#endif
// QGSMAPLAYERACTIONREGISTRY_H
Qgis::MapLayerActionTargets
QFlags< MapLayerActionTarget > MapLayerActionTargets
Map layer action targets.
Definition
qgis.h:4350
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:74
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 Tue Dec 3 2024 21:45:57 for QGIS API Documentation by
1.9.8