+#include "data/spreadsheet-reader.h"
+
+#include "libpspp/str.h"
+
+enum { MAX_PREVIEW_LINES = 1000 }; /* Max number of lines to read. */
+
+/* The file to be imported. */
+struct file
+ {
+ char *file_name; /* File name. */
+
+ /* Relevant only for text files */
+
+ gchar *encoding; /* Encoding. */
+ unsigned long int total_lines; /* Number of lines in file. */
+ bool total_is_exact; /* Is total_lines exact (or an estimate)? */
+
+ /* The first several lines of the file. */
+ struct string *lines;
+ size_t line_cnt;
+ };
+
+/* The main body of the GTK+ assistant and related data. */
+struct assistant
+ {
+ GtkBuilder *builder;
+ GtkAssistant *assistant;
+ GMainLoop *main_loop;
+ bool loop_done;
+ GtkWidget *paste_button;
+ GtkWidget *reset_button;
+ int response;
+ int watch_cursor;
+
+ GtkCellRenderer *prop_renderer;
+ GtkCellRenderer *fixed_renderer;
+ };
+
+struct import_assistant
+ {
+ struct file file;
+ struct assistant asst;
+
+ struct intro_page *intro;
+ struct sheet_spec_page *sheet_spec;
+ struct first_line_page *first_line;
+ struct separators_page *separators;
+ struct formats_page *formats;
+
+ /* The columns produced. */
+ struct column *columns; /* Information about each column. */
+ size_t column_cnt; /* Number of columns. */
+
+ int skip_lines; /* Number of initial lines to skip? */
+ bool variable_names; /* Variable names above first line of data? */
+ struct dictionary *dict;
+
+ struct spreadsheet *spreadsheet;
+ };
+
+struct column
+ {
+ /* Variable name for this column. This is the variable name
+ used on the separators page; it can be overridden by the
+ user on the formats page. */
+ char *name;
+
+ /* Maximum length of any row in this column. */
+ size_t width;
+
+ /* Contents of this column: contents[row] is the contents for
+ the given row.
+
+ A null substring indicates a missing column for that row
+ (because the line contains an insufficient number of
+ separators).
+
+ contents[] elements may be substrings of the lines[]
+ strings that represent the whole lines of the file, to
+ save memory. Other elements are dynamically allocated
+ with ss_alloc_substring. */
+ struct substring *contents;
+ };
+
+
+GtkWidget * add_page_to_assistant (struct import_assistant *ia,
+ GtkWidget *page, GtkAssistantPageType type);