STK++ 1.0
STK_Tool.h
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------*/
00002 /*     Copyright (C) 2004-2007  Serge Iovleff
00003 
00004  This program is free software; you can redistribute it and/or modify
00005  it under the terms of the GNU Lesser General Public License as
00006  published by the Free Software Foundation; either version 2 of the
00007  License, or (at your option) any later version.
00008 
00009  This program is distributed in the hope that it will be useful,
00010  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  GNU Lesser General Public License for more details.
00013 
00014  You should have received a copy of the GNU Lesser General Public
00015  License along with this program; if not, write to the
00016  Free Software Foundation, Inc.,
00017  59 Temple Place,
00018  Suite 330,
00019  Boston, MA 02111-1307
00020  USA
00021 
00022  Contact : Serge.Iovleff@stkpp.org
00023  */
00024 /*--------------------------------------------------------------------*/
00025 /* $Id: STK_Tool.h,v 1.1 2010/02/22 14:31:37 siovleff Exp $
00026  *
00027  * Project:  stkpp::gui::model
00028  * created on: 7 nov. 2009
00029  * Purpose:  .
00030  * Author:   iovleff, serge.iovleff@stkpp.org
00031  *
00032  * $Log: STK_Tool.h,v $
00033  * Revision 1.1  2010/02/22 14:31:37  siovleff
00034  * Adding Tool and Category class to the model
00035  *
00036  **/
00037 /*--------------------------------------------------------------------*/
00042 #ifndef STK_TOOL_H_
00043 #define STK_TOOL_H_
00044 
00045 #include "../../../projects/STKernel/include/STK_String.h"
00046 
00050 namespace STK
00051 {
00052 
00057 class Tool
00058 {
00059   public:
00063     enum Type
00064     {
00065       Default,
00066       Custom 
00067     };
00068 
00069   private:
00073     String name_;
00077     String xml_;
00081     String icon_name_;
00085     Type type_;
00086 
00087   public:
00096     Tool( String const& aname = String(),
00097           String const& xml = String(),
00098           String const& icon_name = String(),
00099           Type atype = Default);
00100 
00104     virtual ~Tool();
00105 
00110     inline String const& name() const
00111     { return name_;}
00112 
00117     inline void setName( String const& aname)
00118     { name_ = aname;}
00119 
00124     inline String const& getDomXml() const
00125     { return xml_;}
00126 
00131     inline void setDomXml( String const& xml)
00132     { xml_ = xml;}
00133 
00138     inline String const& getIconName() const
00139     { return icon_name_;}
00140 
00145     inline void setIconName( String const& icon_name)
00146     { icon_name_ = icon_name;}
00147 
00152     inline Type type() const
00153     { return type_;}
00154 
00159     inline void setType( Type atype)
00160     { type_ = atype;}
00161 
00166     inline bool isNull() const
00167     { return name_.empty();}
00168 };
00169 
00170 }
00171 
00172 #endif /* STK_TOOL_H_ */