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

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 ODSREADERBACKEND_H
0009 #define ODSREADERBACKEND_H
0010 
0011 // Calligra
0012 #include <KoXmlStreamReader.h>
0013 #include <KoFilter.h>
0014 
0015 // this library
0016 #include "koodfreader_export.h"
0017 #include "OdsReader.h"
0018 #include "OdfReaderBackend.h"
0019 #include "OdfReaderInternals.h"
0020 
0021 
0022 class QByteArray;
0023 class QSizeF;
0024 class QStringList;
0025 class KoStore;
0026 class OdfReaderContext;
0027 
0028 
0029 /** @brief A default backend for the OdsReader class.
0030  *
0031  * This class defines an interface and the default behaviour for the
0032  * backend to the ODS reader (@see OdsReader). When the
0033  * reader is called upon to traverse a certain XML tree, there will
0034  * be two parameters to the root traverse function: a pointer to a
0035  * backend object and a pointer to a context object.
0036  *
0037  * The reader will traverse (read) the XML tree and for every element
0038  * it comes across it will call a specific function in the backend and
0039  * every call will pass the pointer to the context object.
0040  *
0041  * Each supported XML tag has a corresponding callback function. This
0042  * callback function will be called twice: once when the tag is first
0043  * encountered anc once when the tag is closed.  This means that an
0044  * element with no child elements will be called twice in succession.
0045  *
0046  * The callback function receives as parameter a reference to the XML
0047  * stream reader. From this parameter it can be deduced if the call is
0048  * for a start element or an end element and also access the
0049  * attributes of the element.
0050  *
0051  * This class defines a virtual function for every supported
0052  * element. It also implements a default behaviour for every element
0053  * which is to ignore the parameters and do nothing.
0054  *
0055  * When this class is used e.g. in a filter it is recommended to
0056  * inherit this class and only reimplement those functions that are
0057  * actually needed.
0058  */
0059 class KOODFREADER_EXPORT OdsReaderBackend : public OdfReaderBackend
0060 {
0061  public:
0062     explicit OdsReaderBackend();
0063     ~OdsReaderBackend() override;
0064 
0065     // ----------------------------------------------------------------
0066     // ODS document level functions
0067 
0068     DECLARE_BACKEND_FUNCTION(OfficeSpreadsheet);
0069 
0070  private:
0071     class Private;
0072     Private * const d;
0073 };
0074 
0075 
0076 #endif // ODSREADERBACKEND_H