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

0001 /* This file is part of the KDE project
0002    Copyright (C) 2001 Enno Bartels <ebartels@nwn.de>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef APPLIXSPREADIMPORT_H
0021 #define APPLIXSPREADIMPORT_H
0022 
0023 #include <QString>
0024 #include <QFile>
0025 #include <QObject>
0026 #include <QTextStream>
0027 #include <QList>
0028 #include <QByteArray>
0029 
0030 #include <KoFilter.h>
0031 #include <KoStore.h>
0032 
0033 struct t_mycolor;
0034 struct t_rc;
0035 
0036 class APPLIXSPREADImport : public KoFilter
0037 {
0038 
0039     Q_OBJECT
0040 
0041 public:
0042     APPLIXSPREADImport(QObject *parent, const QVariantList&);
0043     ~APPLIXSPREADImport() override {}
0044 
0045     KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to) override;
0046 
0047 protected:
0048     QString nextLine(QTextStream &);
0049     QChar   specCharfind(QChar , QChar);
0050     void    writePen(QString &, int, int, const QString&);
0051     QString writeColor(t_mycolor *);
0052     void    readTypefaceTable(QTextStream &, QStringList &);
0053     void    readColormap(QTextStream &, QList<t_mycolor*> &);
0054     void    readView(QTextStream &, const QString&, t_rc &);
0055     void    filterSHFGBG(const QString&, int *, int *, int *);
0056     void    transPenFormat(const QString&, int *, int *);
0057     int     readHeader(QTextStream &);
0058     int     translateColumnNumber(const QString&);
0059     QString convertFormula(const QString& input) const;
0060 
0061 private:
0062     int m_stepsize;
0063     int m_instep;
0064     int m_progress;
0065     QString m_nextPendingLine;
0066 };
0067 #endif // APPLIXSPREADIMPORT_H