1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
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/>. */
17 #ifndef PSPPIRE_DATA_SHEET_H
18 #define PSPPIRE_DATA_SHEET_H 1
20 /* PsppireDataSheet is a PsppSheetView that displays the data in a dataset,
21 with one column per variable and one row per case.
23 PsppireDataSheet is usually a child of PsppireDataEditor in the widget
24 hierarchy. Other widgets can also use it. */
27 #include "ui/gui/pspp-sheet-view.h"
31 #define PSPP_TYPE_DATA_SHEET (psppire_data_sheet_get_type())
32 #define PSPPIRE_DATA_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPP_TYPE_DATA_SHEET,PsppireDataSheet))
33 #define PSPPIRE_DATA_SHEET_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class),PSPP_TYPE_DATA_SHEET,PsppireDataSheetClass))
34 #define PSPP_IS_DATA_SHEET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPP_TYPE_DATA_SHEET))
35 #define PSPP_IS_DATA_SHEET_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class),PSPP_TYPE_DATA_SHEET))
36 #define PSPPIRE_DATA_SHEET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPP_TYPE_DATA_SHEET,PsppireDataSheetClass))
38 typedef struct _PsppireDataSheet PsppireDataSheet;
39 typedef struct _PsppireDataSheetClass PsppireDataSheetClass;
41 struct _PsppireDataSheet
45 struct _PsppireDataStore *data_store;
46 gboolean show_value_labels;
47 gboolean show_case_numbers;
48 gboolean may_create_vars;
49 gboolean may_delete_vars;
51 gboolean owns_primary_selection;
53 guint scroll_to_bottom_signal;
54 guint scroll_to_right_signal;
57 guint on_owner_change_signal;
59 PsppSheetViewColumn *new_variable_column;
65 gboolean dispose_has_run;
68 struct _PsppireDataSheetClass
70 PsppSheetViewClass parent_class;
73 GType psppire_data_sheet_get_type (void) G_GNUC_CONST;
74 GtkWidget *psppire_data_sheet_new (void);
76 struct _PsppireDataStore *psppire_data_sheet_get_data_store (PsppireDataSheet *);
77 void psppire_data_sheet_set_data_store (PsppireDataSheet *,
78 struct _PsppireDataStore *);
80 gboolean psppire_data_sheet_get_value_labels (const PsppireDataSheet *);
81 void psppire_data_sheet_set_value_labels (PsppireDataSheet *,
82 gboolean show_value_labels);
84 gboolean psppire_data_sheet_get_case_numbers (const PsppireDataSheet *);
85 void psppire_data_sheet_set_case_numbers (PsppireDataSheet *,
86 gboolean show_case_numbers);
88 gboolean psppire_data_sheet_get_may_create_vars (PsppireDataSheet *);
89 void psppire_data_sheet_set_may_create_vars (PsppireDataSheet *, gboolean);
91 gboolean psppire_data_sheet_get_may_delete_vars (PsppireDataSheet *);
92 void psppire_data_sheet_set_may_delete_vars (PsppireDataSheet *, gboolean);
94 void psppire_data_sheet_goto_variable (PsppireDataSheet *, gint dict_index);
95 struct variable *psppire_data_sheet_get_current_variable (const PsppireDataSheet *);
97 void psppire_data_sheet_goto_case (PsppireDataSheet *, gint case_index);
98 gint psppire_data_sheet_get_selected_case (const PsppireDataSheet *);
99 gint psppire_data_sheet_get_current_case (const PsppireDataSheet *);
101 GtkUIManager *psppire_data_sheet_get_ui_manager (PsppireDataSheet *);
105 #endif /* PSPPIRE_DATA_SHEET_H */