~ubuntu-branches/ubuntu/warty/qgis/warty

« back to all changes in this revision

Viewing changes to src/qgslegenditem.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 13:34:17 UTC
  • Revision ID: james.westby@ubuntu.com-20040824133417-yugh3agyi5o74m29
Tags: upstream-0.3.0
ImportĀ upstreamĀ versionĀ 0.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/***************************************************************************
 
3
                          qgslegenditem.h  -  description
 
4
                             -------------------
 
5
    begin                : Sun Jul 28 2002
 
6
    copyright            : (C) 2002 by Gary E.Sherman
 
7
    email                : sherman at mrcc dot com
 
8
        Romans 3:23=>Romans 6:23=>Romans 5:8=>Romans 10:9,10=>Romans 12
 
9
***************************************************************************/
 
10
 
 
11
/***************************************************************************
 
12
 *                                                                         *
 
13
 *   This program is free software; you can redistribute it and/or modify  *
 
14
 *   it under the terms of the GNU General Public License as published by  *
 
15
 *   the Free Software Foundation; either version 2 of the License, or     *
 
16
 *   (at your option) any later version.                                   *
 
17
 *                                                                         *
 
18
 ***************************************************************************/
 
19
/* $Id */
 
20
 
 
21
#ifndef QGSLEGENDITEM_H
 
22
#define QGSLEGENDITEM_H
 
23
 
 
24
#include <qlistview.h>
 
25
 
 
26
class QgsMapLayer;
 
27
class QgsSymbol;
 
28
 
 
29
 
 
30
/**
 
31
 * \class QgsLegendItem
 
32
 * \brief An item in a QgsLegend
 
33
 
 
34
 *@author Gary E.Sherman
 
35
 */
 
36
 
 
37
class QgsLegendItem : public QCheckListItem
 
38
{
 
39
public:
 
40
 
 
41
    /*! Constructor
 
42
     * @param lyr Map layer this legend item represents
 
43
     * @param parent The parent listview
 
44
     */
 
45
    QgsLegendItem(QgsMapLayer * lyr = 0, QListView * parent = 0);
 
46
 
 
47
    //! Destructor
 
48
    virtual ~QgsLegendItem();
 
49
 
 
50
    /** Write property of QString layerName. */
 
51
    virtual void setLayerName(const QString & _newVal);
 
52
 
 
53
    /** Write property of QString displayName. */
 
54
    // DEPRECATED? virtual void setDisplayName(const QString & _newVal);
 
55
 
 
56
    /*! Responds to changes in the layer state (eg. visible vs non visible)
 
57
     *@param v True if layer is visible
 
58
     */
 
59
    void stateChange(bool v);
 
60
 
 
61
    /*! Gets the layer associated with this legend item
 
62
     * @return Pointer to the layer
 
63
     */
 
64
    virtual QgsMapLayer *layer();
 
65
 
 
66
    /** returns layer ID of associated map layer 
 
67
     */
 
68
    QString layerID() const;
 
69
 
 
70
    /** sets check box state and consequently the visibility of corresponding map layer */
 
71
    void setOn( bool );
 
72
 
 
73
private:                       // Private attributes
 
74
 
 
75
    /**  */
 
76
    QgsMapLayer * m_layer;
 
77
 
 
78
    QgsSymbol *symbol;
 
79
 
 
80
public:                        // Public attributes
 
81
 
 
82
    /**  This is the name as rendered in the legend item pixmap */
 
83
    // DEPRECATED? QString displayName;
 
84
 
 
85
    /**  The layer name as stored originaly in the dataset */
 
86
    QString layerName;
 
87
};
 
88
 
 
89
#endif