File indexing completed on 2025-01-19 10:49:27

0001 /* This file is part of the KDE project
0002 
0003    SPDX-FileCopyrightText: 2013-2014 Inge Wallin <inge@lysator.liu.se>
0004 
0005    SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef ODFDRAWREADERBACKEND_H
0009 #define ODFDRAWREADERBACKEND_H
0010 
0011 // Calligra
0012 #include <KoXmlStreamReader.h>
0013 #include <KoFilter.h>
0014 
0015 // this library
0016 #include "koodfreader_export.h"
0017 #include "OdfDrawReader.h"
0018 
0019 
0020 class QByteArray;
0021 class QSizeF;
0022 class QStringList;
0023 class KoStore;
0024 class OdfReaderContext;
0025 
0026 
0027 /** @brief A default backend for the OdfDrawReader class.
0028  *
0029  * This class defines an interface and the default behaviour for the
0030  * backend to the ODF draw reader (@see OdfDrawReader). When the
0031  * reader is called upon to traverse a certain XML tree, there will
0032  * be two parameters to the root traverse function: a pointer to a
0033  * backend object and a pointer to a context object.
0034  *
0035  * The reader will traverse (read) the XML tree and for every element
0036  * it comes across it will call a specific function in the backend and
0037  * every call will pass the pointer to the context object.
0038  *
0039  * Each supported XML tag has a corresponding callback function. This
0040  * callback function will be called twice: once when the tag is first
0041  * encountered anc once when the tag is closed.  This means that an
0042  * element with no child elements will be called twice in succession.
0043  */
0044 class KOODFREADER_EXPORT OdfDrawReaderBackend
0045 {
0046  public:
0047     explicit OdfDrawReaderBackend();
0048     virtual ~OdfDrawReaderBackend();
0049 
0050     // ----------------------------------------------------------------
0051     // Dr3d functions
0052 
0053     DECLARE_BACKEND_FUNCTION(Dr3dScene);   // ODF 1.2  10.5.2
0054     DECLARE_BACKEND_FUNCTION(Dr3dLight);   // ODF 1.2  10.5.3
0055     DECLARE_BACKEND_FUNCTION(Dr3dCube);    // ODF 1.2  10.5.4
0056     DECLARE_BACKEND_FUNCTION(Dr3dSphere);  // ODF 1.2  10.5.5
0057     DECLARE_BACKEND_FUNCTION(Dr3dExtrude); // ODF 1.2  10.5.6
0058     DECLARE_BACKEND_FUNCTION(Dr3dRotate);  // ODF 1.2  10.5.7
0059 
0060     // ----------------------------------------------------------------
0061     // Draw functions
0062 
0063     DECLARE_BACKEND_FUNCTION(DrawA);
0064 
0065     DECLARE_BACKEND_FUNCTION(DrawRect);            // ODF 1.2  10.3.2
0066     DECLARE_BACKEND_FUNCTION(DrawLine);            // ODF 1.2  10.3.3
0067     DECLARE_BACKEND_FUNCTION(DrawPolyline);        // ODF 1.2  10.3.4
0068     DECLARE_BACKEND_FUNCTION(DrawPolygon);         // ODF 1.2  10.3.5
0069     DECLARE_BACKEND_FUNCTION(DrawRegularPolygon);  // ODF 1.2  10.3.6
0070     DECLARE_BACKEND_FUNCTION(DrawPath);            // ODF 1.2  10.3.7
0071     DECLARE_BACKEND_FUNCTION(DrawCircle);          // ODF 1.2  10.3.8
0072     DECLARE_BACKEND_FUNCTION(DrawEllipse);         // ODF 1.2  10.3.9
0073     DECLARE_BACKEND_FUNCTION(DrawConnector);       // ODF 1.2  10.3.10
0074     DECLARE_BACKEND_FUNCTION(DrawCaption);         // ODF 1.2  10.3.11
0075     DECLARE_BACKEND_FUNCTION(DrawMeasure);         // ODF 1.2  10.3.12
0076 
0077     // ----------------------------------------------------------------
0078     // Frames
0079 
0080     DECLARE_BACKEND_FUNCTION(DrawFrame);
0081     DECLARE_BACKEND_FUNCTION(DrawObject);
0082     DECLARE_BACKEND_FUNCTION(DrawObjectOle);
0083 
0084  private:
0085     class Private;
0086     Private * const d;
0087 };
0088 
0089 
0090 #endif // ODFDRAWREADERBACKEND_H