X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fui%2Fgui%2Fpsppire-data-store.h;h=2fff2d16ddb36acc10ebaafdd9cb709217efa503;hb=8b4ecb31c06866aae734a8a4fa2201e5d333181d;hp=2f0d42ca102c8f93b17922d385c562451bbbb6ac;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp
diff --git a/src/ui/gui/psppire-data-store.h b/src/ui/gui/psppire-data-store.h
index 2f0d42ca10..2fff2d16dd 100644
--- a/src/ui/gui/psppire-data-store.h
+++ b/src/ui/gui/psppire-data-store.h
@@ -1,12 +1,9 @@
-/* psppire-data-store.h
-
- PSPPIRE --- A Graphical User Interface for PSPP
- Copyright (C) 2006 Free Software Foundation
- Written by John Darrington
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2006, 2009, 2011, 2012 Free Software Foundation
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -15,87 +12,145 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
#ifndef __PSPPIRE_DATA_STORE_H__
#define __PSPPIRE_DATA_STORE_H__
-#include
+#include
#include "psppire-dict.h"
-#include "psppire-case-array.h"
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#define FIRST_CASE_NUMBER 1
-#define GTK_TYPE_DATA_STORE (psppire_data_store_get_type ())
-#define PSPPIRE_DATA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- GTK_TYPE_DATA_STORE, PsppireDataStore))
+G_BEGIN_DECLS
-#define PSPPIRE_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
- GTK_TYPE_DATA_STORE, \
- PsppireDataStoreClass))
+#define PSPPIRE_TYPE_DATA_STORE (psppire_data_store_get_type ())
-#define PSPPIRE_IS_DATA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
+#define PSPPIRE_DATA_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ PSPPIRE_TYPE_DATA_STORE, PsppireDataStore))
-#define PSPPIRE_IS_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
+#define PSPPIRE_DATA_STORE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ PSPPIRE_TYPE_DATA_STORE, \
+ PsppireDataStoreClass))
-#define PSPPIRE_DATA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- GTK_TYPE_DATA_STORE, \
- PsppireDataStoreClass))
+
+#define PSPPIRE_IS_DATA_STORE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DATA_STORE))
+
+#define PSPPIRE_IS_DATA_STORE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DATA_STORE))
+
+#define PSPPIRE_DATA_STORE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ PSPPIRE_TYPE_DATA_STORE, \
+ PsppireDataStoreClass))
typedef struct _PsppireDataStore PsppireDataStore;
typedef struct _PsppireDataStoreClass PsppireDataStoreClass;
struct dictionary;
+
+enum dict_signal_handler {
+ VARIABLE_INSERTED,
+ VARIABLE_CHANGED,
+ VARIABLE_DELETED,
+ n_dict_signals
+};
+
+
+struct datasheet;
+struct casereader;
+
struct _PsppireDataStore
{
GObject parent;
/*< private >*/
+ gboolean dispose_has_run ;
PsppireDict *dict;
- PsppireCaseArray *cases;
- PangoFontDescription *font_desc;
- gboolean show_labels;
+ struct datasheet *datasheet;
+ gint stamp;
- /* Geometry */
- gint margin_width;
+ gint dict_handler_id [n_dict_signals];
};
struct _PsppireDataStoreClass
{
GObjectClass parent_class;
-
- /* Padding for future expansion */
- void (*_gtk_reserved1) (void);
- void (*_gtk_reserved2) (void);
- void (*_gtk_reserved3) (void);
- void (*_gtk_reserved4) (void);
};
-inline GType psppire_data_store_get_type (void) G_GNUC_CONST;
-PsppireDataStore *psppire_data_store_new (PsppireDict *dict, PsppireCaseArray *cases);
+GType psppire_data_store_get_type (void) G_GNUC_CONST;
+PsppireDataStore *psppire_data_store_new (PsppireDict *dict);
+
+
+void psppire_data_store_set_reader (PsppireDataStore *ds,
+ struct casereader *reader);
+
+void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
+ PsppireDict *dict);
+
+void psppire_data_store_clear (PsppireDataStore *data_store);
+
+gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
+
+gboolean psppire_data_store_insert_value (PsppireDataStore *ds,
+ gint width, gint where);
+
+gboolean psppire_data_store_delete_cases (PsppireDataStore *ds, casenumber first, casenumber count);
+
+
+struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
+
+gchar *psppire_data_store_get_string (PsppireDataStore *,
+ glong row, const struct variable *,
+ bool use_value_label);
+
+gchar * psppire_data_store_value_to_string (gpointer unused, PsppireDataStore *store,
+ gint col, gint row,
+ const GValue *v);
+
+gchar * psppire_data_store_value_to_string_with_labels (gpointer unused,
+ PsppireDataStore *store,
+ gint col, gint row,
+ const GValue *v);
+
+gboolean psppire_data_store_string_to_value (GtkTreeModel *model, gint col, gint row,
+ const gchar *in, GValue *out);
+
+gboolean psppire_data_store_get_value (PsppireDataStore *store,
+ glong row, const struct variable *var,
+ union value *val);
+
+gboolean psppire_data_store_set_value (PsppireDataStore *,
+ casenumber casenum,
+ const struct variable *,
+ const union value *);
+
-void psppire_data_store_set_dictionary(PsppireDataStore *data_store, PsppireDict *dict);
-void psppire_data_store_set_font(PsppireDataStore *store, PangoFontDescription *fd);
+gboolean psppire_data_store_set_string (PsppireDataStore *ds,
+ const gchar *text,
+ glong row, const struct variable *,
+ gboolean use_value_label);
-void psppire_data_store_show_labels(PsppireDataStore *store, gboolean show_labels);
+gboolean psppire_data_store_filtered (PsppireDataStore *ds,
+ glong row);
-struct file_handle;
-void psppire_data_store_create_system_file(PsppireDataStore *store,
- struct file_handle *handle);
+casenumber psppire_data_store_get_case_count (const PsppireDataStore *ds);
+size_t psppire_data_store_get_value_count (const PsppireDataStore *ds);
+const struct caseproto *psppire_data_store_get_proto (const PsppireDataStore *);
+
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+struct ccase *psppire_data_store_get_case (const PsppireDataStore *ds,
+ casenumber casenum);
+G_END_DECLS
#endif /* __PSPPIRE_DATA_STORE_H__ */