File indexing completed on 2025-01-05 03:35:40

0001 /*
0002     File                 : ExportSpreadsheetDialog.h
0003     Project              : LabPlot
0004     Description          : export spreadsheet dialog
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2014-2022 Alexander Semke <alexander.semke@web.de>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef EXPORTSPREADSHEETDIALOG_H
0011 #define EXPORTSPREADSHEETDIALOG_H
0012 
0013 #include <QDialog>
0014 #include <QLocale>
0015 
0016 namespace Ui {
0017 class ExportSpreadsheetWidget;
0018 }
0019 
0020 class QPushButton;
0021 class QAbstractButton;
0022 
0023 class ExportSpreadsheetDialog : public QDialog {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit ExportSpreadsheetDialog(QWidget*);
0028     ~ExportSpreadsheetDialog() override;
0029 
0030     QString path() const;
0031     void setProjectFileName(const QString&);
0032     void setFileName(const QString&);
0033     void setMatrixMode(bool);
0034     void setExportSelection(bool);
0035     bool exportHeader() const;
0036     bool exportLatexHeader() const;
0037     bool gridLines() const;
0038     bool captions() const;
0039     bool skipEmptyRows() const;
0040     bool exportSelection() const;
0041     bool entireSpreadheet() const;
0042     bool matrixVerticalHeader() const;
0043     bool matrixHorizontalHeader() const;
0044     QString separator() const;
0045     QLocale::Language numberFormat() const;
0046     int exportToFits() const;
0047     bool commentsAsUnitsFits() const;
0048     void setExportTo(const QStringList& to);
0049     void setExportToImage(bool possible);
0050 
0051     enum class Format { ASCII, LaTeX, FITS, XLSX, SQLite };
0052 
0053     Format format() const;
0054 
0055 private:
0056     Ui::ExportSpreadsheetWidget* ui;
0057     bool m_showOptions{true};
0058     bool m_matrixMode{false};
0059     Format m_format{Format::ASCII};
0060     QString m_projectPath;
0061 
0062     QPushButton* m_showOptionsButton;
0063     QPushButton* m_okButton;
0064     QPushButton* m_cancelButton;
0065 
0066 private Q_SLOTS:
0067     void setFormat(ExportSpreadsheetDialog::Format);
0068     void slotButtonClicked(QAbstractButton*);
0069     void okClicked();
0070     void toggleOptions();
0071     void selectFile();
0072     void formatChanged(int);
0073     void fileNameChanged(const QString&);
0074     void fitsExportToChanged(int);
0075 };
0076 
0077 #endif