379a5eeb3ee8fd1bf7968806582b605d788ac7f2
[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 #include "ui/gui/psppire-var-store.h"
30
31 G_BEGIN_DECLS
32
33 #define PSPPIRE_TYPE_VAL_LABS_DIALOG             (psppire_val_labs_dialog_get_type())
34 #define PSPPIRE_VAL_LABS_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialog))
35 #define PSPPIRE_VAL_LABS_DIALOG_CLASS(class)     (G_TYPE_CHECK_CLASS_CAST ((class),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialogClass))
36 #define PSPPIRE_IS_VAL_LABS_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG))
37 #define PSPPIRE_IS_VAL_LABS_DIALOG_CLASS(class)  (G_TYPE_CHECK_CLASS_TYPE ((class),PSPPIRE_TYPE_VAL_LABS_DIALOG))
38 #define PSPPIRE_VAL_LABS_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPPIRE_TYPE_VAL_LABS_DIALOG,PsppireValLabsDialogClass))
39
40 typedef struct _PsppireValLabsDialog      PsppireValLabsDialog;
41 typedef struct _PsppireValLabsDialogClass PsppireValLabsDialogClass;
42
43 struct _PsppireValLabsDialog {
44   PsppireDialog parent;
45
46   struct val_labs *labs;
47   gchar *encoding;
48   struct fmt_spec format;
49
50   /* Actions */
51   GtkWidget *add_button;
52   GtkWidget *remove_button;
53   GtkWidget *change_button;
54
55   /* Entry Boxes */
56   GtkWidget *value_entry;
57   GtkWidget *label_entry;
58
59   /* Signal handler ids */
60   gint change_handler_id;
61   gint value_handler_id;
62
63   GtkWidget *treeview;
64 };
65
66 struct _PsppireValLabsDialogClass {
67   PsppireDialogClass parent_class;
68 };
69
70 GType psppire_val_labs_dialog_get_type (void) G_GNUC_CONST;
71 PsppireValLabsDialog* psppire_val_labs_dialog_new (const struct variable *);
72
73 void psppire_val_labs_dialog_set_variable (PsppireValLabsDialog *,
74                                            const struct variable *);
75 const struct val_labs *psppire_val_labs_dialog_get_value_labels (
76   const PsppireValLabsDialog *);
77
78 struct val_labs *psppire_val_labs_dialog_run (GtkWindow *parent_window,
79                                               const struct variable *);
80
81 G_END_DECLS
82
83 #endif /* psppire-val-labs-dialog.h */