QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgslayertreeviewdefaultactions.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayertreeviewdefaultactions.h
3  --------------------------------------
4  Date : May 2014
5  Copyright : (C) 2014 by Martin Dobias
6  Email : wonder dot sk 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 QGSLAYERTREEVIEWDEFAULTACTIONS_H
17 #define QGSLAYERTREEVIEWDEFAULTACTIONS_H
18 
19 #include <QObject>
20 
21 class QAction;
22 
23 class QgsLayerTreeGroup;
24 class QgsLayerTreeView;
25 class QgsMapCanvas;
26 class QgsMapLayer;
27 
28 
36 class GUI_EXPORT QgsLayerTreeViewDefaultActions : public QObject
37 {
38  Q_OBJECT
39  public:
41 
42  QAction* actionAddGroup( QObject* parent = 0 );
43  QAction* actionRemoveGroupOrLayer( QObject* parent = 0 );
44  QAction* actionShowInOverview( QObject* parent = 0 );
45  QAction* actionRenameGroupOrLayer( QObject* parent = 0 );
46  QAction* actionShowFeatureCount( QObject* parent = 0 );
47 
48  QAction* actionZoomToLayer( QgsMapCanvas* canvas, QObject* parent = 0 );
49  QAction* actionZoomToGroup( QgsMapCanvas* canvas, QObject* parent = 0 );
50  // TODO: zoom to selected
51 
52  QAction* actionMakeTopLevel( QObject* parent = 0 );
53  QAction* actionGroupSelected( QObject* parent = 0 );
54 
55  void zoomToLayer( QgsMapCanvas* canvas );
56  void zoomToGroup( QgsMapCanvas* canvas );
57 
58  public slots:
59  void showInOverview();
60 
61  protected slots:
62  void addGroup();
63  void removeGroupOrLayer();
64  void renameGroupOrLayer();
65  void showFeatureCount();
66  void zoomToLayer();
67  void zoomToGroup();
68  void makeTopLevel();
69  void groupSelected();
70 
71  protected:
72  void zoomToLayers( QgsMapCanvas* canvas, const QList<QgsMapLayer*>& layers );
73 
74  QString uniqueGroupName( QgsLayerTreeGroup* parentGroup );
75 
76  protected:
78 };
79 
80 
81 #endif // QGSLAYERTREEVIEWDEFAULTACTIONS_H
Layer tree group node serves as a container for layers and further groups.
Base class for all map layer types.
Definition: qgsmaplayer.h:48
The QgsLayerTreeView class extends QTreeView and provides some additional functionality when working ...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:104
The QgsLayerTreeViewDefaultActions class serves as a factory of actions that can be used together wit...