1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2006 Free Software Foundation
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.
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.
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/>. */
18 #ifndef __CASE_FILE_H__
19 #define __CASE_FILE_H__
22 #include <glib-object.h>
25 #include <libpspp/str.h>
26 #include <data/case.h>
33 /* --- type macros --- */
34 #define G_TYPE_PSPPIRE_CASE_FILE (psppire_case_file_get_type ())
35 #define PSPPIRE_CASE_FILE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFile))
36 #define PSPPIRE_CASE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFileClass))
37 #define G_IS_PSPPIRE_CASE_FILE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_CASE_FILE))
38 #define G_IS_PSPPIRE_CASE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_CASE_FILE))
39 #define PSPPIRE_CASE_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_CASE_FILE, PsppireCaseFileClass))
44 /* --- typedefs & structures --- */
45 typedef struct _PsppireCaseFile PsppireCaseFile;
46 typedef struct _PsppireCaseFileClass PsppireCaseFileClass;
51 struct _PsppireCaseFile
56 struct datasheet *datasheet;
61 struct _PsppireCaseFileClass
63 GObjectClass parent_class;
67 /* -- PsppireCaseFile --- */
68 GType psppire_case_file_get_type (void);
70 PsppireCaseFile *psppire_case_file_new (struct casereader *);
72 gboolean psppire_case_file_insert_case (PsppireCaseFile *cf, struct ccase *c, casenumber row);
74 inline casenumber psppire_case_file_get_case_count (const PsppireCaseFile *cf);
77 union value * psppire_case_file_get_value (const PsppireCaseFile *cf,
78 casenumber, size_t idx,
79 union value *, int width);
83 gboolean psppire_case_file_data_in (PsppireCaseFile *cf, casenumber c, gint idx,
84 struct substring input,
85 const struct fmt_spec *);
87 gboolean psppire_case_file_set_value (PsppireCaseFile *cf, casenumber casenum,
88 gint idx, union value *v, gint width);
90 void psppire_case_file_clear (PsppireCaseFile *cf);
93 gboolean psppire_case_file_delete_cases (PsppireCaseFile *cf, casenumber n_rows,
96 gboolean psppire_case_file_insert_values (PsppireCaseFile *cf, gint n_values, gint where);
100 void psppire_case_file_sort (PsppireCaseFile *cf, struct case_ordering *);
102 gboolean psppire_case_file_get_case (const PsppireCaseFile *cf,
107 struct casereader * psppire_case_file_make_reader (PsppireCaseFile *cf);
112 #endif /* __PSPPIRE_CASE_FILE_H__ */