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

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2012-2013 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 ODTREADER_H
0022 #define ODTREADER_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 
0038 class OdtReaderBackend;
0039 class OdfReaderContext;
0040 
0041 class OdfTextReader;
0042 
0043 
0044 /** @brief Read the XML tree of the content of an ODT file.
0045  *
0046  * The OdtReader is used to traverse (read) the contents of an ODT
0047  * file using an XML stream reader.  For every XML element that the
0048  * reading process comes across it will call a specific function in a
0049  * backend class: @see OdtReaderBackend.
0050  *
0051  * Before the reading process is started the ODT file will be
0052  * analyzed to collect some data that may be needed during the
0053  * read: metadata, manifest and styles are examples of this. This
0054  * data is stored in the so called reading context, which is kept in
0055  * an instance of the OdfReaderContext class.
0056  *
0057  * The context will be passed around to the backend in every call to a
0058  * backend callback function.
0059  *
0060  * In addition to the pre-analyzed data from the ODT file, the context
0061  * can be used to keep track of data that is used in the backend
0062  * processing such as internal links, lists of embedded data such as
0063  * pictures.
0064  */
0065 class KOODFREADER_EXPORT OdtReader : public OdfReader
0066 {
0067  public:
0068     OdtReader();
0069     ~OdtReader() override;
0070 
0071  protected:
0072     // ODT document level functions
0073     DECLARE_READER_FUNCTION(OfficeText) override;
0074 
0075  private:
0076     // Not much here. Most are already in OdfReader.
0077 };
0078 
0079 #endif // ODTREADER_H