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  */
00028 
00029 #ifndef QOF_INSTANCE_P_H
00030 #define QOF_INSTANCE_P_H
00031 #include "config.h"
00032 #include "qofinstance.h"
00033 #include "qofclass.h"
00034 
00035 struct QofInstance_s
00036 {
00038     QofEntity entity;
00039 
00041     QofBook *book;
00042 
00047     KvpFrame *kvp_data;
00048 
00052     const QofParam * param;
00053 
00061     QofTime *update_time;
00062 #ifndef QOF_DISABLE_DEPRECATED
00063     Timespec last_update;
00064 #endif
00065     /*  Keep track of nesting level of begin/end edit calls */
00066     gint editlevel;
00067 
00068     /*  In process of being destroyed */
00069     gboolean do_free;
00070 
00071     /*  dirty/clean flag. If dirty, then this instance has been modified,
00072      *  but has not yet been written out to storage (file/database)
00073      */
00074     gboolean dirty;
00075 };
00076 
00077 /* reset the dirty flag */
00078 void qof_instance_mark_clean (QofInstance *);
00079 
00080 void qof_instance_set_slots (QofInstance *, KvpFrame *);
00081 
00082 /*  Set the update time. Reserved for use by the SQL backend;
00083  *  used for comparing version in local memory to that in remote 
00084  *  server. The QofTime becomes the property of the instance.
00085  */
00086 void
00087 qof_instance_set_update_time (QofInstance * inst, QofTime * time);
00088 
00089 #endif /* QOF_INSTANCE_P_H */

Generated on Thu Jan 31 22:50:26 2008 for QOF by  doxygen 1.5.4