File indexing completed on 2025-01-19 13:27:36

0001 /*
0002  * This file is part of Office 2007 Filters for Calligra
0003  *
0004  * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
0005  *
0006  * Contact: Suresh Chande suresh.chande@nokia.com
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public License
0010  * version 2.1 as published by the Free Software Foundation.
0011  *
0012  * This library is distributed in the hope that it will be useful, but
0013  * WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with this library; if not, write to the Free Software
0019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
0020  * 02110-1301 USA
0021  *
0022  */
0023 
0024 #ifndef XLSXXMLSHAREDSTRINGSREADER_H
0025 #define XLSXXMLSHAREDSTRINGSREADER_H
0026 
0027 #include "XlsxXmlCommonReader.h"
0028 
0029 
0030 class XlsxXmlSharedStringsReaderContext : public MSOOXML::MsooXmlReaderContext
0031 {
0032 public:
0033     explicit XlsxXmlSharedStringsReaderContext(QVector<QString>& _strings, MSOOXML::DrawingMLTheme* _themes,
0034         QVector<QString>& _colorIndices);
0035     QVector<QString>* strings;
0036     MSOOXML::DrawingMLTheme* themes;
0037     QVector<QString>& colorIndices;
0038 };
0039 
0040 //! A class reading MSOOXML XLSX markup - sharedStrings.xml part.
0041 //! See ECMA-376, 12.3.15: Shared String Table Part
0042 class XlsxXmlSharedStringsReader : public XlsxXmlCommonReader
0043 {
0044 public:
0045     explicit XlsxXmlSharedStringsReader(KoOdfWriters *writers);
0046 
0047     ~XlsxXmlSharedStringsReader() override;
0048 
0049     //! Reads/parses the file of format document.xml.
0050     //! The output goes mainly to KoXmlWriter* KoOdfWriters::body
0051     KoFilter::ConversionStatus read(MSOOXML::MsooXmlReaderContext* context = 0) override;
0052 
0053 protected:
0054     KoFilter::ConversionStatus readInternal();
0055     KoFilter::ConversionStatus read_sst();
0056     KoFilter::ConversionStatus read_si();
0057 
0058     uint m_index;
0059 
0060     XlsxXmlSharedStringsReaderContext* m_context;
0061 private:
0062     void init();
0063 
0064     class Private;
0065     Private* const d;
0066 };
0067 
0068 #endif //XLSXXMLSHAREDSTRINGSREADER_H