Add support for reading SPSS/PC+ system files.
[pspp] / src / ui / gui / val-labs-dialog.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2005, 2011, 2012  Free Software Foundation
3
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.
8
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.
13
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/>. */
16
17 #ifndef PSPPIRE_VAL_LABS_DIALOG_H
18 #define PSPPIRE_VAL_LABS_DIALOG_H
19
20
21 /*  This module describes the behaviour of the Value Labels dialog box,
22     used for input of the value labels in the variable sheet */
23
24
25 #include <gtk/gtk.h>
26 #include "data/format.h"
27 #include "data/variable.h"
28 #include "ui/gui/psppire-dialog.h"
29
30 G_BEGIN_DECLS
31
32 #define PSPPIRE_TYPE_VAL_LABS_DIALOG             (psppire_val_labs_dialog_get_type())
33 #define PSPPIRE_VAL_LABS_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialog))
34 #define PSPPIRE_VAL_LABS_DIALOG_CLASS(class)     (G_TYPE_CHECK_CLASS_CAST ((class),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialogClass))
35 #define PSPPIRE_IS_VAL_LABS_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG))
36 #define PSPPIRE_IS_VAL_LABS_DIALOG_CLASS(class)  (G_TYPE_CHECK_CLASS_TYPE ((class),PSPPIRE_TYPE_VAL_LABS_DIALOG))
37 #define PSPPIRE_VAL_LABS_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialogClass))
38
39 typedef struct _PsppireValLabsDialog      PsppireValLabsDialog;
40 typedef struct _PsppireValLabsDialogClass PsppireValLabsDialogClass;
41
42 struct _PsppireValLabsDialog {
43   PsppireDialog parent;
44
45   struct val_labs *labs;
46   gchar *encoding;
47   struct fmt_spec format;
48
49   /* Actions */
50   GtkWidget *add_button;
51   GtkWidget *remove_button;
52   GtkWidget *change_button;
53
54   /* Entry Boxes */
55   GtkWidget *value_entry;
56   GtkWidget *label_entry;
57
58   /* Signal handler ids */
59   gint change_handler_id;
60   gint value_handler_id;
61
62   GtkWidget *treeview;
63 };
64
65 struct _PsppireValLabsDialogClass {
66   PsppireDialogClass parent_class;
67 };
68
69 GType psppire_val_labs_dialog_get_type (void) G_GNUC_CONST;
70 PsppireValLabsDialog* psppire_val_labs_dialog_new (const struct variable *);
71
72 void psppire_val_labs_dialog_set_variable (PsppireValLabsDialog *,
73                                            const struct variable *);
74 const struct val_labs *psppire_val_labs_dialog_get_value_labels (
75   const PsppireValLabsDialog *);
76
77 struct val_labs *psppire_val_labs_dialog_run (GtkWindow *parent_window,
78                                               const struct variable *);
79
80 G_END_DECLS
81
82 #endif /* psppire-val-labs-dialog.h */