1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2015, 2017, 2020 Free Software Foundation
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef __PSPPIRE_IMPORT_ASSISTANT_H__
19 #define __PSPPIRE_IMPORT_ASSISTANT_H__
21 #include <glib-object.h>
26 #include "psppire-dict.h"
27 #include "data/spreadsheet-reader.h"
28 #include "psppire-text-file.h"
29 #include "psppire-delimited-text.h"
36 #define PSPPIRE_TYPE_IMPORT_ASSISTANT (psppire_import_assistant_get_type ())
38 #define PSPPIRE_IMPORT_ASSISTANT(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
40 PSPPIRE_TYPE_IMPORT_ASSISTANT, PsppireImportAssistant))
42 #define PSPPIRE_IMPORT_ASSISTANT_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_CAST ((klass), \
44 PSPPIRE_TYPE_IMPORT_ASSISTANT, \
45 PsppireImportAssistantClass))
47 #define PSPPIRE_IS_IMPORT_ASSISTANT(obj) \
48 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_IMPORT_ASSISTANT))
50 #define PSPPIRE_IS_IMPORT_ASSISTANT_CLASS(klass) \
51 (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_IMPORT_ASSISTANT))
54 #define PSPPIRE_IMPORT_ASSISTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
55 PSPPIRE_TYPE_IMPORT_ASSISTANT, \
56 PsppireImportAssistantClass))
58 typedef struct _PsppireImportAssistant PsppireImportAssistant;
59 typedef struct _PsppireImportAssistantClass PsppireImportAssistantClass;
62 typedef void page_func (PsppireImportAssistant *, GtkWidget *page);
64 struct _PsppireImportAssistant
74 /* START The chooser page of the assistant. */
75 GtkWidget *encoding_selector;
76 GtkFileFilter *default_filter;
77 /* END The chooser page of the assistant. */
80 /* START The introduction page of the assistant. */
81 GtkWidget *all_cases_button;
82 GtkWidget *n_cases_button;
83 GtkWidget *n_cases_spin;
84 GtkWidget *percent_button;
85 GtkWidget *percent_spin;
86 /* END The introduction page of the assistant. */
89 /* START Page where the user chooses field separators. */
91 /* How to break lines into columns. */
92 struct string quotes; /* Quote characters. */
95 GtkWidget *custom_entry;
97 GtkWidget *quote_combo;
99 GtkWidget *fields_tree_view;
101 /* END Page where the user chooses field separators. */
104 /* START first line page */
105 GtkWidget *first_line_tree_view;
106 GtkWidget *variable_names_cb;
107 /* END first line page */
109 GMainLoop *main_loop;
110 GtkWidget *paste_button;
111 GtkWidget *reset_button;
114 PsppireTextFile *text_file;
115 PsppireDelimitedText *delimiters_model;
117 struct sheet_spec_page *sheet_spec;
119 struct dictionary *dict;
120 struct dictionary *casereader_dict;
122 GtkWidget *var_sheet;
123 GtkWidget *data_sheet;
125 struct spreadsheet *spreadsheet;
128 struct _PsppireImportAssistantClass
130 GtkAssistantClass parent_class;
133 GType psppire_import_assistant_get_type (void) ;
136 GtkWidget *psppire_import_assistant_new (GtkWindow *toplevel);
138 gchar *psppire_import_assistant_generate_syntax (PsppireImportAssistant *);
140 int psppire_import_assistant_run (PsppireImportAssistant *asst);
144 #endif /* __PSPPIRE_IMPORT_ASSISTANT_H__ */