2
KDChart - a multi-platform charting engine
5
/****************************************************************************
6
** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB. All rights reserved.
8
** This file is part of the KDChart library.
10
** This file may be used under the terms of the GNU General Public
11
** License versions 2.0 or 3.0 as published by the Free Software
12
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
13
** included in the packaging of this file. Alternatively you may (at
14
** your option) use any later version of the GNU General Public
15
** License if such license has been publicly approved by
16
** Klarälvdalens Datakonsult AB (or its successors, if any).
18
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
19
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
20
** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
21
** not expressly granted herein.
23
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26
**********************************************************************/
27
#ifndef __KDCHARTDIAGRAMSSERIALIZER_H__
28
#define __KDCHARTDIAGRAMSSERIALIZER_H__
30
/** \file KDChartDiagramsSerializer.h
31
\brief Auxiliary methods for reading/saving KD Chart data and configuration in streams.
34
#include "KDChartAbstractSerializer"
35
#include "KDChartLegendsSerializer"
37
#include "KDChartAttributesSerializer"
39
#include <KDChartChart>
40
#include <KDChartLineDiagram>
41
#include <KDChartBarDiagram>
42
#include <KDChartPieDiagram>
43
#include <KDChartPolarDiagram>
44
#include <KDChartRingDiagram>
45
#include <KDChartPlotter>
49
class CoordPlanesSerializer;
51
class AttributesModelSerializer;
53
class KDCHARTSERIALIZER_EXPORT DiagramsSerializer : public QObject, public AbstractSerializer
56
Q_DISABLE_COPY( DiagramsSerializer )
58
KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC( DiagramsSerializer )
61
friend class CoordPlanesSerializer;
62
friend class LegendsSerializer;
63
friend class LegendsSerializer::Private;
66
explicit DiagramsSerializer( CoordPlanesSerializer* coordS = 0 );
67
virtual ~DiagramsSerializer();
70
void saveElement( QDomDocument& doc, QDomElement& e, const QObject* obj ) const;
75
* Parse the diagram element, and store it in \c ptr.
77
* Make sure that you have called
78
* \c KDChart::SerializeCollector::instance()->initializeParsedGlobalPointers()
79
* before invoking this method, or it will stop parsing and return false.
81
bool parseElement( const QDomElement& container, QObject* ptr ) const;
84
* Parse the diagram element, and return a AbstractDiagram* in \c diagramPtr
85
* if the respective diagram was found in the list of global elements.
87
* This method is called transparently by the Serializer, so you should
88
* not need to call it explicitly.
90
* In case still want to call it just make sure that you have called
91
* \c KDChart::SerializeCollector::instance()->initializeParsedGlobalPointers()
92
* \em before invoking this method, or it will stop parsing and return false.
94
bool parseDiagram( const QDomNode& rootNode, const QDomNode& pointerNode,
95
AbstractDiagram*& diagramPtr ) const;
96
void saveDiagrams( QDomDocument& doc, QDomElement& e,
97
const ConstAbstractDiagramList& diags, const QString& title ) const;
100
} // end of namespace