KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
5.0KB

  1. /* -*- Mode: C++ -*-
  2. $Id: KDGanttXMLTools.h 367698 2004-12-01 19:34:06Z mueller $
  3. KDGantt - a multi-platform charting engine
  4. */
  5. /****************************************************************************
  6. ** Copyright (C) 2002-2004 Klarälvdalens Datakonsult AB. All rights reserved.
  7. **
  8. ** This file is part of the KDGantt 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 KDGantt licenses may use this file in
  16. ** accordance with the KDGantt 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/Public/products/ for
  23. ** information about KDGantt Commercial License Agreements.
  24. **
  25. ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
  26. ** licensing are not clear to you.
  27. **
  28. ** As a special exception, permission is given to link this program
  29. ** with any edition of TQt, and distribute the resulting executable,
  30. ** without including the source code for TQt in the source distribution.
  31. **
  32. **********************************************************************/
  33. #ifndef __KDGANTTXMLTOOLS_H__
  34. #define __KDGANTTXMLTOOLS_H__
  35. #include <tqpen.h>
  36. #include <tqdom.h>
  37. #include <tqstring.h>
  38. #include <tqcolor.h>
  39. #include <tqrect.h>
  40. #include <tqfont.h>
  41. #include <tqstringlist.h>
  42. #include <tqdatetime.h>
  43. namespace KDGanttXML {
  44. TQString penStyleToString( Qt::PenStyle style );
  45. Qt::PenStyle stringToPenStyle( const TQString& style );
  46. TQString brushStyleToString( Qt::BrushStyle style );
  47. Qt::BrushStyle stringToBrushStyle( const TQString& style );
  48. void createBoolNode( TQDomDocument& doc, TQDomNode& parent,
  49. const TQString& elementName, bool value );
  50. void createSizeNode( TQDomDocument& doc, TQDomNode& parent,
  51. const TQString& elementName, const TQSize& value );
  52. void createIntNode( TQDomDocument& doc, TQDomNode& parent,
  53. const TQString& elementName, int value );
  54. void createDoubleNode( TQDomDocument& doc, TQDomNode& parent,
  55. const TQString& elementName, double value );
  56. void createStringNode( TQDomDocument& doc, TQDomNode& parent,
  57. const TQString& elementName,
  58. const TQString& text );
  59. void createColorNode( TQDomDocument& doc, TQDomNode& parent,
  60. const TQString& elementName, const TQColor& color );
  61. void createBrushNode( TQDomDocument& doc, TQDomNode& parent,
  62. const TQString& elementName, const TQBrush& brush );
  63. void createPixmapNode( TQDomDocument& doc, TQDomNode& parent,
  64. const TQString& elementName, const TQPixmap& pixmap );
  65. void createRectNode( TQDomDocument& doc, TQDomNode& parent,
  66. const TQString& elementName, const TQRect& rect );
  67. void createStringListNodes( TQDomDocument& doc, TQDomNode& parent,
  68. const TQString& elementName,
  69. const TQStringList* list );
  70. void createFontNode( TQDomDocument& doc, TQDomNode& parent,
  71. const TQString& elementName, const TQFont& font );
  72. void createPenNode( TQDomDocument& doc, TQDomNode& parent,
  73. const TQString& elementName, const TQPen& pen );
  74. void createDateTimeNode( TQDomDocument& doc, TQDomNode& parent,
  75. const TQString& elementName,
  76. const TQDateTime& datetime );
  77. void createDateNode( TQDomDocument& doc, TQDomNode& parent,
  78. const TQString& elementName, const TQDate& date );
  79. void createTimeNode( TQDomDocument& doc, TQDomNode& parent,
  80. const TQString& elementName, const TQTime& time );
  81. bool readIntNode( const TQDomElement& element, int& value );
  82. bool readStringNode( const TQDomElement& element, TQString& value );
  83. bool readDoubleNode( const TQDomElement& element, double& value );
  84. bool readBoolNode( const TQDomElement& element, bool& value );
  85. bool readColorNode( const TQDomElement& element, TQColor& value );
  86. bool readBrushNode( const TQDomElement& element, TQBrush& brush );
  87. bool readPixmapNode( const TQDomElement& element, TQPixmap& pixmap );
  88. bool readRectNode( const TQDomElement& element, TQRect& value );
  89. bool readFontNode( const TQDomElement& element, TQFont& font );
  90. bool readPenNode( const TQDomElement& element, TQPen& pen );
  91. bool readDateTimeNode( const TQDomElement& element, TQDateTime& datetime );
  92. bool readDateNode( const TQDomElement& element, TQDate& date );
  93. bool readTimeNode( const TQDomElement& element, TQTime& time );
  94. }
  95. #endif