Relocate the locale directory.
[pspp-builds.git] / src / ui / gui / psppire-data-store.h
index 7f03246afad6d5738226b8236152a68b6b84302a..55dcf0683d7e49e96d699b870487244207367027 100644 (file)
@@ -1,11 +1,9 @@
-/* psppire-data-store.h
-
-   PSPPIRE --- A Graphical User Interface for PSPP
+/* PSPPIRE - a graphical user interface for PSPP.
    Copyright (C) 2006  Free Software Foundation
 
    Copyright (C) 2006  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
    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,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -14,9 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    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 <http://www.gnu.org/licenses/>. */
 
 #ifndef __PSPPIRE_DATA_STORE_H__
 #define __PSPPIRE_DATA_STORE_H__
 
 #ifndef __PSPPIRE_DATA_STORE_H__
 #define __PSPPIRE_DATA_STORE_H__
 #include "psppire-dict.h"
 #include "psppire-case-file.h"
 
 #include "psppire-dict.h"
 #include "psppire-case-file.h"
 
+#define FIRST_CASE_NUMBER 1
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 #define GTK_TYPE_DATA_STORE           (psppire_data_store_get_type ())
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 #define GTK_TYPE_DATA_STORE           (psppire_data_store_get_type ())
 
-#define PSPPIRE_DATA_STORE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+#define PSPPIRE_DATA_STORE(obj)        \
+                     (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
                                                                    GTK_TYPE_DATA_STORE, PsppireDataStore))
 
                                                                    GTK_TYPE_DATA_STORE, PsppireDataStore))
 
-#define PSPPIRE_DATA_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
+#define PSPPIRE_DATA_STORE_CLASS(klass) \
+                     (G_TYPE_CHECK_CLASS_CAST ((klass), \
                                                                 GTK_TYPE_DATA_STORE, \
                                                                  PsppireDataStoreClass))
 
                                                                 GTK_TYPE_DATA_STORE, \
                                                                  PsppireDataStoreClass))
 
-#define PSPPIRE_IS_DATA_STORE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
 
 
-#define PSPPIRE_IS_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
+#define PSPPIRE_IS_DATA_STORE(obj) \
+                    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
+
+#define PSPPIRE_IS_DATA_STORE_CLASS(klass) \
+                     (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
 
 
-#define PSPPIRE_DATA_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+#define PSPPIRE_DATA_STORE_GET_CLASS(obj) \
+                     (G_TYPE_INSTANCE_GET_CLASS ((obj), \
                                                                   GTK_TYPE_DATA_STORE, \
                                                                   PsppireDataStoreClass))
 
                                                                   GTK_TYPE_DATA_STORE, \
                                                                   PsppireDataStoreClass))
 
@@ -51,11 +56,32 @@ typedef struct _PsppireDataStoreClass  PsppireDataStoreClass;
 
 struct dictionary;
 
 
 struct dictionary;
 
+
+enum cf_signal_handler {
+  CASES_DELETED,
+  CASE_INSERTED,
+  CASE_CHANGED,
+  n_cf_signals
+};
+
+
+enum dict_signal_handler {
+  VARIABLE_INSERTED,
+  VARIABLE_CHANGED,
+  VARIABLE_DELETED,
+  SIZE_CHANGED,
+  n_dict_signals
+};
+
+void do_this_thing (PsppireDict *, struct dictionary *, void *);
+
+
 struct _PsppireDataStore
 {
   GObject parent;
 
   /*< private >*/
 struct _PsppireDataStore
 {
   GObject parent;
 
   /*< private >*/
+  gboolean dispose_has_run ;
   PsppireDict *dict;
   PsppireCaseFile *case_file;
   const PangoFontDescription *font_desc;
   PsppireDict *dict;
   PsppireCaseFile *case_file;
   const PangoFontDescription *font_desc;
@@ -67,6 +93,9 @@ struct _PsppireDataStore
 
   /* Geometry */
   gint margin_width;
 
   /* Geometry */
   gint margin_width;
+
+  gint cf_handler_id [n_cf_signals];
+  gint dict_handler_id [n_dict_signals];
 };
 
 struct _PsppireDataStoreClass
 };
 
 struct _PsppireDataStoreClass
@@ -98,22 +127,23 @@ void psppire_data_store_show_labels (PsppireDataStore *store,
 
 void psppire_data_store_clear (PsppireDataStore *data_store);
 
 
 void psppire_data_store_clear (PsppireDataStore *data_store);
 
-struct file_handle;
+gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
 
 
-void psppire_data_store_create_system_file (PsppireDataStore *store,
-                                           struct file_handle *handle);
 
 
-gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn);
+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 *ds,
 
 
 struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
 
 gchar * psppire_data_store_get_string (PsppireDataStore *ds,
-                                      gint row, gint column);
+                                      casenumber row, glong column);
 
 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
                                        const gchar *text,
 
 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
                                        const gchar *text,
-                                       gint row, gint column);
+                                       glong row, glong column);
+
+inline casenumber psppire_data_store_get_case_count (const PsppireDataStore *ds);
+size_t psppire_data_store_get_value_count (const PsppireDataStore *ds);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }