File indexing completed on 2024-03-24 17:24:42
0001 /** 0002 * SPDX-FileCopyrightText: (C) 2003 Sébastien Laoût <slaout@linux62.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef SOFTWAREIMPORTERS_H 0008 #define SOFTWAREIMPORTERS_H 0009 0010 #include <QDialog> 0011 0012 class QString; 0013 class QGroupBox; 0014 class QDomElement; 0015 class QRadioButton; 0016 class KTextEdit; 0017 class QVBoxLayout; 0018 0019 class BasketScene; 0020 class Note; 0021 0022 /** The dialog to ask how to import hierarchical data. 0023 * @author Sébastien Laoût 0024 */ 0025 class TreeImportDialog : public QDialog 0026 { 0027 Q_OBJECT 0028 public: 0029 explicit TreeImportDialog(QWidget *parent = nullptr); 0030 ~TreeImportDialog() override; 0031 int choice(); 0032 0033 private: 0034 QGroupBox *m_choices; 0035 QVBoxLayout *m_choiceLayout; 0036 QRadioButton *m_hierarchy_choice; 0037 QRadioButton *m_separate_baskets_choice; 0038 QRadioButton *m_one_basket_choice; 0039 }; 0040 0041 /** The dialog to ask how to import text files. 0042 * @author Sébastien Laoût 0043 */ 0044 class TextFileImportDialog : public QDialog 0045 { 0046 Q_OBJECT 0047 public: 0048 explicit TextFileImportDialog(QWidget *parent = nullptr); 0049 ~TextFileImportDialog() override; 0050 QString separator(); 0051 protected Q_SLOTS: 0052 void customSeparatorChanged(); 0053 0054 private: 0055 QGroupBox *m_choices; 0056 QVBoxLayout *m_choiceLayout; 0057 QRadioButton *m_emptyline_choice; 0058 QRadioButton *m_newline_choice; 0059 QRadioButton *m_dash_choice; 0060 QRadioButton *m_star_choice; 0061 QRadioButton *m_all_in_one_choice; 0062 QRadioButton *m_anotherSeparator; 0063 KTextEdit *m_customSeparator; 0064 }; 0065 0066 /** Functions that import data from other software. 0067 * @author Sébastien Laoût 0068 */ 0069 namespace SoftwareImporters 0070 { 0071 void finishImport(BasketScene *basket); 0072 0073 // The importers in themselves: 0074 void importTextFile(); 0075 } 0076 0077 #endif // SOFTWAREIMPORTERS_H