00001 /*************************************************************************** 00002 ** 00003 ** This file is part of SciFigs. 00004 ** 00005 ** This library is free software; you can redistribute it and/or 00006 ** modify it under the terms of the GNU Lesser General Public 00007 ** License as published by the Free Software Foundation; either 00008 ** version 2.1 of the License, or (at your option) any later version. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00013 ** License for more details. 00014 ** 00015 ** You should have received a copy of the GNU Lesser General Public 00016 ** License along with this library; if not, write to the Free Software 00017 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 ** 00019 ** See http://www.geopsy.org for more information. 00020 ** 00021 ** Created : 2002-10-03 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (ULg, Liège, Belgium) 00025 ** Marc Wathelet (LGIT, Grenoble, France) 00026 ** 00027 ***************************************************************************/ 00028 00029 #ifndef LEGENDITEM_H 00030 #define LEGENDITEM_H 00031 00032 #include "Pen.h" 00033 #include "Symbol.h" 00034 #include "SciFigsDLLExport.h" 00035 00036 namespace SciFigs { 00037 00038 class SCIFIGS_EXPORT LegendItem : public XMLClass 00039 { 00040 public: 00041 LegendItem() {} 00042 inline LegendItem(const QString& t, const Pen& p, const Symbol& s); 00043 virtual ~LegendItem() {} 00044 00045 LegendItem& operator=(const LegendItem& o); 00046 bool operator==(const LegendItem& o) const; 00047 bool operator!=(const LegendItem& o) const {return !operator==(o);} 00048 00049 virtual const QString& xml_tagName() const {return xmlLegendItemTag;} 00050 static const QString xmlLegendItemTag; 00051 00052 const QString& text() const {return _text;} 00053 const QColor& textColor() const {return _textColor;} 00054 Pen& pen() {return _pen;} 00055 const Pen& pen() const {return _pen;} 00056 Symbol& symbol() {return _symbol;} 00057 const Symbol& symbol() const {return _symbol;} 00058 void setText(const QString& t) {_text=t;} 00059 void setTextColor(const QColor& c) {_textColor=c;} 00060 void setPen(const Pen& p) {_pen=p;} 00061 void setSymbol(const Symbol& s) {_symbol=s;} 00062 protected: 00063 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const; 00064 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const; 00065 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS); 00066 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00067 protected: 00068 QString _text; 00069 QColor _textColor; 00070 Pen _pen; 00071 Symbol _symbol; 00072 }; 00073 00074 inline LegendItem::LegendItem(const QString& t, const Pen& p, const Symbol& s) 00075 { 00076 TRACE; 00077 _text=t; 00078 _pen=p; 00079 _symbol=s; 00080 } 00081 00082 00083 } // namespace SciFigs 00084 00085 #endif // LEGENDITEM_H