GElementData.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Raphael Langerhorst                             *
00003  *   raphael-langerhorst@gmx.at                                            *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00023  ***************************************************************************/
00024 
00025 #ifndef GELEMENTDATAH
00026 #define GELEMENTDATAH
00027 
00028 #include <QObject>
00029 #include <QDomDocument>
00030 
00031 namespace GCS
00032 {
00033 
00034 class GVector3;
00035 
00059 class GElementData : public QObject, public QDomDocument
00060 {
00061   Q_OBJECT
00062   
00063   public:
00064   
00068     GElementData();
00069     
00073     virtual ~GElementData();
00074   
00075     //BEGIN Helper member functions for working with ElementData
00076     
00077   public:
00078   
00084     QDomElement xmlGetTopElement(QString tag_name, bool& ok);
00085     
00091     QDomElement xmlGetElement(QDomElement parent, QString child_tag_name, bool& existed);
00092     
00121     QDomElement xmlGetElement(QString xpath, bool& existed);
00122     
00128     QDomElement xmlGetTopElement(QString tag_name, bool& ok) const;
00129     
00135     QDomElement xmlGetElement(QDomElement parent, QString child_tag_name, bool& existed) const;
00136     
00165     QDomElement xmlGetElement(QString xpath, bool& existed) const;
00166     
00177     void xmlRemoveNodeContent(QDomElement node);
00178     
00183     QString xmlGetText(QDomElement element, bool& ok) const;
00184     
00189     QString xmlGetText(QString xpath, bool& ok) const;
00190     
00195     void xmlSetText(QDomElement element, QString text, bool& ok);
00196     
00201     void xmlSetText(QString xpath, QString text, bool& ok);
00202     
00207     bool xmlGetFlag(QDomElement element, bool& ok) const;
00208         
00213     bool xmlGetFlag(QString xpath, bool& ok) const;
00214     
00218     void xmlSetFlag(QDomElement element, bool value, bool& ok);
00219     
00223     void xmlSetFlag(QString xpath, bool value, bool& ok);
00224 
00229     int xmlGetInteger(QDomElement element, bool& ok) const;
00230         
00235     int xmlGetInteger(QString xpath, bool& ok) const;
00236     
00240     void xmlSetInteger(QDomElement element, int value, bool& ok);
00241     
00245     void xmlSetInteger(QString xpath, int value, bool& ok);
00246     
00251     unsigned long xmlGetULongInteger(QDomElement element, bool& ok) const;
00252         
00257     unsigned long xmlGetULongInteger(QString xpath, bool& ok) const;
00258     
00262     void xmlSetULongInteger(QDomElement element, unsigned long value, bool& ok);
00263     
00267     void xmlSetULongInteger(QString xpath, unsigned long value, bool& ok);
00268     
00273     double xmlGetDouble(QDomElement element, bool& ok) const;
00274         
00279     double xmlGetDouble(QString xpath, bool& ok) const;
00280     
00284     void xmlSetDouble(QDomElement element, double value, bool& ok);
00285     
00289     void xmlSetDouble(QString xpath, double value, bool& ok);
00290     
00295     GVector3 xmlGetVector3(QDomElement element, bool& ok) const;
00296     
00320     GVector3 xmlGetVector3(QString xpath, bool& ok) const;
00321     
00325     void xmlSetVector3(QDomElement element, const GVector3& value, bool& ok);
00326     
00331     void xmlSetVector3(QString xpath, const GVector3& value, bool& ok);
00332     
00333     //END Helper member functions for working with ElementData
00334 };
00335 
00336 }
00337 
00338 #endif

Generated on Thu Nov 16 07:49:12 2006 for G System by  doxygen 1.4.7