Logistic Regression: Added categorical variable support
[pspp] / src / ui / gui / var-type-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
18 #ifndef PSPPIRE_VAR_TYPE_DIALOG_H
19 #define PSPPIRE_VAR_TYPE_DIALOG_H 1
20
21 #include "data/format.h"
22 #include "psppire-dialog.h"
23 #include "psppire-var-store.h"
24
25 G_BEGIN_DECLS
26
27 #define PSPPIRE_TYPE_VAR_TYPE_DIALOG             (psppire_var_type_dialog_get_type())
28 #define PSPPIRE_VAR_TYPE_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_TYPE_VAR_TYPE_DIALOG,PsppireVarTypeDialog))
29 #define PSPPIRE_VAR_TYPE_DIALOG_CLASS(class)     (G_TYPE_CHECK_CLASS_CAST ((class),PSPPIRE_TYPE_VAR_TYPE_DIALOG,PsppireVarTypeDialogClass))
30 #define PSPPIRE_IS_VAR_TYPE_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPPIRE_TYPE_VAR_TYPE_DIALOG))
31 #define PSPPIRE_IS_VAR_TYPE_DIALOG_CLASS(class)  (G_TYPE_CHECK_CLASS_TYPE ((class),PSPPIRE_TYPE_VAR_TYPE_DIALOG))
32 #define PSPPIRE_VAR_TYPE_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPPIRE_TYPE_VAR_TYPE_DIALOG,PsppireVarTypeDialogClass))
33
34 typedef struct _PsppireVarTypeDialog      PsppireVarTypeDialog;
35 typedef struct _PsppireVarTypeDialogClass PsppireVarTypeDialogClass;
36
37 /*  This module describes the behaviour of the Variable Type dialog box,
38     used for input of the variable type parameter in the var sheet */
39
40 enum
41   {
42     BUTTON_NUMERIC,
43     BUTTON_COMMA,
44     BUTTON_DOT,
45     BUTTON_SCIENTIFIC,
46     BUTTON_DATE,
47     BUTTON_DOLLAR,
48     BUTTON_CUSTOM,
49     BUTTON_STRING,
50     num_BUTTONS
51   };
52
53 struct variable;
54
55 struct _PsppireVarTypeDialog {
56   PsppireDialog parent;
57
58   /* Format being edited. */
59   struct fmt_spec base_format;
60
61   /* Current version of format. */
62   struct fmt_spec fmt_l;
63
64   /* Toggle Buttons */
65   GtkWidget *radioButton[num_BUTTONS];
66
67   /* Decimals */
68   GtkWidget *label_decimals;
69   GtkWidget *entry_decimals;
70   GtkAdjustment *adj_decimals;
71
72   /* Width */
73   GtkWidget *entry_width;
74   GtkAdjustment *adj_width;
75
76   /* Container for width/decimals entry/labels */
77   GtkWidget *width_decimals;
78
79   /* Date */
80   GtkWidget *date_format_list;
81   GtkTreeView *date_format_treeview;
82
83   /* Dollar */
84   GtkWidget *dollar_window;
85   GtkTreeView *dollar_treeview;
86
87   /* Custom Currency */
88   GtkWidget *custom_currency_hbox;
89   GtkTreeView *custom_treeview;
90   GtkWidget *label_psample;
91   GtkWidget *label_nsample;
92
93   /* Actions */
94   GtkWidget *ok;
95
96   gint active_button;
97 };
98
99 struct _PsppireVarTypeDialogClass {
100   PsppireDialogClass parent_class;
101 };
102
103 GType psppire_var_type_dialog_get_type (void) G_GNUC_CONST;
104 PsppireVarTypeDialog* psppire_var_type_dialog_new (const struct fmt_spec *);
105
106 void psppire_var_type_dialog_set_format (PsppireVarTypeDialog *,
107                                          const struct fmt_spec *);
108 const struct fmt_spec *psppire_var_type_dialog_get_format (
109   const PsppireVarTypeDialog *);
110
111 void psppire_var_type_dialog_run (GtkWindow *parent_window,
112                                   struct fmt_spec *format);
113
114 G_END_DECLS
115
116 #endif /* PSPPIRE_VAR_TYPE_DIALOG_H */