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"
36 #include "ui/gui/pspp-sheet-view.h"
40 #define PSPPIRE_DATA_EDITOR_TYPE (psppire_data_editor_get_type ())
41 #define PSPPIRE_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditor))
42 #define PSPPIRE_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditorClass))
43 #define PSPPIRE_IS_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_DATA_EDITOR_TYPE))
44 #define PSPPIRE_IS_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_DATA_EDITOR_TYPE))
47 typedef struct _PsppireDataEditor PsppireDataEditor;
48 typedef struct _PsppireDataEditorClass PsppireDataEditorClass;
50 /* All members are private. */
51 struct _PsppireDataEditor
56 PsppireDataStore *data_store;
59 /* Font to use in var sheet and data sheet(s), NULL to use system default. */
60 struct _PangoFontDescription *font;
62 /* Variable sheet tab. */
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. */
69 GtkWidget *datasheet_vbox_widget; /* ->vbox child that holds data sheets. */
70 GtkWidget *data_sheets[4]; /* Normally one data sheet; four, if split. */
71 gboolean split; /* True if data sheets are split. */
73 /* UI manager for whichever var or data sheet is currently in use. */
74 GtkUIManager *ui_manager;
75 GtkWidget *old_vbox_widget;
78 struct _PsppireDataEditorClass
80 GtkNotebookClass parent_class;
84 GType psppire_data_editor_get_type (void);
85 GtkWidget* psppire_data_editor_new (PsppireDict *, PsppireDataStore *);
86 void psppire_data_editor_show_grid (PsppireDataEditor *, gboolean);
87 void psppire_data_editor_set_font (PsppireDataEditor *, PangoFontDescription *);
88 void psppire_data_editor_split_window (PsppireDataEditor *, gboolean );
90 void psppire_data_editor_goto_variable (PsppireDataEditor *, gint dict_index);
92 struct _PsppireDataSheet *psppire_data_editor_get_active_data_sheet (PsppireDataEditor *);
94 GtkUIManager *psppire_data_editor_get_ui_manager (PsppireDataEditor *);
96 enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW};
100 #endif /* __PSPPIRE_DATA_EDITOR_H__ */