KDXMLTools.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002    KDChart - a multi-platform charting engine
00003    */
00004 
00005 /****************************************************************************
00006  ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB.  All rights reserved.
00007  **
00008  ** This file is part of the KDChart library.
00009  **
00010  ** This file may be distributed and/or modified under the terms of the
00011  ** GNU General Public License version 2 as published by the Free Software
00012  ** Foundation and appearing in the file LICENSE.GPL included in the
00013  ** packaging of this file.
00014  **
00015  ** Licensees holding valid commercial KDChart licenses may use this file in
00016  ** accordance with the KDChart Commercial License Agreement provided with
00017  ** the Software.
00018  **
00019  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021  **
00022  ** See http://www.klaralvdalens-datakonsult.se/?page=products for
00023  **   information about KDChart Commercial License Agreements.
00024  **
00025  ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
00026  ** licensing are not clear to you.
00027  **
00028  **********************************************************************/
00029 #ifndef __KDXMLTOOLS_H__
00030 #define __KDXMLTOOLS_H__
00031 
00032 // *must* include this one as first one:
00033 #include <KDChartGlobal.h>
00034 
00035 #include <qpen.h>
00036 #include <qdom.h>
00037 #include <qstring.h>
00038 #include <qcolor.h>
00039 #include <qbrush.h>
00040 #include <qsize.h>
00041 #include <qrect.h>
00042 #include <qfont.h>
00043 #include <qstringlist.h>
00044 #include <qdatetime.h>
00045 
00046 namespace KDXML {
00047     QString penStyleToString( Qt::PenStyle style );
00048     Qt::PenStyle stringToPenStyle( const QString& style );
00049     QString brushStyleToString( Qt::BrushStyle style );
00050     Qt::BrushStyle stringToBrushStyle( const QString& style );
00051 
00052     void createBoolNode( QDomDocument& doc, QDomNode& parent,
00053             const QString& elementName, bool value );
00054     void createOrientationNode( QDomDocument& doc, QDomNode& parent,
00055             const QString& elementName, Qt::Orientation value );
00056     void createSizeNode( QDomDocument& doc, QDomNode& parent,
00057             const QString& elementName, const QSize& value );
00058     void createIntNode( QDomDocument& doc, QDomNode& parent,
00059             const QString& elementName, int value );
00060     void createDoubleNode( QDomDocument& doc, QDomNode& parent,
00061             const QString& elementName, double value );
00062     void createStringNode( QDomDocument& doc, QDomNode& parent,
00063             const QString& elementName,
00064             const QString& text );
00065     void createColorNode( QDomDocument& doc, QDomNode& parent,
00066             const QString& elementName, const QColor& color );
00067     void createBrushNode( QDomDocument& doc, QDomNode& parent,
00068             const QString& elementName, const QBrush& brush );
00069     void createPixmapNode( QDomDocument& doc, QDomNode& parent,
00070             const QString& elementName, const QPixmap& pixmap );
00071     void createRectNode( QDomDocument& doc, QDomNode& parent,
00072             const QString& elementName, const QRect& rect );
00073     void createStringListNodes( QDomDocument& doc, QDomNode& parent,
00074             const QString& elementName,
00075             const QStringList* thelist ); // PCH: This is required to avoid MSVC compiler warnings and errors.
00076     void createFontNode( QDomDocument& doc, QDomNode& parent,
00077             const QString& elementName, const QFont& font );
00078 
00079     void createPenNode( QDomDocument& doc, QDomNode& parent,
00080             const QString& elementName, const QPen& pen );
00081     void createDateTimeNode( QDomDocument& doc, QDomNode& parent,
00082             const QString& elementName,
00083             const QDateTime& datetime );
00084     void createDateNode( QDomDocument& doc, QDomNode& parent,
00085             const QString& elementName, const QDate& date );
00086     void createTimeNode( QDomDocument& doc, QDomNode& parent,
00087             const QString& elementName, const QTime& time );
00088     bool readIntNode( const QDomElement& element, int& value );
00089     bool readStringNode( const QDomElement& element, QString& value );
00090     bool readDoubleNode( const QDomElement& element, double& value );
00091     bool readBoolNode( const QDomElement& element, bool& value );
00092     bool readOrientationNode( const QDomElement& element, Qt::Orientation& value );
00093     bool readSizeNode( const QDomElement& element, QSize& value );
00094     bool readColorNode( const QDomElement& element, QColor& value );
00095     bool readBrushNode( const QDomElement& element, QBrush& brush );
00096     bool readPixmapNode( const QDomElement& element, QPixmap& pixmap );
00097     bool readRectNode( const QDomElement& element, QRect& value );
00098     bool readFontNode( const QDomElement& element, QFont& font );
00099     bool readPenNode( const QDomElement& element, QPen& pen );
00100     bool readDateTimeNode( const QDomElement& element, QDateTime& datetime );
00101     bool readDateNode( const QDomElement& element, QDate& date );
00102     bool readTimeNode( const QDomElement& element, QTime& time );
00103 }
00104 #endif

Generated on Wed Jan 26 13:03:17 2011 for KMyMoney by  doxygen 1.5.6