KD Reports

           | Home |            | Namespaces |            | Classes |            | Files |            | Directories |

KDReportsXmlParser.h

00001 #ifndef KDREPORTSXMLPARSER_H
00002 #define KDREPORTSXMLPARSER_H
00003 
00004 //
00005 //  W A R N I N G
00006 //  -------------
00007 //
00008 // This file is not part of the KD Reports API.  It exists purely as an
00009 // implementation detail.  This header file may change from version to
00010 // version without notice, or even be removed.
00011 //
00012 // We mean it.
00013 //
00014 //
00015 
00016 #include "KDReportsReport.h"
00017 #include "KDReportsErrorDetails.h"
00018 #include <QtCore/QHash>
00019 #include <QtGui/QPixmap>
00020 
00021 class QDomDocument;
00022 class QDomNode;
00023 
00024 namespace KDReports {
00025 class TableElement;
00026 class XmlElementHandler;
00027 class AbstractTableElement;
00028 
00033 class XmlParser
00034 {
00035 public:
00036     XmlParser( const QHash<QString, QString>& textValues,
00037                const QHash<QString, QPixmap>& imageValues,
00038                XmlElementHandler* xmlHandler )
00039         : m_textValues( textValues ),
00040           m_imageValues( imageValues ),
00041           m_xmlElementHandler( xmlHandler )
00042     {}
00043 
00044     bool processDocument( const QDomDocument& document, KDReports::ReportBuilder& builder, ErrorDetails* details );
00045 
00046 private:
00047     bool processNode( const QDomNode& node, KDReports::ReportBuilder& builder, bool inHeader, bool inFooter, ErrorDetails* details );
00048     void addElement( KDReports::Element& reportElement, KDReports::ReportBuilder& builder, const QDomElement& element );
00049     bool parseTableContents( KDReports::TableElement& table, const QDomNode& tableNode, KDReports::ReportBuilder& builder,
00050                              bool inHeader, bool inFooter, ErrorDetails* details );
00051     void parseCommonTableAttributes( KDReports::AbstractTableElement& tableElement, QDomElement& element, KDReports::ReportBuilder& builder );
00052     QString extractText( const QDomElement& element, QString* id ) const;
00053     bool testForErrorAndFillErrorDetails( ErrorDetails* details );
00054 
00055     QHash<QString, QString> m_textValues;
00056     QHash<QString, QPixmap> m_imageValues;
00057     XmlElementHandler* m_xmlElementHandler;
00058 };
00059 
00060 }
00061 
00062 #endif

Copyright © 2008, Klarälvdalens Datakonsult AB KD Reports