File indexing completed on 2024-05-12 16:29:19

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2012-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 ODSREADER_H
0022 #define ODSREADER_H
0023 
0024 // Qt
0025 #include <QHash>
0026 #include <QString>
0027 
0028 // Calligra
0029 #include <KoXmlStreamReader.h>
0030 
0031 // this library
0032 #include "koodfreader_export.h"
0033 #include "OdfReader.h"
0034 #include "OdfReaderInternals.h"
0035 
0036 
0037 class QSizeF;
0038 
0039 class KoXmlWriter;
0040 class KoStore;
0041 
0042 class OdsReaderBackend;
0043 class OdfReaderContext;
0044 
0045 class OdfTextReader;
0046 
0047 
0048 /** @brief Read the XML tree of the content of an ODS file.
0049  *
0050  * The OdsReader is used to traverse (read) the contents of an ODS
0051  * file using an XML stream reader.  For every XML element that the
0052  * reading process comes across it will call a specific function in a
0053  * backend class: @see OdsReaderBackend.
0054  *
0055  * Before the reading process is started the ODS file will be
0056  * analyzed to collect some data that may be needed during the
0057  * read: metadata, manifest and styles are examples of this. This
0058  * data is stored in the so called reading context, which is kept in
0059  * an instance of the OdfReaderContext class.
0060  *
0061  * The context will be passed around to the backend in every call to a
0062  * backend callback function.
0063  *
0064  * In addition to the pre-analyzed data from the ODS file, the context
0065  * can be used to keep track of data that is used in the backend
0066  * processing such as internal links, lists of embedded data such as
0067  * pictures.
0068  */
0069 class KOODFREADER_EXPORT OdsReader : public OdfReader
0070 {
0071  public:
0072     OdsReader();
0073     ~OdsReader() override;
0074 
0075  protected:
0076     // All readElement*() are named after the full qualifiedName of
0077     // the element in ODF that they handle.
0078 
0079     // ODS document level functions
0080     DECLARE_READER_FUNCTION(OfficeSpreadsheet) override;
0081 
0082  private:
0083     // Not much here. Most are already in OdfReader.
0084 };
0085 
0086 #endif // ODSREADER_H