21 #ifndef CSVIMPORTWIZARD_H
22 #define CSVIMPORTWIZARD_H
25 #include <QWizardPage>
27 #include <tulip/tulipconf.h>
28 #include <tulip/CSVContentHandler.h>
31 class CSVImportWizard;
37 class CSVParserConfigurationWidget;
39 class CSVImportConfigurationWidget;
40 class CSVToGraphDataMapping;
41 class CSVGraphMappingConfigurationWidget;
42 class CSVImportParameters;
47 class CSVParsingConfigurationQWizardPage :
public QWizardPage,
public CSVContentHandler {
50 CSVParsingConfigurationQWizardPage(QWidget *parent =
nullptr);
51 bool begin()
override;
52 bool line(
unsigned int row,
const std::vector<CSVToken> &lineTokens)
override;
53 bool end(
unsigned int rowNumber,
unsigned int columnNumber)
override;
54 bool isComplete()
const override;
55 bool validatePage()
override;
56 CSVParser *buildParser(
int firstLine = 0)
const;
57 int getFirstLineIndex()
const;
61 CSVParserConfigurationWidget *parserConfigurationWidget;
62 CSVTableWidget *previewTableWidget;
63 unsigned int previewLineNumber, columnCount;
64 bool validColumnCount;
70 class CSVImportConfigurationQWizardPage :
public QWizardPage {
73 CSVImportConfigurationQWizardPage(QWidget *parent =
nullptr);
74 void initializePage()
override;
75 CSVImportParameters getImportParameters()
const;
78 CSVImportConfigurationWidget *importConfigurationWidget;
81 class CSVGraphMappingConfigurationQWizardPage :
public QWizardPage {
84 CSVGraphMappingConfigurationQWizardPage(QWidget *parent =
nullptr);
85 void initializePage()
override;
86 bool isComplete()
const override;
87 CSVToGraphDataMapping *buildMappingObject()
const;
90 CSVGraphMappingConfigurationWidget *graphMappingConfigurationWidget;
93 class TLP_QT_SCOPE CSVImportWizard :
public QWizard {
97 explicit CSVImportWizard(QWidget *parent =
nullptr);
98 ~CSVImportWizard()
override;
100 CSVParsingConfigurationQWizardPage *getParsingConfigurationPage()
const;
101 CSVImportConfigurationQWizardPage *getImportConfigurationPage()
const;
102 CSVGraphMappingConfigurationQWizardPage *getMappingConfigurationPage()
const;
104 static void setGraph(Graph *g) {
108 static Graph *getGraph() {
113 void accept()
override;
116 Ui::CSVImportWizard *ui;