File indexing completed on 2025-03-16 10:52:41

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2001 Enno Bartels <ebartels@nwn.de>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef APPLIXSPREADIMPORT_H
0008 #define APPLIXSPREADIMPORT_H
0009 
0010 #include <QTextStream>
0011 
0012 #include <KoFilter.h>
0013 
0014 struct t_mycolor;
0015 struct t_rc;
0016 
0017 class APPLIXSPREADImport : public KoFilter
0018 {
0019 
0020     Q_OBJECT
0021 
0022 public:
0023     APPLIXSPREADImport(QObject *parent, const QVariantList&);
0024     ~APPLIXSPREADImport() override {}
0025 
0026     KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to) override;
0027 
0028 protected:
0029     QString nextLine(QTextStream &);
0030     QChar   specCharfind(QChar , QChar);
0031     void    writePen(QString &, int, int, const QString&);
0032     QString writeColor(t_mycolor *);
0033     void    readTypefaceTable(QTextStream &, QStringList &);
0034     void    readColormap(QTextStream &, QList<t_mycolor*> &);
0035     void    readView(QTextStream &, const QString&, t_rc &);
0036     void    filterSHFGBG(const QString&, int *, int *, int *);
0037     void    transPenFormat(const QString&, int *, int *);
0038     int     readHeader(QTextStream &);
0039     int     translateColumnNumber(const QString&);
0040     QString convertFormula(const QString& input) const;
0041 
0042 private:
0043     int m_stepsize;
0044     int m_instep;
0045     int m_progress;
0046     QString m_nextPendingLine;
0047 };
0048 #endif // APPLIXSPREADIMPORT_H