Patch #5209
[pspp-builds.git] / src / ui / gui / psppire-case-file.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 __CASE_FILE_H__
23 #define __CASE_FILE_H__
24
25
26 #include <glib-object.h>
27 #include <glib.h>
28
29
30
31 G_BEGIN_DECLS
32
33
34 /* --- type macros --- */
35 #define G_TYPE_PSPPIRE_CASE_FILE              (psppire_case_file_get_type ())
36 #define PSPPIRE_CASE_FILE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFile))
37 #define PSPPIRE_CASE_FILE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFileClass))
38 #define G_IS_PSPPIRE_CASE_FILE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_CASE_FILE))
39 #define G_IS_PSPPIRE_CASE_FILE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_CASE_FILE))
40 #define PSPPIRE_CASE_FILE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFileClass))
41
42
43
44
45 /* --- typedefs & structures --- */
46 typedef struct _PsppireCaseFile    PsppireCaseFile;
47 typedef struct _PsppireCaseFileClass PsppireCaseFileClass;
48
49 struct ccase;
50 struct casefilefile;
51
52 struct _PsppireCaseFile
53 {
54   GObject             parent;
55
56   struct casefile *flexifile;
57 };
58
59
60 struct _PsppireCaseFileClass
61 {
62   GObjectClass parent_class;
63 };
64
65
66 /* -- PsppireCaseFile --- */
67 GType          psppire_case_file_get_type (void);
68
69 PsppireCaseFile *psppire_case_file_new (gint var_cnt);
70
71 gboolean psppire_case_file_append_case(PsppireCaseFile *cf, 
72                                              struct ccase *c);
73
74 gint psppire_case_file_get_case_count(const PsppireCaseFile *cf);
75
76
77 const union value * psppire_case_file_get_value(const PsppireCaseFile *cf, 
78                                               gint c, gint idx);
79
80 struct data_in;
81
82 gboolean psppire_case_file_data_in(PsppireCaseFile *cf, gint c, gint idx,
83                                  struct data_in *d_in);
84
85 gboolean psppire_case_file_set_value(PsppireCaseFile *cf, gint casenum, 
86                                      gint idx, union value *v, gint width);
87
88 void psppire_case_file_clear(PsppireCaseFile *cf);
89
90
91 gboolean psppire_case_file_delete_cases(PsppireCaseFile *cf, gint n_rows, 
92                                         gint first);
93
94 gboolean psppire_case_file_insert_case(PsppireCaseFile *cf, gint row);
95
96
97 gboolean psppire_case_file_insert_values(PsppireCaseFile *cf, gint n_values, gint before);
98
99 struct sort_criteria;
100 void psppire_case_file_sort(PsppireCaseFile *cf, const struct sort_criteria *);
101
102
103 G_END_DECLS
104
105 #endif /* __PSPPIRE_CASE_FILE_H__ */