1
/***************************************************************************
2
* Copyright (C) 2005 by Tim Sutton *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
20
#ifndef QGSLEGENDLAYER_H
21
#define QGSLEGENDLAYER_H
23
//#include <qobject.h>
24
#include <qgslegenditem.h>
28
class QgsLegendLayerFile;
29
class QgsLegendPropertyGroup;
34
Container for layer, including layer file(s), symbology class breaks and properties
38
class QgsLegendLayer : public QgsLegendItem
41
QgsLegendLayer(QTreeWidgetItem * ,QString);
42
QgsLegendLayer(QTreeWidget* ,QString);
43
QgsLegendLayer(QString name);
45
/**Sets an icon characterising the type of layer(s) it contains.
46
Note: cannot be in the constructor because layers are added after creation*/
47
void setLayerTypeIcon();
49
QgsLegendItem::DRAG_ACTION accept(LEGEND_ITEM_TYPE type);
50
QgsLegendItem::DRAG_ACTION accept(const QgsLegendItem* li) const;
51
/**Returns the map layer associated with the first QgsLegendLayerFile or 0 if
52
there is no QgsLegendLayerFile*/
53
QgsMapLayer* firstMapLayer() const;
54
/**Returns the map layers associated with the QgsLegendLayerFiles*/
55
std::list<QgsMapLayer*> mapLayers();
56
/**Returns the legend layer file items associated with this legend layer*/
57
std::list<QgsLegendLayerFile*> legendLayerFiles();
58
/**Copies the symbology settings of the layer to all maplayers in the QgsLegendLayerFileGroup.
59
This method should be called whenever a layer in this group changes it symbology settings
60
(normally from QgsMapLayer::refreshLegend)*/
61
void updateLayerSymbologySettings(const QgsMapLayer* mapLayer);
62
/**Goes through all the legendlayerfiles and sets check state to checked/partially checked/unchecked*/
63
void updateCheckState();
64
/**Goes through all the legendlayerfiles and adds editing/overview pixmaps to the icon. If not all layer files
65
have the same editing/overview state, a tristate is applied*/
68
QPixmap getOriginalPixmap() const;