/*****************************************************************************/ /* td_db_base.h : Objet Gtk+ * td_db_base.h : Gtk+ object * * * ToutDoux : Chtit gestionnaire de projet - A littl' project manager * Copyright (c) 2000-2001 Philippe Roy * Auteur - Author : Philippe Roy <ph_roy@toutdoux.org> * * * Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier * sous les termes de la licence publique générale GNU telle qu'elle est publiée par * la Free Software Foundation ; soit la version 2 de la licence, ou * (comme vous voulez) toute version ultérieure. * * Ce programme est distribué dans l'espoir qu'il sera utile, * mais SANS AUCUNE GARANTIE ; même sans la garantie de * COMMERCIALITÉ ou d'ADÉQUATION A UN BUT PARTICULIER. Voir la * licence publique générale GNU pour plus de détails. * * Vous devriez avoir reçu une copie de la licence publique générale GNU * avec ce programme ; si ce n'est pas le cas, écrivez à la Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * 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 * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*****************************************************************************/ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <gnome.h> #include <parser.h> #include <tree.h> /*****************************************************************************/ /*** Macros */ /*****************************************************************************/ #define TD_TYPE_DB_BASE (td_db_base_get_type ()) #define TD_DB_BASE(obj) (GTK_CHECK_CAST ((obj), TD_TYPE_DB_BASE, TdDbBase)) #define TD_DB_BASE_CLASS(klass) (GTK_CHECK_CLASS_CASTS ((klass), TD_TYPE_DB_BASE, TdDbBaseClass)) #define TD_IS_DB_BASE(obj) (GTK_CHECK_TYPE ((obj), TD_TYPE_DB_BASE)) #define TD_IS_DB_BASE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TD_TYPE_DB_BASE)) /*****************************************************************************/ /*** Structure */ /*****************************************************************************/ typedef struct _TdDbBase TdDbBase; typedef struct _TdDbBaseClass TdDbBaseClass; struct _TdDbBase { /*< public >*/ GtkObject object; gchar *name; /*** Nom - Name */ gchar *comment; /*** Commantaire - Comments */ GList *table; /*** Schéma des tables - Tables schema */ GList *mod; /*** Paramétrage des modules - Modules parameters */ GList *datatable; /*** Tables de donénes - Datatables */ GtkObject *connection; /*** Connexion - Connection */ }; struct _TdDbBaseClass { GtkObjectClass parent_class; void (*add_table) (TdDbBase *db_base, GtkObject *table); void (*add_mod) (TdDbBase *db_base, GtkObject *mod); void (*add_datatable) (TdDbBase *db_base, GtkObject *datatable); void (*set_connection) (TdDbBase *db_base, GtkObject *connection); }; /*****************************************************************************/ /*** Arguments */ /*****************************************************************************/ static void td_db_base_set_name (TdDbBase *db_base, gchar *name); static void td_db_base_set_comment (TdDbBase *db_base, gchar *comment); static void td_db_base_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); static void td_db_base_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); /*****************************************************************************/ /*** Initialisation */ /*****************************************************************************/ static void td_db_base_init (TdDbBase *db_base); static void td_db_base_class_init (TdDbBaseClass *klass); GtkType td_db_base_get_type (void); GtkObject *td_db_base_new (void); void td_db_base_destroy (TdDbBase *db_base); /*****************************************************************************/ /*** Affectations */ /*****************************************************************************/ void td_db_base_add_table (TdDbBase *db_base, GtkObject *table); void td_db_base_add_mod (TdDbBase *db_base, GtkObject *mod); void td_db_base_add_datatable (TdDbBase *db_base, GtkObject *datatable); void td_db_base_set_connection (TdDbBase *db_base, GtkObject *connection); /*****************************************************************************/ /*** Fichier - File */ /*****************************************************************************/ GtkObject *td_db_base_load (gchar *file); gboolean td_db_base_save (TdDbBase *base, gchar *file);