File indexing completed on 2025-02-16 10:53:50
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 1999 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 CSVEXPORTDIALOG_H 0009 #define CSVEXPORTDIALOG_H 0010 0011 #include <KoDialog.h> 0012 #include <ui_exportdialogui.h> 0013 0014 class ExportDialogUI; 0015 class QValidator; 0016 0017 namespace Calligra 0018 { 0019 namespace Sheets 0020 { 0021 class Map; 0022 } 0023 } 0024 0025 class ExportDialogUI : public QWidget, public Ui::ExportDialogUI 0026 { 0027 public: 0028 explicit ExportDialogUI(QWidget *parent) : QWidget(parent) { 0029 setupUi(this); 0030 } 0031 }; 0032 0033 0034 class CSVExportDialog : public KoDialog 0035 { 0036 Q_OBJECT 0037 public: 0038 explicit CSVExportDialog(QWidget *parent); 0039 ~CSVExportDialog() override; 0040 0041 QChar getDelimiter() const; 0042 QChar getTextQuote() const; 0043 bool exportSheet(QString const & sheetName) const; 0044 bool printAlwaysSheetDelimiter() const; 0045 QString getSheetDelimiter() const; 0046 bool exportSelectionOnly() const; 0047 0048 void fillSheet(Calligra::Sheets::Map * map); 0049 QString getEndOfLine(void) const; 0050 QTextCodec* getCodec(void) const; 0051 0052 private: 0053 void loadSettings(); 0054 void saveSettings(); 0055 ExportDialogUI * m_dialog; 0056 0057 QValidator* m_delimiterValidator; 0058 QString m_delimiter; 0059 QChar m_textquote; 0060 0061 private Q_SLOTS: 0062 void slotOk(); 0063 void slotCancel(); 0064 0065 void returnPressed(); 0066 void delimiterClicked(int id); 0067 void textChanged(const QString &); 0068 void textquoteSelected(const QString & mark); 0069 void selectionOnlyChanged(bool); 0070 }; 0071 0072 #endif