QOF  0.8.0
qofinstance-p.h
00001 /********************************************************************\
00002  * qofinstance-p.h -- private fields common to all object instances *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (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, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00020  *                                                                  *
00021 \********************************************************************/
00022 /*
00023  * Object instance holds many common fields that most
00024  * QofObjects use.
00025  * 
00026  * Copyright (C) 2003 Linas Vepstas <linas@linas.org>
00027  * Copyright 2008 Neil Williams <linux@codehelp.co.uk>
00028  */
00029 
00030 #ifndef QOF_INSTANCE_P_H
00031 #define QOF_INSTANCE_P_H
00032 #include "config.h"
00033 #include "qofinstance.h"
00034 #include "qofclass.h"
00035 
00036 struct QofInstance_s
00037 {
00039     QofEntity entity;
00040 
00042     QofBook *book;
00043 
00048     KvpFrame *kvp_data;
00049 
00053     const QofParam * param;
00054 
00062     QofTime *update_time;
00063 
00064     /*  Keep track of nesting level of begin/end edit calls */
00065     gint editlevel;
00066 
00067     /*  In process of being destroyed */
00068     gboolean do_free;
00069 
00070     /*  dirty/clean flag. If dirty, then this instance has been modified,
00071      *  but has not yet been written out to storage (file/database)
00072      */
00073     gboolean dirty;
00074 };
00075 
00076 /* reset the dirty flag */
00077 void qof_instance_mark_clean (QofInstance *);
00078 
00079 void qof_instance_set_slots (QofInstance *, KvpFrame *);
00080 
00081 /*  Set the update time. Reserved for use by the SQL backend;
00082  *  used for comparing version in local memory to that in remote 
00083  *  server. The QofTime becomes the property of the instance.
00084  */
00085 void
00086 qof_instance_set_update_time (QofInstance * inst, QofTime * time);
00087 
00088 #endif /* QOF_INSTANCE_P_H */