Change "union value" to dynamically allocate long strings.
[pspp-builds.git] / src / ui / gui / psppire-data-store.h
index 8e29db33ab9033311b6b662b71c301bb51315ead..610b6b45071bfb48a457aa7d841d98a81f394353 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2006  Free Software Foundation
+   Copyright (C) 2006, 2009  Free Software Foundation
 
    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
 #ifndef __PSPPIRE_DATA_STORE_H__
 #define __PSPPIRE_DATA_STORE_H__
 
-#include <gtksheet/gsheetmodel.h>
 #include "psppire-dict.h"
-#include "psppire-case-file.h"
 
 #define FIRST_CASE_NUMBER 1
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define GTK_TYPE_DATA_STORE           (psppire_data_store_get_type ())
 
@@ -56,50 +52,52 @@ typedef struct _PsppireDataStoreClass  PsppireDataStoreClass;
 
 struct dictionary;
 
+
+enum dict_signal_handler {
+  VARIABLE_INSERTED,
+  VARIABLE_CHANGED,
+  VARIABLE_DELETED,
+  SIZE_CHANGED,
+  n_dict_signals
+};
+
+
+struct datasheet;
+struct casereader;
+
 struct _PsppireDataStore
 {
   GObject parent;
 
   /*< private >*/
+  gboolean dispose_has_run ;
   PsppireDict *dict;
-  PsppireCaseFile *case_file;
-  const PangoFontDescription *font_desc;
-
-  /* The width of an upper case 'M' rendered in the current font */
-  gint width_of_m ;
+  struct datasheet *datasheet;
 
   gboolean show_labels;
 
-  /* Geometry */
-  gint margin_width;
+  //  gint cf_handler_id [n_cf_signals];
+  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;
+GType psppire_data_store_get_type (void) G_GNUC_CONST;
 PsppireDataStore *psppire_data_store_new     (PsppireDict *dict);
 
-void psppire_data_store_set_case_file (PsppireDataStore *data_store,
-                                      PsppireCaseFile *cf);
+
+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_set_font (PsppireDataStore *store,
-                                const PangoFontDescription *fd);
-
 void psppire_data_store_show_labels (PsppireDataStore *store,
-                                   gboolean show_labels);
+                                    gboolean show_labels);
 
 void psppire_data_store_clear (PsppireDataStore *data_store);
 
@@ -118,11 +116,23 @@ gboolean psppire_data_store_set_string (PsppireDataStore *ds,
                                        const gchar *text,
                                        glong row, glong column);
 
+
+gboolean psppire_data_store_filtered (PsppireDataStore *ds,
+                                     glong row);
+
+
 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 *);
+
+\f
+
+struct ccase *psppire_data_store_get_case (const PsppireDataStore *ds,
+                                           casenumber casenum);
+
+
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
 
+G_END_DECLS
 
 #endif /* __PSPPIRE_DATA_STORE_H__ */