src/schema.h

00001 /* 
00002  * Copyright (C) 2006 Piotr Pokora <piotr.pokora@infoglob.pl>
00003  *
00004  * This program is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef _PRIVATE_SCHEMA_H
00020 #define _PRIVATE_SCHEMA_H
00021 
00022 #include "midgard/midgard_schema.h"
00023 
00024 typedef struct _MgdSchemaTypeQuery MgdSchemaTypeQuery;
00025 
00026 struct _MgdSchemaTypeQuery {
00027         gchar *select;
00028         gchar *select_full;
00029         gchar *from;
00030         gchar *where;
00031         const gchar *table;
00032         gchar *link;
00033         gboolean use_lang;
00034         const gchar *tables;
00035         const gchar *primary;
00036         const gchar *parentfield;
00037         const gchar *upfield;
00038 };
00039 
00040 typedef struct _MgdSchemaPropertyAttr MgdSchemaPropertyAttr;
00041 
00042 struct _MgdSchemaPropertyAttr{
00043         GType gtype;
00044         GValue value;
00045         guint8 access_flags;
00046         const gchar *type;
00047         const gchar *dbtype;
00048         const gchar *field;
00049         const gchar *table;
00050         const gchar *upfield;
00051         const gchar *parentfield;
00052         const gchar *primaryfield;
00053         gboolean is_multilang;
00054         const gchar *link;
00055         const gchar *link_target;
00056         gboolean is_link;
00057         gboolean is_linked;
00058         gboolean is_primary;
00059         gboolean is_reversed;
00060 };
00061 
00062 struct _MgdSchemaTypeAttr{
00063         guint base_index;
00064         guint num_properties;
00065         GParamSpec **params;
00066         MgdSchemaPropertyAttr **properties;
00067         GHashTable *prophash;
00068         GHashTable *tables;
00069         const gchar *table;
00070         const gchar *parent;
00071         const gchar *primary;
00072         const gchar *property_up;
00073         const gchar *property_parent;
00074         gboolean use_lang;
00075         GSList *childs;
00076         guint property_count;   
00077         MgdSchemaTypeQuery *query;      
00078 };
00079 
00080 extern MgdSchemaTypeAttr * midgard_schema_lookup_type (MidgardSchema *schema, gchar *type);
00081 
00082 extern GType
00083 midgard_type_register(const gchar *class_name, MgdSchemaTypeAttr *data);
00084 
00085 #endif /* _PRIVATE_SCHEMA_H */

Generated on Thu Feb 22 06:15:18 2007 for midgard-core by  doxygen 1.4.6