~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/core/qgsrenderitem.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
 
                         qgsrenderer.h  -  description
3
 
                             -------------------
4
 
    begin                : Sat Jan 4 2003
5
 
    copyright            : (C) 2003 by Gary E.Sherman
6
 
    email                : sherman at mrcc.com
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
/* $Id: qgsrenderitem.h 4502 2006-01-08 01:18:20Z timlinux $ */
18
 
#ifndef QGSRENDERITEM_H
19
 
#define QGSRENDERITEM_H
20
 
#include <map>
21
 
#include "qgssymbol.h"
22
 
 
23
 
class QgsSymbol;
24
 
class QString;
25
 
 
26
 
 
27
 
/**A renderitem contains a symbol together with the attribute value for which it is valid and a label*/
28
 
class QgsRenderItem {
29
 
 protected:
30
 
    /**Symbol to use in rendering the class*/
31
 
    QgsSymbol* mSymbol;
32
 
    /**Value of the field*/
33
 
    QString mValue;
34
 
    /**Label to use when rendering (may be same as value of field)*/
35
 
    QString mLabel;
36
 
 public:
37
 
    /**Default Constructor*/
38
 
    QgsRenderItem();
39
 
     /** Constructor
40
 
    * @param symbol Symbol to use for rendering matching features. It needs to be constructed using the new-operator and is automatically deleted by QgsRenderItem
41
 
    * @param _value Value of the field
42
 
    * @param _label Label to use in the legend
43
 
    */
44
 
    QgsRenderItem(QgsSymbol* symbol, QString _value, QString _label);
45
 
    /**Destructor*/
46
 
    virtual ~QgsRenderItem();
47
 
    /** Gets the symbol associated with this render item
48
 
     * @return QgsSymbol pointer
49
 
     */
50
 
    QgsSymbol* getSymbol();
51
 
    /** Sets the label for the item
52
 
     * @param label the string used as label
53
 
     */
54
 
    void setLabel(QString label);
55
 
    /** Sets the symbol associated with this render item. The symbol is copied.
56
 
     * @param s Symbol
57
 
     */
58
 
    void setSymbol(QgsSymbol s);
59
 
    /** Sets a symbol object, which is allocated on the heap. QgsRenderItem automatically deletes it*/
60
 
    void setSymbol(QgsSymbol* s);
61
 
    void setValue(QString value);
62
 
    /**Returns the label*/
63
 
    const QString& label() const;
64
 
    /**Returns the value of the field*/
65
 
    const QString& value() const; 
66
 
    /**Writes the contents of the item to a configuration file
67
 
     @ return true in case of success*/
68
 
    virtual bool writeXML( QDomNode & parent, QDomDocument & document );
69
 
};
70
 
 
71
 
 
72
 
inline const QString& QgsRenderItem::value() const
73
 
{
74
 
    return mValue;
75
 
}
76
 
 
77
 
#endif // QGSRENDERITEM_H
78