File indexing completed on 2025-02-16 10:53:50
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org> 0003 SPDX-FileCopyrightText: 2004 Nicolas GOUTTE <goutte@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef CSVEXPORT_H 0009 #define CSVEXPORT_H 0010 0011 #include <QByteArray> 0012 #include <KoFilter.h> 0013 #include <QVariantList> 0014 #include <QLoggingCategory> 0015 0016 Q_DECLARE_LOGGING_CATEGORY(lcCsvExport) 0017 0018 namespace Calligra 0019 { 0020 namespace Sheets 0021 { 0022 class Sheet; 0023 class Doc; 0024 } 0025 } 0026 0027 class CSVExport : public KoFilter 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 CSVExport(QObject* parent, const QVariantList &); 0033 ~CSVExport() override {} 0034 0035 KoFilter::ConversionStatus convert(const QByteArray & from, const QByteArray & to) override; 0036 0037 private: 0038 QString exportCSVCell(const Calligra::Sheets::Doc* doc, Calligra::Sheets::Sheet *sheet, 0039 int col, int row, QChar const & textQuote, QChar csvDelimiter); 0040 0041 private: 0042 QString m_eol; ///< End of line (LF, CR or CRLF) 0043 }; 0044 0045 #endif // CSVEXPORT_H