GeopsyGui/PickFormat.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyGui.
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 : 2008-06-10
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef PICKFORMAT_H
00029 #define PICKFORMAT_H
00030 
00031 #include <QGpGuiTools.h>
00032 
00033 #include "GeopsyGuiDLLExport.h"
00034 
00035 namespace GeopsyGui {
00036 
00037   class GEOPSYGUI_EXPORT PickFormat : public XMLClass
00038 {
00039 public:
00040   PickFormat() {}
00041   PickFormat(const PickFormat& o);
00042 
00043   virtual const QString& xml_tagName() const {return xmlPickFormatTag;}
00044   static const QString xmlPickFormatTag;
00045 
00046   QList<int> indexList() const {return _formats.keys();}
00047 
00048   bool isVisible(const QString& pickName) const;
00049   QColor color(const QString& pickName) const;
00050 
00051   void setVisible(const QString& pickName, bool v);
00052   void setColor(const QString& pickName, const QColor& c);
00053 protected:
00054   virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00055   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00056   virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00057 private:
00058   class Format {
00059   public:
00060     Format(bool v=false, QColor c=Qt::blue) {visible=v;color=c;}
00061     Format(const Format& o) {visible=o.visible;color=o.color;}
00062 
00063     bool visible;
00064     QColor color;
00065   };
00066 
00067   QMap<int, Format> _formats;
00068 };
00069 
00070 } // namespace GeopsyGui
00071 
00072 #endif // PICKFORMAT_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines