1
/***************************************************************************
2
qgsrenderer.h - description
5
copyright : (C) 2003 by Gary E.Sherman
6
email : sherman at mrcc.com
7
***************************************************************************/
9
/***************************************************************************
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. *
16
***************************************************************************/
17
/* $Id: qgsrenderitem.h 4502 2006-01-08 01:18:20Z timlinux $ */
18
#ifndef QGSRENDERITEM_H
19
#define QGSRENDERITEM_H
21
#include "qgssymbol.h"
27
/**A renderitem contains a symbol together with the attribute value for which it is valid and a label*/
30
/**Symbol to use in rendering the class*/
32
/**Value of the field*/
34
/**Label to use when rendering (may be same as value of field)*/
37
/**Default 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
44
QgsRenderItem(QgsSymbol* symbol, QString _value, QString _label);
46
virtual ~QgsRenderItem();
47
/** Gets the symbol associated with this render item
48
* @return QgsSymbol pointer
50
QgsSymbol* getSymbol();
51
/** Sets the label for the item
52
* @param label the string used as label
54
void setLabel(QString label);
55
/** Sets the symbol associated with this render item. The symbol is copied.
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 );
72
inline const QString& QgsRenderItem::value() const
77
#endif // QGSRENDERITEM_H