1 /* This file is part of the KDE project
2    Copyright (C) 2000 David Faure <faure@kde.org>
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8 
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13 
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef GNUMERICEXPORT_TEST_H
21 #define GNUMERICEXPORT_TEST_H
22 
23 #include <KoFilter.h>
24 #include <QDomDocument>
25 #include <QByteArray>
26 #include <QVariantList>
27 
28 namespace Calligra
29 {
30 namespace Sheets
31 {
32 class Cell;
33 }
34 }
35 
36 class QRect;
37 
38 class GNUMERICExport : public KoFilter
39 {
40 
41     Q_OBJECT
42 
43 public:
44     GNUMERICExport(QObject *parent, const QVariantList&);
~GNUMERICExport()45     ~GNUMERICExport() override {}
46 
47     KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to) override;
48 
49 private:
50     QDomElement GetCellStyle(QDomDocument gnumeric_doc, const Calligra::Sheets::Cell& cell, int currentcolumn, int currentrow);
51     QDomElement GetBorderStyle(QDomDocument gnumeric_doc, const Calligra::Sheets::Cell& cell, int currentcolumn, int currentrow);
52     QDomElement GetFontStyle(QDomDocument gnumeric_doc, const Calligra::Sheets::Cell& cell, int currentcolumn, int currentrow);
53     QDomElement GetLinkStyle(QDomDocument gnumeric_doc);
54     QDomElement GetValidity(QDomDocument gnumeric_doc, const Calligra::Sheets::Cell& cell);
55 
56     void addAttributeItem(QDomDocument gnumeric_doc, QDomElement attributes, const QString& type, const QString& name, bool value);
57     void addSummaryItem(QDomDocument gnumeric_doc, QDomElement summary, const QString& name, const QString& value);
58     bool hasBorder(const Calligra::Sheets::Cell&cell, int currentcolumn, int currentrow);
59     const QString ColorToString(int red, int green, int blue);
60     QString convertVariable(QString headerFooter);
61     QString convertRefToRange(const QString & table, const QRect & rect);
62     QString convertRefToBase(const QString & table, const QRect & rect);
63     bool isLink;
64     QString linkText;
65     QString linkUrl;
66     bool isLinkBold;
67     bool isLinkItalic;
68 
69 };
70 #endif
71 
72