QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
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.h
"
20
#include "qgis_gui.h"
21
#include "
qgis_sip.h
"
22
#include "
qgsmaplayeractioncontext.h
"
23
24
#include <QList>
25
#include <QMap>
26
#include <QObject>
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
(
62
QgsMapLayer
*layer,
Qgis::MapLayerActionTargets
targets =
Qgis::MapLayerActionTarget::AllActions
,
const
QgsMapLayerActionContext
&context =
QgsMapLayerActionContext
()
63
);
64
66
bool
removeMapLayerAction
(
QgsMapLayerAction
*action );
67
69
void
setDefaultActionForLayer
(
QgsMapLayer
*layer,
QgsMapLayerAction
*action );
71
QgsMapLayerAction
*
defaultActionForLayer
(
QgsMapLayer
*layer );
72
73
protected
:
74
QList<QgsMapLayerAction *>
mMapLayerActionList
;
75
76
signals:
78
void
changed
();
79
80
private
:
81
QMap<QgsMapLayer *, QgsMapLayerAction *> mDefaultLayerActionMap;
82
};
83
84
#endif
// QGSMAPLAYERACTIONREGISTRY_H
Qgis::MapLayerActionTargets
QFlags< MapLayerActionTarget > MapLayerActionTargets
Map layer action targets.
Definition
qgis.h:5180
Qgis::MapLayerActionTarget::AllActions
@ AllActions
Definition
qgis.h:5169
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsMapLayerActionContext
Encapsulates the context in which a QgsMapLayerAction action is executed.
Definition
qgsmaplayeractioncontext.h:34
QgsMapLayerActionRegistry::addMapLayerAction
void addMapLayerAction(QgsMapLayerAction *action)
Adds a map layer action to the registry.
Definition
qgsmaplayeractionregistry.cpp:26
QgsMapLayerActionRegistry::changed
void changed()
Triggered when an action is added or removed from the registry.
QgsMapLayerActionRegistry::removeMapLayerAction
bool removeMapLayerAction(QgsMapLayerAction *action)
Removes a map layer action from the registry.
Definition
qgsmaplayeractionregistry.cpp:54
QgsMapLayerActionRegistry::QgsMapLayerActionRegistry
QgsMapLayerActionRegistry(QObject *parent=nullptr)
Constructor for QgsMapLayerActionRegistry.
Definition
qgsmaplayeractionregistry.cpp:22
QgsMapLayerActionRegistry::setDefaultActionForLayer
void setDefaultActionForLayer(QgsMapLayer *layer, QgsMapLayerAction *action)
Sets the default action for a layer.
Definition
qgsmaplayeractionregistry.cpp:76
QgsMapLayerActionRegistry::defaultActionForLayer
QgsMapLayerAction * defaultActionForLayer(QgsMapLayer *layer)
Returns the default action for a layer.
Definition
qgsmaplayeractionregistry.cpp:81
QgsMapLayerActionRegistry::mapLayerActions
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.
Definition
qgsmaplayeractionregistry.cpp:32
QgsMapLayerActionRegistry::mMapLayerActionList
QList< QgsMapLayerAction * > mMapLayerActionList
Definition
qgsmaplayeractionregistry.h:74
QgsMapLayerAction
An action which can run on map layers.
Definition
qgsmaplayeraction.h:44
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
qgis.h
qgis_sip.h
qgsmaplayeractioncontext.h
Generated on
for QGIS API Documentation by
1.17.0