File indexing completed on 2024-12-08 12:56:12

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2013-2014 Inge Wallin       <inge@lysator.liu.se>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018    Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef ODFDRAWREADERBACKEND_H
0022 #define ODFDRAWREADERBACKEND_H
0023 
0024 // Calligra
0025 #include <KoXmlStreamReader.h>
0026 #include <KoFilter.h>
0027 
0028 // this library
0029 #include "koodfreader_export.h"
0030 #include "OdfDrawReader.h"
0031 
0032 
0033 class QByteArray;
0034 class QSizeF;
0035 class QStringList;
0036 class KoStore;
0037 class OdfReaderContext;
0038 
0039 
0040 /** @brief A default backend for the OdfDrawReader class.
0041  *
0042  * This class defines an interface and the default behaviour for the
0043  * backend to the ODF draw reader (@see OdfDrawReader). When the
0044  * reader is called upon to traverse a certain XML tree, there will
0045  * be two parameters to the root traverse function: a pointer to a
0046  * backend object and a pointer to a context object.
0047  *
0048  * The reader will traverse (read) the XML tree and for every element
0049  * it comes across it will call a specific function in the backend and
0050  * every call will pass the pointer to the context object.
0051  *
0052  * Each supported XML tag has a corresponding callback function. This
0053  * callback function will be called twice: once when the tag is first
0054  * encountered anc once when the tag is closed.  This means that an
0055  * element with no child elements will be called twice in succession.
0056  */
0057 class KOODFREADER_EXPORT OdfDrawReaderBackend
0058 {
0059  public:
0060     explicit OdfDrawReaderBackend();
0061     virtual ~OdfDrawReaderBackend();
0062 
0063     // ----------------------------------------------------------------
0064     // Dr3d functions
0065 
0066     DECLARE_BACKEND_FUNCTION(Dr3dScene);   // ODF 1.2  10.5.2
0067     DECLARE_BACKEND_FUNCTION(Dr3dLight);   // ODF 1.2  10.5.3
0068     DECLARE_BACKEND_FUNCTION(Dr3dCube);    // ODF 1.2  10.5.4
0069     DECLARE_BACKEND_FUNCTION(Dr3dSphere);  // ODF 1.2  10.5.5
0070     DECLARE_BACKEND_FUNCTION(Dr3dExtrude); // ODF 1.2  10.5.6
0071     DECLARE_BACKEND_FUNCTION(Dr3dRotate);  // ODF 1.2  10.5.7
0072 
0073     // ----------------------------------------------------------------
0074     // Draw functions
0075 
0076     DECLARE_BACKEND_FUNCTION(DrawA);
0077 
0078     DECLARE_BACKEND_FUNCTION(DrawRect);            // ODF 1.2  10.3.2
0079     DECLARE_BACKEND_FUNCTION(DrawLine);            // ODF 1.2  10.3.3
0080     DECLARE_BACKEND_FUNCTION(DrawPolyline);        // ODF 1.2  10.3.4
0081     DECLARE_BACKEND_FUNCTION(DrawPolygon);         // ODF 1.2  10.3.5
0082     DECLARE_BACKEND_FUNCTION(DrawRegularPolygon);  // ODF 1.2  10.3.6
0083     DECLARE_BACKEND_FUNCTION(DrawPath);            // ODF 1.2  10.3.7
0084     DECLARE_BACKEND_FUNCTION(DrawCircle);          // ODF 1.2  10.3.8
0085     DECLARE_BACKEND_FUNCTION(DrawEllipse);         // ODF 1.2  10.3.9
0086     DECLARE_BACKEND_FUNCTION(DrawConnector);       // ODF 1.2  10.3.10
0087     DECLARE_BACKEND_FUNCTION(DrawCaption);         // ODF 1.2  10.3.11
0088     DECLARE_BACKEND_FUNCTION(DrawMeasure);         // ODF 1.2  10.3.12
0089 
0090     // ----------------------------------------------------------------
0091     // Frames
0092 
0093     DECLARE_BACKEND_FUNCTION(DrawFrame);
0094     DECLARE_BACKEND_FUNCTION(DrawObject);
0095     DECLARE_BACKEND_FUNCTION(DrawObjectOle);
0096 
0097  private:
0098     class Private;
0099     Private * const d;
0100 };
0101 
0102 
0103 #endif // ODFDRAWREADERBACKEND_H