00001 /********************************************************************\ 00002 * qofinstance.h -- 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 \********************************************************************/ 00036 #ifndef QOF_INSTANCE_H 00037 #define QOF_INSTANCE_H 00038 00039 #include "guid.h" 00040 #include "qofbook.h" 00041 #include "qofid.h" 00042 #include "qoftime.h" 00043 #include "kvpframe.h" 00044 00045 /* --- type macros --- */ 00046 /* cheesy, but will do for now, eventually should be more gtk-like, handle 00047 * thunks, etc. */ 00048 #define QOF_INSTANCE(object) ((QofInstance *)(object)) 00049 00050 typedef struct QofInstance_s QofInstance; 00051 00053 void qof_instance_init (QofInstance *, QofIdType, QofBook *); 00054 00057 void qof_instance_release (QofInstance * inst); 00058 00060 QofBook *qof_instance_get_book (QofInstance *); 00061 00063 const GUID *qof_instance_get_guid (QofInstance *); 00064 00066 KvpFrame *qof_instance_get_slots (QofInstance *); 00067 00074 QofTime *qof_instance_get_update_time (QofInstance * inst); 00075 00082 gint qof_instance_version_cmp (QofInstance * left, QofInstance * right); 00083 00085 gboolean qof_instance_is_dirty (QofInstance *); 00086 00091 void qof_instance_set_dirty (QofInstance * inst); 00092 00093 gboolean qof_instance_check_edit (QofInstance * inst); 00094 00095 gboolean qof_instance_do_free (QofInstance * inst); 00096 00097 void qof_instance_mark_free (QofInstance * inst); 00098 00099 QofInstance *qof_instance_create (QofIdType type, QofBook * book); 00100 00110 void qof_instance_gemini (QofInstance * to, QofInstance * from); 00111 00126 QofInstance *qof_instance_lookup_twin (QofInstance * src, QofBook * book); 00127 00128 /* @} */ 00129 /* @} */ 00130 #endif /* QOF_INSTANCE_H */