1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2008, 2010, 2011, 2012 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_EDITOR_H__
18 #define __PSPPIRE_DATA_EDITOR_H__
20 /* PsppireDataEditor is a GtkNotebook for editing a single PSPP dataset.
22 PsppireDataEditor has two tabs that normally contain a PsppireDataSheet and
23 a PsppireVarSheet. The user can choose to "split" the PsppireDataSheet view
24 into four views within the single tab. PsppireDataEditor also adds some
25 decorations above the PsppireDataSheet to note the current cell and allow
26 the current cell to be edited.
28 PsppireDataEditor's normal parent in the widget hierarchy is
32 #include <glib-object.h>
35 #include "psppire-data-store.h"
39 #define PSPPIRE_DATA_EDITOR_TYPE (psppire_data_editor_get_type ())
40 #define PSPPIRE_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditor))
41 #define PSPPIRE_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditorClass))
42 #define PSPPIRE_IS_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_DATA_EDITOR_TYPE))
43 #define PSPPIRE_IS_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_DATA_EDITOR_TYPE))
46 typedef struct _PsppireDataEditor PsppireDataEditor;
47 typedef struct _PsppireDataEditorClass PsppireDataEditorClass;
49 /* All members are private. */
50 struct _PsppireDataEditor
55 PsppireDataStore *data_store;
58 /* Font to use in var sheet and data sheet(s), NULL to use system default. */
59 struct _PangoFontDescription *font;
61 /* Variable sheet tab. */
63 GtkWidget *data_sheet;
66 GtkWidget *vbox; /* Top-level widget in tab. */
67 GtkWidget *cell_ref_label; /* GtkLabel that shows selected case and var. */
68 GtkWidget *datum_entry; /* PsppireValueEntry for editing current cell. */
70 gboolean split; /* True if the sheets are in split view. */
73 struct _PsppireDataEditorClass
75 GtkNotebookClass parent_class;
79 GType psppire_data_editor_get_type (void);
80 GtkWidget* psppire_data_editor_new (PsppireDict *, PsppireDataStore *);
81 void psppire_data_editor_show_grid (PsppireDataEditor *, gboolean);
82 void psppire_data_editor_set_font (PsppireDataEditor *, PangoFontDescription *);
83 void psppire_data_editor_split_window (PsppireDataEditor *, gboolean );
85 void psppire_data_editor_goto_variable (PsppireDataEditor *, gint dict_index);
86 void psppire_data_editor_data_delete_variables (PsppireDataEditor *de);
87 void psppire_data_editor_var_delete_variables (PsppireDataEditor *de);
88 void psppire_data_editor_insert_new_case_at_posn (PsppireDataEditor *de, gint posn);
89 void psppire_data_editor_insert_new_variable_at_posn (PsppireDataEditor *de, gint posn);
91 struct _PsppireDataSheet *psppire_data_editor_get_active_data_sheet (PsppireDataEditor *);
93 enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW};
95 void psppire_data_editor_paste (PsppireDataEditor *de);
99 #endif /* __PSPPIRE_DATA_EDITOR_H__ */