]> saetta.ns0.it Git - libgdaex/commitdiff
Starting Grid development.
authorAndrea Zagli <azagli@libero.it>
Mon, 27 Dec 2010 15:54:35 +0000 (16:54 +0100)
committerAndrea Zagli <azagli@libero.it>
Mon, 27 Dec 2010 16:05:12 +0000 (17:05 +0100)
configure.ac
src/Makefile.am
src/gdaex.c
src/gdaex.h [new file with mode: 0644]
src/grid.c [new file with mode: 0644]
src/grid.h [new file with mode: 0644]
src/gridcolumn.c [new file with mode: 0644]
src/gridcolumn.h [new file with mode: 0644]
src/libgdaex.h

index 1c1b691cdfe45b69bd85384147622d8d8b8ce838..ac26915cf337fb145c055a5c0928824bcd298b23 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([libgdaex], [0.2.2], [azagli@libero.it])
+AC_INIT([libgdaex], [0.3.0], [azagli@libero.it])
 AC_CONFIG_SRCDIR([src/gdaex.c])
 AM_CONFIG_HEADER([config.h])
 
@@ -28,7 +28,8 @@ GTK_DOC_CHECK(1.0)
 
 # Checks for libraries.
 PKG_CHECK_MODULES(GDAEX, [libgda-4.0 >= 4
-                          gio-2.0 >= 2.24])
+                          gio-2.0 >= 2.24
+                          gtk+-2.0 >= 2.20])
 
 AC_SUBST(GDAEX_CFLAGS)
 AC_SUBST(GDAEX_LIBS)
index 51393df50699af6f06fdf42ae7b4d6b115dfb610..f0538694b2641fa6a8fade887782e26b1925203b 100644 (file)
@@ -6,8 +6,15 @@ LIBS = $(GDAEX_LIBS)
 
 lib_LTLIBRARIES = libgdaex.la
 
-libgdaex_la_SOURCES = gdaex.c
+libgdaex_la_SOURCES = gdaex.c \
+                      grid.c \
+                      gridcolumn.c
 
 libgdaex_la_LDFLAGS = -no-undefined
 
-include_HEADERS = libgdaex.h
+include_HEADERS = libgdaex.h \
+                  gdaex.h \
+                  grid.h \
+                  gridcolumn.h
+
+libgdaex_includedir = $(includedir)/libgdaex
index a06f79693cc6cac994ff9dfa3704f887a2c1e9c3..a7566de3a97fc7f44dcda1a26dd40dd9dc060954 100644 (file)
@@ -16,7 +16,7 @@
  *  GNU General Public License for more details.
  *  
  *  You should have received a copy of the GNU General Public License
- *  along with libgdaexbj; if not, write to the Free Software
+ *  along with libgdaex; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
@@ -30,7 +30,7 @@
 #include <gio/gio.h>
 #include <libgda/sql-parser/gda-sql-parser.h>
 
-#include "libgdaex.h"
+#include "gdaex.h"
 
 static guint debug;
 static gchar *log_file;
diff --git a/src/gdaex.h b/src/gdaex.h
new file mode 100644 (file)
index 0000000..0bc5b30
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ *  gdaex.h
+ *
+ *  Copyright (C) 2005-2010 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of libgdaex.
+ *  
+ *  libgdaex 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
+ *  (at your option) any later version.
+ *  
+ *  libgdaex is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with libgdaex; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *  
+ */
+
+#include <time.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <libgda/libgda.h>
+
+#ifndef __GDAEX_H__
+#define __GDAEX_H__
+
+G_BEGIN_DECLS
+
+
+#define TYPE_GDAEX                 (gdaex_get_type ())
+#define GDAEX(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX, GdaEx))
+#define GDAEX_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX, GdaExClass))
+#define IS_GDAEX(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX))
+#define IS_GDAEX_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX))
+#define GDAEX_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX, GdaExClass))
+
+
+typedef struct _GdaEx GdaEx;
+typedef struct _GdaExClass GdaExClass;
+
+struct _GdaEx
+       {
+               GObject parent;
+       };
+
+struct _GdaExClass
+       {
+               GObjectClass parent_class;
+
+               guint before_execute_signal_id;
+               guint after_execute_signal_id;
+       };
+
+GType gdaex_get_type (void) G_GNUC_CONST;
+
+
+GdaEx *gdaex_new_from_dsn (const gchar *dsn,
+                           const gchar *username,
+                           const gchar *password);
+GdaEx *gdaex_new_from_string (const gchar *cnc_string);
+GdaEx *gdaex_new_from_connection (GdaConnection *conn);
+
+GOptionGroup *gdaex_get_option_group (GdaEx *gdaex);
+
+const GdaConnection *gdaex_get_gdaconnection (GdaEx *gdaex);
+const gchar *gdaex_get_provider (GdaEx *gdaex);
+
+const gchar *gdaex_get_tables_name_prefix (GdaEx *gdaex);
+void gdaex_set_tables_name_prefix (GdaEx *gdaex, const gchar *tables_name_prefix);
+
+GdaDataModel *gdaex_query (GdaEx *gdaex, const gchar *sql);
+
+gchar *gdaex_data_model_get_field_value_stringify_at (GdaDataModel *data_model,
+                                                     gint row,
+                                                     const gchar *field_name);
+gint gdaex_data_model_get_field_value_integer_at (GdaDataModel *data_model,
+                                                 gint row,
+                                                 const gchar *field_name);
+gfloat gdaex_data_model_get_field_value_float_at (GdaDataModel *data_model,
+                                                 gint row,
+                                                 const gchar *field_name);
+gdouble gdaex_data_model_get_field_value_double_at (GdaDataModel *data_model,
+                                                   gint row,
+                                                   const gchar *field_name);
+gboolean gdaex_data_model_get_field_value_boolean_at (GdaDataModel *data_model,
+                                                     gint row,
+                                                     const gchar *field_name);
+GdaTimestamp *gdaex_data_model_get_field_value_gdatimestamp_at (GdaDataModel *data_model,
+                                                 gint row,
+                                                 const gchar *field_name);
+GDate *gdaex_data_model_get_field_value_gdate_at (GdaDataModel *data_model,
+                                                 gint row,
+                                                 const gchar *field_name);
+struct tm *gdaex_data_model_get_field_value_tm_at (GdaDataModel *data_model,
+                                                 gint row,
+                                                 const gchar *field_name);
+
+gchar *gdaex_data_model_get_value_stringify_at (GdaDataModel *data_model,
+                                               gint row,
+                                               gint col);
+gint gdaex_data_model_get_value_integer_at (GdaDataModel *data_model,
+                                           gint row,
+                                           gint col);
+gfloat gdaex_data_model_get_value_float_at (GdaDataModel *data_model,
+                                           gint row,
+                                           gint col);
+gdouble gdaex_data_model_get_value_double_at (GdaDataModel *data_model,
+                                             gint row,
+                                             gint col);
+gboolean gdaex_data_model_get_value_boolean_at (GdaDataModel *data_model,
+                                               gint row,
+                                               gint col);
+GdaTimestamp *gdaex_data_model_get_value_gdatimestamp_at (GdaDataModel *data_model,
+                                                          gint row,
+                                                          gint col);
+GDate *gdaex_data_model_get_value_gdate_at (GdaDataModel *data_model,
+                                           gint row,
+                                           gint col);
+struct tm *gdaex_data_model_get_value_tm_at (GdaDataModel *data_model,
+                                           gint row,
+                                           gint col);
+
+gboolean gdaex_begin (GdaEx *gdaex);
+
+gint gdaex_execute (GdaEx *gdaex, const gchar *sql);
+
+gboolean gdaex_commit (GdaEx *gdaex);
+gboolean gdaex_rollback (GdaEx *gdaex);
+
+void gdaex_free (GdaEx *gdaex);
+
+gchar *gdaex_strescape (const gchar *source, const gchar *exceptions);
+
+gchar gdaex_get_chr_quoting (GdaEx *gdaex);
+
+
+G_END_DECLS
+
+#endif /* __GDAEX_H__ */
diff --git a/src/grid.c b/src/grid.c
new file mode 100644 (file)
index 0000000..c0282f4
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ *  grid.c
+ *
+ *  Copyright (C) 2005-2010 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of libgdaex_grid.
+ *  
+ *  libgdaex_grid 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
+ *  (at your option) any later version.
+ *  
+ *  libgdaex_grid is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with libgdaex; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
+#include "grid.h"
+
+static void gdaex_grid_class_init (GdaExGridClass *klass);
+static void gdaex_grid_init (GdaExGrid *gdaex_grid);
+
+static void gdaex_grid_set_property (GObject *object,
+                               guint property_id,
+                               const GValue *value,
+                               GParamSpec *pspec);
+static void gdaex_grid_get_property (GObject *object,
+                               guint property_id,
+                               GValue *value,
+                               GParamSpec *pspec);
+
+#define GDAEX_GRID_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GDAEX_GRID, GdaExGridPrivate))
+
+typedef struct
+       {
+               GtkTreeViewColumn *view_col;
+               GdaExGridColumn *grid_col;
+       } _Column;
+
+typedef struct _GdaExGridPrivate GdaExGridPrivate;
+struct _GdaExGridPrivate
+       {
+               GPtrArray *colums; /* _Column */
+       };
+
+G_DEFINE_TYPE (GdaExGrid, gdaex_grid, G_TYPE_OBJECT)
+
+static void
+gdaex_grid_class_init (GdaExGridClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+       g_type_class_add_private (object_class, sizeof (GdaExGridPrivate));
+
+       object_class->set_property = gdaex_grid_set_property;
+       object_class->get_property = gdaex_grid_get_property;
+}
+
+static void
+gdaex_grid_init (GdaExGrid *gdaex_grid)
+{
+       GdaExGridPrivate *priv = GDAEX_GRID_GET_PRIVATE (gdaex_grid);
+}
+
+GdaExGrid
+*gdaex_grid_new ()
+{
+       GdaExGrid *gdaex_grid = GDAEX_GRID (g_object_new (gdaex_grid_get_type (), NULL));
+
+       GdaExGridPrivate *priv = GDAEX_GRID_GET_PRIVATE (gdaex_grid);
+
+       return gdaex_grid;
+}
+
+/* PRIVATE */
+static void
+gdaex_grid_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+{
+       GdaExGrid *gdaex_grid = GDAEX_GRID (object);
+
+       GdaExGridPrivate *priv = GDAEX_GRID_GET_PRIVATE (gdaex_grid);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
+
+static void
+gdaex_grid_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+{
+       GdaExGrid *gdaex_grid = GDAEX_GRID (object);
+
+       GdaExGridPrivate *priv = GDAEX_GRID_GET_PRIVATE (gdaex_grid);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
diff --git a/src/grid.h b/src/grid.h
new file mode 100644 (file)
index 0000000..6c3bb02
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *  grid.h
+ *
+ *  Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of libgdaex.
+ *  
+ *  libgdaex 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
+ *  (at your option) any later version.
+ *  
+ *  libgdaex is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with libgdaex; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *  
+ */
+
+#ifndef __GDAEX_GRID_H__
+#define __GDAEX_GRID_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "gridcolumn.h"
+
+G_BEGIN_DECLS
+
+
+#define TYPE_GDAEX_GRID                 (gdaex_get_type ())
+#define GDAEX_GRID(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX_GRID, GdaExGrid))
+#define GDAEX_GRID_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX_GRID, GdaExGridClass))
+#define IS_GDAEX_GRID(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX_GRID))
+#define IS_GDAEX_GRID_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX_GRID))
+#define GDAEX_GRID_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX_GRID, GdaExGridClass))
+
+
+typedef struct _GdaExGrid GdaExGrid;
+typedef struct _GdaExGridClass GdaExGridClass;
+
+struct _GdaExGrid
+       {
+               GObject parent;
+       };
+
+struct _GdaExGridClass
+       {
+               GObjectClass parent_class;
+       };
+
+GType gdaex_grid_get_type (void) G_GNUC_CONST;
+
+
+GdaExGrid *gdaex_grid_new (void);
+
+void gdaex_grid_add_column (GdaExGrid *grid, GdaExGridColumn *column);
+void gdaex_grid_add_columns (GdaExGrid *grid, GSList *columns);
+
+void gdaex_grid_clear (GdaExGrid *grid);
+
+
+G_END_DECLS
+
+#endif /* __GDAEX_GRID_H__ */
diff --git a/src/gridcolumn.c b/src/gridcolumn.c
new file mode 100644 (file)
index 0000000..d654fc3
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ *  gridcolumn.c
+ *
+ *  Copyright (C) 2005-2010 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of libgdaex_grid_column.
+ *  
+ *  libgdaex_grid_column 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
+ *  (at your option) any later version.
+ *  
+ *  libgdaex_grid_column is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with libgdaex; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
+#include "gridcolumn.h"
+
+static void gdaex_grid_column_class_init (GdaExGridColumnClass *klass);
+static void gdaex_grid_column_init (GdaExGridColumn *gdaex_grid_column);
+
+static void gdaex_grid_column_set_property (GObject *object,
+                               guint property_id,
+                               const GValue *value,
+                               GParamSpec *pspec);
+static void gdaex_grid_column_get_property (GObject *object,
+                               guint property_id,
+                               GValue *value,
+                               GParamSpec *pspec);
+
+#define GDAEX_GRID_COLUMN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GDAEX_GRID_COLUMN, GdaExGridColumnPrivate))
+
+typedef struct _GdaExGridColumnPrivate GdaExGridColumnPrivate;
+struct _GdaExGridColumnPrivate
+       {
+               gchar *title;
+               gchar *field_name;
+               gboolean visible;
+               gboolean resizable;
+               gboolean sortable;
+               gboolean reorderable;
+       };
+
+G_DEFINE_TYPE (GdaExGridColumn, gdaex_grid_column, G_TYPE_OBJECT)
+
+static void
+gdaex_grid_column_class_init (GdaExGridColumnClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+       g_type_class_add_private (object_class, sizeof (GdaExGridColumnPrivate));
+
+       object_class->set_property = gdaex_grid_column_set_property;
+       object_class->get_property = gdaex_grid_column_get_property;
+}
+
+static void
+gdaex_grid_column_init (GdaExGridColumn *gdaex_grid_column)
+{
+       GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (gdaex_grid_column);
+}
+
+GdaExGridColumn
+*gdaex_grid_column_new (const gchar *title,
+                        const gchar *field_name,
+                        gboolean visible,
+                        gboolean resizable,
+                        gboolean sortable,
+                        gboolean reorderable)
+{
+       GdaExGridColumn *gdaex_grid_column = GDAEX_GRID_COLUMN (g_object_new (gdaex_grid_column_get_type (), NULL));
+
+       GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (gdaex_grid_column);
+
+       gdaex_grid_column_set_title (gdaex_grid_column, title);
+       gdaex_grid_column_set_field_name (gdaex_grid_column, field_name);
+       gdaex_grid_column_set_visible (gdaex_grid_column, visible);
+       gdaex_grid_column_set_resizable (gdaex_grid_column, resizable);
+       gdaex_grid_column_set_sortable (gdaex_grid_column, sortable);
+       gdaex_grid_column_set_reorderable (gdaex_grid_column, reorderable);
+
+       return gdaex_grid_column;
+}
+
+void
+gdaex_grid_column_set_title (GdaExGridColumn *column, const gchar *title)
+{
+
+}
+
+const gchar
+*gdaex_grid_column_get_title (GdaExGridColumn *column)
+{
+
+}
+
+void
+gdaex_grid_column_set_field_name (GdaExGridColumn *column, const gchar *field_name)
+{
+
+}
+
+const gchar
+*gdaex_grid_column_get_field_name (GdaExGridColumn *column)
+{
+
+}
+
+void
+gdaex_grid_column_set_visible (GdaExGridColumn *column, gboolean visible)
+{
+
+}
+
+gboolean
+gdaex_grid_column_get_visible (GdaExGridColumn *column)
+{
+
+}
+
+void
+gdaex_grid_column_set_resizable (GdaExGridColumn *column, gboolean resizable)
+{
+
+}
+
+gboolean
+gdaex_grid_column_get_resizable (GdaExGridColumn *column)
+{
+
+}
+
+void
+gdaex_grid_column_set_sortable (GdaExGridColumn *column, gboolean sortable)
+{
+
+}
+
+gboolean
+gdaex_grid_column_get_sortable (GdaExGridColumn *column)
+{
+
+}
+
+void
+gdaex_grid_column_set_reorderable (GdaExGridColumn *column, gboolean reorderable)
+{
+
+}
+
+gboolean
+gdaex_grid_column_get_reorderable (GdaExGridColumn *column)
+{
+
+}
+
+/* PRIVATE */
+static void
+gdaex_grid_column_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+{
+       GdaExGridColumn *gdaex_grid_column = GDAEX_GRID_COLUMN (object);
+
+       GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (gdaex_grid_column);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
+
+static void
+gdaex_grid_column_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+{
+       GdaExGridColumn *gdaex_grid_column = GDAEX_GRID_COLUMN (object);
+
+       GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (gdaex_grid_column);
+
+       switch (property_id)
+               {
+                       default:
+                               G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+                               break;
+               }
+}
diff --git a/src/gridcolumn.h b/src/gridcolumn.h
new file mode 100644 (file)
index 0000000..feeafd8
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ *  gridcolumn.h
+ *
+ *  Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of libgdaex.
+ *
+ *  libgdaex 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
+ *  (at your option) any later version.
+ *
+ *  libgdaex is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with libgdaex; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *  
+ */
+
+#ifndef __GDAEX_GRID_COLUMN_H__
+#define __GDAEX_GRID_COLUMN_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+
+#define TYPE_GDAEX_GRID_COLUMN                 (gdaex_get_type ())
+#define GDAEX_GRID_COLUMN(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX_GRID_COLUMN, GdaExGridColumn))
+#define GDAEX_GRID_COLUMN_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX_GRID_COLUMN, GdaExGridColumnClass))
+#define IS_GDAEX_GRID_COLUMN(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX_GRID_COLUMN))
+#define IS_GDAEX_GRID_COLUMN_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX_GRID_COLUMN))
+#define GDAEX_GRID_COLUMN_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX_GRID_COLUMN, GdaExGridColumnClass))
+
+
+typedef struct _GdaExGridColumn GdaExGridColumn;
+typedef struct _GdaExGridColumnClass GdaExGridColumnClass;
+
+struct _GdaExGridColumn
+       {
+               GObject parent;
+       };
+
+struct _GdaExGridColumnClass
+       {
+               GObjectClass parent_class;
+       };
+
+GType gdaex_grid_column_get_type (void) G_GNUC_CONST;
+
+
+GdaExGridColumn *gdaex_grid_column_new (const gchar *title,
+                                        const gchar *field_name,
+                                        gboolean visible,
+                                        gboolean resizable,
+                                        gboolean sortable,
+                                        gboolean reorderable);
+
+void gdaex_grid_column_set_title (GdaExGridColumn *column, const gchar *title);
+const gchar *gdaex_grid_column_get_title (GdaExGridColumn *column);
+
+void gdaex_grid_column_set_field_name (GdaExGridColumn *column, const gchar *field_name);
+const gchar *gdaex_grid_column_get_field_name (GdaExGridColumn *column);
+
+void gdaex_grid_column_set_visible (GdaExGridColumn *column, gboolean visible);
+gboolean gdaex_grid_column_get_visible (GdaExGridColumn *column);
+
+void gdaex_grid_column_set_resizable (GdaExGridColumn *column, gboolean resizable);
+gboolean gdaex_grid_column_get_resizable (GdaExGridColumn *column);
+
+void gdaex_grid_column_set_sortable (GdaExGridColumn *column, gboolean sortable);
+gboolean gdaex_grid_column_get_sortable (GdaExGridColumn *column);
+
+void gdaex_grid_column_set_reorderable (GdaExGridColumn *column, gboolean reorderable);
+gboolean gdaex_grid_column_get_reorderable (GdaExGridColumn *column);
+
+
+G_END_DECLS
+
+#endif /* __GDAEX_GRID_COLUMN_H__ */
index 0a903b6ae45164290cbdb2934090188fcd25b967..3782ebb82737b4d596d963a4dc1fcb0996b66615 100644 (file)
  *  Copyright (C) 2005-2010 Andrea Zagli <azagli@libero.it>
  *
  *  This file is part of libgdaex.
- *  
+ *
  *  libgdaex 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
  *  (at your option) any later version.
- *  
+ *
  *  libgdaex is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *  
+ *
  *  You should have received a copy of the GNU General Public License
  *  along with libgdaexbj; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *  
  */
 
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <libgda/libgda.h>
-
-#ifndef __GDAEX_H__
-#define __GDAEX_H__
-
-G_BEGIN_DECLS
-
-
-#define TYPE_GDAEX                 (gdaex_get_type ())
-#define GDAEX(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX, GdaEx))
-#define GDAEX_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX, GdaExClass))
-#define IS_GDAEX(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX))
-#define IS_GDAEX_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX))
-#define GDAEX_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX, GdaExClass))
-
-
-typedef struct _GdaEx GdaEx;
-typedef struct _GdaExClass GdaExClass;
-
-struct _GdaEx
-       {
-               GObject parent;
-       };
-
-struct _GdaExClass
-       {
-               GObjectClass parent_class;
-
-               guint before_execute_signal_id;
-               guint after_execute_signal_id;
-       };
-
-GType gdaex_get_type (void) G_GNUC_CONST;
-
-
-GdaEx *gdaex_new_from_dsn (const gchar *dsn,
-                           const gchar *username,
-                           const gchar *password);
-GdaEx *gdaex_new_from_string (const gchar *cnc_string);
-GdaEx *gdaex_new_from_connection (GdaConnection *conn);
-
-GOptionGroup *gdaex_get_option_group (GdaEx *gdaex);
-
-const GdaConnection *gdaex_get_gdaconnection (GdaEx *gdaex);
-const gchar *gdaex_get_provider (GdaEx *gdaex);
-
-const gchar *gdaex_get_tables_name_prefix (GdaEx *gdaex);
-void gdaex_set_tables_name_prefix (GdaEx *gdaex, const gchar *tables_name_prefix);
-
-GdaDataModel *gdaex_query (GdaEx *gdaex, const gchar *sql);
-
-gchar *gdaex_data_model_get_field_value_stringify_at (GdaDataModel *data_model,
-                                                     gint row,
-                                                     const gchar *field_name);
-gint gdaex_data_model_get_field_value_integer_at (GdaDataModel *data_model,
-                                                 gint row,
-                                                 const gchar *field_name);
-gfloat gdaex_data_model_get_field_value_float_at (GdaDataModel *data_model,
-                                                 gint row,
-                                                 const gchar *field_name);
-gdouble gdaex_data_model_get_field_value_double_at (GdaDataModel *data_model,
-                                                   gint row,
-                                                   const gchar *field_name);
-gboolean gdaex_data_model_get_field_value_boolean_at (GdaDataModel *data_model,
-                                                     gint row,
-                                                     const gchar *field_name);
-GdaTimestamp *gdaex_data_model_get_field_value_gdatimestamp_at (GdaDataModel *data_model,
-                                                 gint row,
-                                                 const gchar *field_name);
-GDate *gdaex_data_model_get_field_value_gdate_at (GdaDataModel *data_model,
-                                                 gint row,
-                                                 const gchar *field_name);
-struct tm *gdaex_data_model_get_field_value_tm_at (GdaDataModel *data_model,
-                                                 gint row,
-                                                 const gchar *field_name);
-
-gchar *gdaex_data_model_get_value_stringify_at (GdaDataModel *data_model,
-                                               gint row,
-                                               gint col);
-gint gdaex_data_model_get_value_integer_at (GdaDataModel *data_model,
-                                           gint row,
-                                           gint col);
-gfloat gdaex_data_model_get_value_float_at (GdaDataModel *data_model,
-                                           gint row,
-                                           gint col);
-gdouble gdaex_data_model_get_value_double_at (GdaDataModel *data_model,
-                                             gint row,
-                                             gint col);
-gboolean gdaex_data_model_get_value_boolean_at (GdaDataModel *data_model,
-                                               gint row,
-                                               gint col);
-GdaTimestamp *gdaex_data_model_get_value_gdatimestamp_at (GdaDataModel *data_model,
-                                                          gint row,
-                                                          gint col);
-GDate *gdaex_data_model_get_value_gdate_at (GdaDataModel *data_model,
-                                           gint row,
-                                           gint col);
-struct tm *gdaex_data_model_get_value_tm_at (GdaDataModel *data_model,
-                                           gint row,
-                                           gint col);
-
-gboolean gdaex_begin (GdaEx *gdaex);
-
-gint gdaex_execute (GdaEx *gdaex, const gchar *sql);
-
-gboolean gdaex_commit (GdaEx *gdaex);
-gboolean gdaex_rollback (GdaEx *gdaex);
-
-void gdaex_free (GdaEx *gdaex);
-
-gchar *gdaex_strescape (const gchar *source, const gchar *exceptions);
+#ifndef __LIBGDAEX_H__
+#define __LIBGDAEX_H__
 
-gchar gdaex_get_chr_quoting (GdaEx *gdaex);
 
+#include "gdaex.h"
+#include "grid.h"
+#include "gridcolumn.h"
 
-G_END_DECLS
 
-#endif /* __GDAEX_H__ */
+#endif /* __LIBGDAEX_H__ */