Warning, file /office/calligra/filters/sheets/gnumeric/gnumericimport.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (C) 1999 David Faure <faure@kde.org>
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 GNUMERICIMPORT_H
0021 #define GNUMERICIMPORT_H
0022 
0023 #include <KoFilter.h>
0024 
0025 #include <QDate>
0026 #include <QVariantList>
0027 
0028 class QDomElement;
0029 class QDomNode;
0030 
0031 namespace Calligra
0032 {
0033 namespace Sheets
0034 {
0035 class Cell;
0036 class Sheet;
0037 }
0038 }
0039 
0040 class GNUMERICFilter : public KoFilter
0041 {
0042     Q_OBJECT
0043 public:
0044     GNUMERICFilter(QObject* parent, const QVariantList&);
0045     ~GNUMERICFilter() override {}
0046 
0047     KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to) override;
0048 
0049     enum borderStyle { Left, Right, Top, Bottom, Diagonal, Revdiagonal};
0050 private:
0051     class GnumericDate : public QDate
0052     {
0053     public:
0054         static uint greg2jul(int y, int m, int d);
0055         static void jul2greg(double num, int & y, int & m, int & d);
0056         static QTime getTime(double num);
0057 
0058     };
0059 
0060     void dateInit();
0061     QString convertVars(QString const & str, Calligra::Sheets::Sheet * table) const;
0062     void ParsePrintInfo(QDomNode const & printInfo, Calligra::Sheets::Sheet * table);
0063     void ParseFormat(QString const & formatString, const Calligra::Sheets::Cell& kspread_cell);
0064     void setStyleInfo(QDomNode * sheet, Calligra::Sheets::Sheet * table);
0065     bool setType(const Calligra::Sheets::Cell& kspread_cell, QString const & formatString, QString & cell_content);
0066     void convertFormula(QString & formula) const;
0067     void importBorder(QDomElement  border, borderStyle _style, const Calligra::Sheets::Cell&cell);
0068     void ParseBorder(QDomElement & gmr_styleborder, const Calligra::Sheets::Cell& kspread_cell);
0069     double parseAttribute(const QDomElement &_element);
0070 
0071     void setText(Calligra::Sheets::Sheet* sheet, int row, int column, const QString& text, bool asString = false);
0072 };
0073 #endif // GNUMERICIMPORT_H