~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/legend/qgslegendlayer.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2005 by Tim Sutton   *
3
 
 *   aps02ts@macbuntu   *
4
 
 *                                                                         *
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.                                   *
9
 
 *                                                                         *
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.                          *
14
 
 *                                                                         *
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
22
 
 
23
 
//#include <qobject.h>
24
 
#include <qgslegenditem.h>
25
 
#include <QFileInfo>
26
 
 
27
 
class QgsLegendLayer;
28
 
class QgsLegendLayerFile;
29
 
class QgsLegendPropertyGroup;
30
 
class QgsMapLayer;
31
 
class QTreeWidget;
32
 
 
33
 
/**
34
 
Container for layer, including layer file(s), symbology class breaks and properties
35
 
 
36
 
@author Tim Sutton
37
 
*/
38
 
class QgsLegendLayer : public QgsLegendItem
39
 
{
40
 
public:
41
 
    QgsLegendLayer(QTreeWidgetItem * ,QString);
42
 
    QgsLegendLayer(QTreeWidget* ,QString);
43
 
    QgsLegendLayer(QString name);
44
 
    ~QgsLegendLayer();
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();
48
 
    bool isLeafNode();
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*/
66
 
    void updateIcon();
67
 
 protected:
68
 
    QPixmap getOriginalPixmap() const;
69
 
};
70
 
 
71
 
#endif