kdgantt

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