kchart

KDXMLTools.h
1/*
2 KDChart - a multi-platform charting engine
3 */
4
5/****************************************************************************
6 ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB. All rights reserved.
7 **
8 ** This file is part of the KDChart library.
9 **
10 ** This file may be distributed and/or modified under the terms of the
11 ** GNU General Public License version 2 as published by the Free Software
12 ** Foundation and appearing in the file LICENSE.GPL included in the
13 ** packaging of this file.
14 **
15 ** Licensees holding valid commercial KDChart licenses may use this file in
16 ** accordance with the KDChart Commercial License Agreement provided with
17 ** the Software.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ** See http://www.klaralvdalens-datakonsult.se/?page=products for
23 ** information about KDChart Commercial License Agreements.
24 **
25 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
26 ** licensing are not clear to you.
27 **
28 **********************************************************************/
29#ifndef __KDXMLTOOLS_H__
30#define __KDXMLTOOLS_H__
31
32// *must* include this one as first one:
33#include <KDChartGlobal.h>
34
35#include <tqpen.h>
36#include <tqdom.h>
37#include <tqstring.h>
38#include <tqcolor.h>
39#include <tqbrush.h>
40#include <tqsize.h>
41#include <tqrect.h>
42#include <tqfont.h>
43#include <tqstringlist.h>
44#include <tqdatetime.h>
45
46namespace KDXML {
47 TQString penStyleToString( TQt::PenStyle style );
48 TQt::PenStyle stringToPenStyle( const TQString& style );
49 TQString brushStyleToString( TQt::BrushStyle style );
50 TQt::BrushStyle stringToBrushStyle( const TQString& style );
51
52 void createBoolNode( TQDomDocument& doc, TQDomNode& parent,
53 const TQString& elementName, bool value );
54 void createOrientationNode( TQDomDocument& doc, TQDomNode& parent,
55 const TQString& elementName, TQt::Orientation value );
56 void createSizeNode( TQDomDocument& doc, TQDomNode& parent,
57 const TQString& elementName, const TQSize& value );
58 void createIntNode( TQDomDocument& doc, TQDomNode& parent,
59 const TQString& elementName, int value );
60 void createDoubleNode( TQDomDocument& doc, TQDomNode& parent,
61 const TQString& elementName, double value );
62 void createStringNode( TQDomDocument& doc, TQDomNode& parent,
63 const TQString& elementName,
64 const TQString& text );
65 void createColorNode( TQDomDocument& doc, TQDomNode& parent,
66 const TQString& elementName, const TQColor& color );
67 void createBrushNode( TQDomDocument& doc, TQDomNode& parent,
68 const TQString& elementName, const TQBrush& brush );
69 void createPixmapNode( TQDomDocument& doc, TQDomNode& parent,
70 const TQString& elementName, const TQPixmap& pixmap );
71 void createRectNode( TQDomDocument& doc, TQDomNode& parent,
72 const TQString& elementName, const TQRect& rect );
73 void createStringListNodes( TQDomDocument& doc, TQDomNode& parent,
74 const TQString& elementName,
75 const TQStringList* thelist ); // PCH: This is required to avoid MSVC compiler warnings and errors.
76 void createFontNode( TQDomDocument& doc, TQDomNode& parent,
77 const TQString& elementName, const TQFont& font );
78
79 void createPenNode( TQDomDocument& doc, TQDomNode& parent,
80 const TQString& elementName, const TQPen& pen );
81 void createDateTimeNode( TQDomDocument& doc, TQDomNode& parent,
82 const TQString& elementName,
83 const TQDateTime& datetime );
84 void createDateNode( TQDomDocument& doc, TQDomNode& parent,
85 const TQString& elementName, const TQDate& date );
86 void createTimeNode( TQDomDocument& doc, TQDomNode& parent,
87 const TQString& elementName, const TQTime& time );
88 bool readIntNode( const TQDomElement& element, int& value );
89 bool readStringNode( const TQDomElement& element, TQString& value );
90 bool readDoubleNode( const TQDomElement& element, double& value );
91 bool readBoolNode( const TQDomElement& element, bool& value );
92 bool readOrientationNode( const TQDomElement& element, TQt::Orientation& value );
93 bool readSizeNode( const TQDomElement& element, TQSize& value );
94 bool readColorNode( const TQDomElement& element, TQColor& value );
95 bool readBrushNode( const TQDomElement& element, TQBrush& brush );
96 bool readPixmapNode( const TQDomElement& element, TQPixmap& pixmap );
97 bool readRectNode( const TQDomElement& element, TQRect& value );
98 bool readFontNode( const TQDomElement& element, TQFont& font );
99 bool readPenNode( const TQDomElement& element, TQPen& pen );
100 bool readDateTimeNode( const TQDomElement& element, TQDateTime& datetime );
101 bool readDateNode( const TQDomElement& element, TQDate& date );
102 bool readTimeNode( const TQDomElement& element, TQTime& time );
103}
104#endif