kdgantt

KDGanttXMLTools.h

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