248844eb84a77d4036a5bbbfb0c552797b541330
[pspp-builds.git] / src / ui / gui / psppire-variable.h
1 /* 
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2006  Free Software Foundation
4     Written by John Darrington
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19     02110-1301, USA. */
20
21
22 #ifndef __PSPPIRE_VARIABLE_H__
23 #define __PSPPIRE_VARIABLE_H__
24
25 #include <glib-object.h>
26 #include <glib.h>
27
28 #include <data/variable.h>
29 #include "psppire-dict.h"
30
31 /* Don't use any of these members.
32    Use accessor functions instead.
33 */
34 struct PsppireVariable
35 {
36   /* The payload */
37   struct variable *v;
38
39   /* The dictionary to which this variable belongs */
40   PsppireDict *dict;
41 };
42
43
44
45 gboolean psppire_variable_set_name(struct PsppireVariable *pv, const gchar *text);
46
47 gboolean psppire_variable_set_columns(struct PsppireVariable *pv, gint columns);
48 gboolean psppire_variable_set_label(struct PsppireVariable *pv, const gchar *label);
49 gboolean psppire_variable_set_format(struct PsppireVariable *pv, struct fmt_spec *fmt);
50 gboolean psppire_variable_set_decimals(struct PsppireVariable *pv, gint decimals);
51 gboolean psppire_variable_set_width(struct PsppireVariable *pv, gint width);
52 gboolean psppire_variable_set_alignment(struct PsppireVariable *pv, gint align);
53 gboolean psppire_variable_set_measure(struct PsppireVariable *pv, gint measure);
54 gboolean psppire_variable_set_value_labels(const struct PsppireVariable *pv,
55                                         const struct val_labs *vls);
56
57 gboolean psppire_variable_set_missing(const struct PsppireVariable *pv,
58                                    const struct missing_values *miss);
59  
60 gboolean psppire_variable_set_print_spec(const struct PsppireVariable *pv, struct fmt_spec fmt);
61 gboolean psppire_variable_set_write_spec(const struct PsppireVariable *pv, struct fmt_spec fmt);
62
63 gboolean psppire_variable_set_type(struct PsppireVariable *pv, int type);
64
65
66
67 const struct fmt_spec *psppire_variable_get_write_spec(const struct PsppireVariable *pv);
68 const gchar * psppire_variable_get_name(const struct PsppireVariable *pv);
69
70 gint psppire_variable_get_columns(const struct PsppireVariable *pv);
71
72 const gchar * psppire_variable_get_label(const struct PsppireVariable *pv);
73
74
75 const struct missing_values *psppire_variable_get_missing
76                                      (const struct PsppireVariable *pv);
77
78 const struct val_labs * psppire_variable_get_value_labels
79                                      (const struct PsppireVariable *pv);
80
81 gint psppire_variable_get_alignment(const struct PsppireVariable *pv);
82
83 gint psppire_variable_get_measure(const struct PsppireVariable *pv);
84
85 gint psppire_variable_get_fv(const struct PsppireVariable *pv);
86
87 gint psppire_variable_get_type(const struct PsppireVariable *pv);
88
89 gint psppire_variable_get_width(const struct PsppireVariable *pv);
90
91 gint psppire_variable_get_index(const struct PsppireVariable *pv);
92
93
94 #endif /* __PSPPIRE_VARIABLE_H__ */