00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __KDXMLTOOLS_H__
00030 #define __KDXMLTOOLS_H__
00031
00032
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 );
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