mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make most QofInstance functions private.
Import qofinstance-p.h into QofInstance child classes.
This commit is contained in:
parent
4a4b18059e
commit
1f3fbf4b52
@ -38,6 +38,7 @@
|
||||
#include "gnc-glib-utils.h"
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-pricedb.h"
|
||||
#include "qofinstance-p.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_ACCOUNT;
|
||||
|
||||
|
@ -150,6 +150,9 @@ sxtg_is_dirty(const QofCollection *col)
|
||||
return dirty;
|
||||
}
|
||||
|
||||
/* EFFECTIVE FRIEND FUNCTION declared in qofinstance-p.h */
|
||||
extern void qof_instance_mark_clean (QofInstance *);
|
||||
|
||||
static void
|
||||
sxtg_mark_clean(QofCollection *col)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "Transaction.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "engine-helpers.h"
|
||||
#include "qofinstance-p.h"
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.engine.sx"
|
||||
|
@ -1206,6 +1206,9 @@ xaccAccountScrubCommodity (Account *account)
|
||||
|
||||
/* ================================================================ */
|
||||
|
||||
/* EFFECTIVE FRIEND FUNCTION declared in qofinstance-p.h */
|
||||
extern void qof_instance_set_dirty (QofInstance*);
|
||||
|
||||
static void
|
||||
xaccAccountDeleteOldData (Account *account)
|
||||
{
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-event.h"
|
||||
#include "qofinstance-p.h"
|
||||
|
||||
const char *void_former_amt_str = "void-former-amount";
|
||||
const char *void_former_val_str = "void-former-value";
|
||||
|
@ -22,19 +22,20 @@
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <time.h>
|
||||
#include "qof.h"
|
||||
#include "qofbookslots.h"
|
||||
#include <qof.h>
|
||||
#include <qofbookslots.h>
|
||||
#include <gnc-gdate-utils.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "Account.h"
|
||||
|
||||
#include "gnc-budget.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-gdate-utils.h"
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_ENGINE;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* *
|
||||
*******************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
@ -33,6 +33,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <regex.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-prefs.h"
|
||||
|
@ -39,10 +39,11 @@
|
||||
* Copyright (c) 2002,2003 Linas Vepstas <linas@linas.org>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "Account.h"
|
||||
#include "AccountP.h"
|
||||
|
@ -25,9 +25,10 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncAddress.h"
|
||||
#include "gncAddressP.h"
|
||||
|
@ -26,9 +26,10 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gnc-engine.h"
|
||||
#include "gncBillTermP.h"
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
|
||||
@ -866,7 +867,6 @@ gboolean gncCustomerRegister (void)
|
||||
(QofSetterFunc)gncCustomerSetTaxTableOverride
|
||||
},
|
||||
{ CUSTOMER_TERMS, GNC_ID_BILLTERM, (QofAccessFunc)gncCustomerGetTerms, (QofSetterFunc)gncCustomerSetTerms },
|
||||
{ CUSTOMER_SLOTS, QOF_TYPE_KVP, (QofAccessFunc)qof_instance_get_slots, NULL },
|
||||
{ QOF_PARAM_ACTIVE, QOF_TYPE_BOOLEAN, (QofAccessFunc)gncCustomerGetActive, (QofSetterFunc)gncCustomerSetActive },
|
||||
{ QOF_PARAM_BOOK, QOF_ID_BOOK, (QofAccessFunc)qof_instance_get_book, NULL },
|
||||
{ QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_instance_get_guid, NULL },
|
||||
|
@ -26,10 +26,11 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "Account.h"
|
||||
#include "gnc-commodity.h"
|
||||
|
@ -25,9 +25,10 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
|
||||
|
@ -27,10 +27,11 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "Transaction.h"
|
||||
#include "Account.h"
|
||||
|
@ -26,10 +26,11 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncInvoice.h"
|
||||
#include "gncJob.h"
|
||||
|
@ -25,10 +25,11 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncEntry.h"
|
||||
#include "gncEntryP.h"
|
||||
|
@ -29,11 +29,12 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h> /* for memcpy() */
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncEmployeeP.h"
|
||||
|
@ -26,9 +26,10 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncTaxTableP.h"
|
||||
|
||||
|
@ -26,10 +26,11 @@
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
#include "gncAddressP.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "Account.h"
|
||||
#include "AccountP.h"
|
||||
|
@ -24,9 +24,11 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include "qof.h"
|
||||
#include <qof.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "cashobjects.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
|
@ -24,9 +24,11 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include "qof.h"
|
||||
#include <qof.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncEmployeeP.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncJobP.h"
|
||||
|
@ -24,9 +24,11 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include "qof.h"
|
||||
#include <qof.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncJobP.h"
|
||||
#include "gncInvoiceP.h"
|
||||
#include "gncCustomerP.h"
|
||||
|
@ -24,8 +24,10 @@
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#include "gncInvoiceP.h"
|
||||
#include "gncCustomerP.h"
|
||||
#include "gncJobP.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <unittest-support.h>
|
||||
#include <gnc-event.h>
|
||||
#include <gnc-gdate-utils.h>
|
||||
#include <qofinstance-p.h>
|
||||
/* Add specific headers for this class */
|
||||
#include "../Account.h"
|
||||
#include "../AccountP.h"
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <gnc-lot.h>
|
||||
#include <gnc-event.h>
|
||||
#include <qofbookslots.h>
|
||||
#include <qofinstance-p.h>
|
||||
|
||||
#ifdef HAVE_GLIB_2_38
|
||||
#define _Q "'"
|
||||
|
@ -84,7 +84,6 @@
|
||||
#include "kvp-util-p.h"
|
||||
#include "qofbackend.h"
|
||||
#include "qofid-p.h"
|
||||
#include "qofinstance-p.h"
|
||||
#include "qofbook.h"
|
||||
#include "qofclass.h"
|
||||
#include "qofevent.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "qof.h"
|
||||
#include "qofid-p.h"
|
||||
#include "qofinstance-p.h"
|
||||
|
||||
static QofLogModule log_module = QOF_MOD_ENGINE;
|
||||
static gboolean qof_alt_dirty_mode = FALSE;
|
||||
|
@ -49,9 +49,59 @@ void qof_instance_set_last_update (QofInstance *inst, Timespec ts);
|
||||
* collection flag at all. */
|
||||
void qof_instance_set_dirty_flag (gconstpointer inst, gboolean flag);
|
||||
|
||||
/** Set the GncGUID of this instance */
|
||||
void qof_instance_set_guid (gpointer inst, const GncGUID *guid);
|
||||
|
||||
/** Copy the GncGUID from one instance to another. This routine should
|
||||
* be used with extreme caution, since GncGUID values are everywhere
|
||||
* assumed to be unique. */
|
||||
void qof_instance_copy_guid (gpointer to, gconstpointer from);
|
||||
|
||||
//QofIdType qof_instance_get_e_type (const QofInstance *inst);
|
||||
//void qof_instance_set_e_type (QofInstance *ent, QofIdType e_type);
|
||||
|
||||
/** Return the pointer to the kvp_data */
|
||||
/*@ dependent @*/
|
||||
KvpFrame* qof_instance_get_slots (const QofInstance *);
|
||||
void qof_instance_set_editlevel(gpointer inst, gint level);
|
||||
void qof_instance_increase_editlevel (gpointer ptr);
|
||||
void qof_instance_decrease_editlevel (gpointer ptr);
|
||||
void qof_instance_reset_editlevel (gpointer ptr);
|
||||
/** Set the flag that indicates whether or not this object is about to
|
||||
* be destroyed.
|
||||
*
|
||||
* @param ptr The object whose flag should be set.
|
||||
*
|
||||
* @param value The new value to be set for this object. */
|
||||
void qof_instance_set_destroying (gpointer ptr, gboolean value);
|
||||
|
||||
/** \brief Set the dirty flag
|
||||
Sets this instance AND the collection as dirty.
|
||||
*/
|
||||
void qof_instance_set_dirty(QofInstance* inst);
|
||||
|
||||
/* reset the dirty flag */
|
||||
void qof_instance_mark_clean (QofInstance *);
|
||||
/** Get the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
gint32 qof_instance_get_version (gconstpointer inst);
|
||||
|
||||
/** Set the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
void qof_instance_set_version (gpointer inst, gint32 value);
|
||||
/** Copy the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
void qof_instance_copy_version (gpointer to, gconstpointer from);
|
||||
|
||||
/** Get the instance version_check number */
|
||||
guint32 qof_instance_get_version_check (gconstpointer inst);
|
||||
/** Set the instance version_check number */
|
||||
void qof_instance_set_version_check (gpointer inst, guint32 value);
|
||||
/** copy the instance version_check number */
|
||||
void qof_instance_copy_version_check (gpointer to, gconstpointer from);
|
||||
void qof_instance_set_idata(gpointer inst, guint32 idata);
|
||||
/* Convenience functions to save some typing in property handlers */
|
||||
void qof_instance_set_kvp (QofInstance *inst, const gchar *key, const GValue *value);
|
||||
void qof_instance_get_kvp (QofInstance *inst, const gchar *key, GValue *value);
|
||||
|
||||
|
||||
#endif /* QOF_INSTANCE_P_H */
|
||||
|
@ -121,30 +121,12 @@ const GncGUID * qof_entity_get_guid (gconstpointer);
|
||||
/*@ dependent @*/
|
||||
QofCollection* qof_instance_get_collection (gconstpointer inst);
|
||||
|
||||
/** Set the GncGUID of this instance */
|
||||
void qof_instance_set_guid (gpointer inst, const GncGUID *guid);
|
||||
|
||||
/** Copy the GncGUID from one instance to another. This routine should
|
||||
* be used with extreme caution, since GncGUID values are everywhere
|
||||
* assumed to be unique. */
|
||||
void qof_instance_copy_guid (gpointer to, gconstpointer from);
|
||||
|
||||
/** Compare the GncGUID values of two instances. This routine returns 0
|
||||
* if the two values are equal, <0 if the first is smaller than the
|
||||
* second, or >0 if the second is smaller tan the first. */
|
||||
gint qof_instance_guid_compare(const gconstpointer ptr1, const gconstpointer ptr2);
|
||||
|
||||
//QofIdType qof_instance_get_e_type (const QofInstance *inst);
|
||||
//void qof_instance_set_e_type (QofInstance *ent, QofIdType e_type);
|
||||
|
||||
/** Return the pointer to the kvp_data */
|
||||
/*@ dependent @*/
|
||||
KvpFrame* qof_instance_get_slots (const QofInstance *);
|
||||
void qof_instance_set_editlevel(gpointer inst, gint level);
|
||||
gint qof_instance_get_editlevel (gconstpointer ptr);
|
||||
void qof_instance_increase_editlevel (gpointer ptr);
|
||||
void qof_instance_decrease_editlevel (gpointer ptr);
|
||||
void qof_instance_reset_editlevel (gpointer ptr);
|
||||
|
||||
/** Compare two instances, based on thier last update times.
|
||||
* Returns a negative, zero or positive value, respectively,
|
||||
@ -164,14 +146,6 @@ int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
|
||||
* is passed to the function. */
|
||||
gboolean qof_instance_get_destroying (gconstpointer ptr);
|
||||
|
||||
/** Set the flag that indicates whether or not this object is about to
|
||||
* be destroyed.
|
||||
*
|
||||
* @param ptr The object whose flag should be set.
|
||||
*
|
||||
* @param value The new value to be set for this object. */
|
||||
void qof_instance_set_destroying (gpointer ptr, gboolean value);
|
||||
|
||||
/** Retrieve the flag that indicates whether or not this object has
|
||||
* been modified. This is specifically the flag on the object. It
|
||||
* does not perform any other checking which might normally be
|
||||
@ -191,39 +165,13 @@ void qof_instance_print_dirty (const QofInstance *entity, gpointer dummy);
|
||||
#define qof_instance_is_dirty qof_instance_get_dirty
|
||||
gboolean qof_instance_get_dirty (QofInstance *);
|
||||
|
||||
/** \brief Set the dirty flag
|
||||
|
||||
Sets this instance AND the collection as dirty.
|
||||
*/
|
||||
void qof_instance_set_dirty(QofInstance* inst);
|
||||
|
||||
/* reset the dirty flag */
|
||||
void qof_instance_mark_clean (QofInstance *);
|
||||
|
||||
gboolean qof_instance_get_infant(const QofInstance *inst);
|
||||
|
||||
/** Get the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
gint32 qof_instance_get_version (gconstpointer inst);
|
||||
|
||||
/** Set the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
void qof_instance_set_version (gpointer inst, gint32 value);
|
||||
/** Copy the version number on this instance. The version number is
|
||||
* used to manage multi-user updates. */
|
||||
void qof_instance_copy_version (gpointer to, gconstpointer from);
|
||||
|
||||
/** Get the instance version_check number */
|
||||
guint32 qof_instance_get_version_check (gconstpointer inst);
|
||||
/** Set the instance version_check number */
|
||||
void qof_instance_set_version_check (gpointer inst, guint32 value);
|
||||
/** copy the instance version_check number */
|
||||
void qof_instance_copy_version_check (gpointer to, gconstpointer from);
|
||||
|
||||
/** get the instance tag number
|
||||
used for kvp management in sql backends. */
|
||||
guint32 qof_instance_get_idata (gconstpointer inst);
|
||||
void qof_instance_set_idata(gpointer inst, guint32 idata);
|
||||
|
||||
/**
|
||||
* Returns a displayable name for this object. The returned string must be freed by the caller.
|
||||
|
Loading…
Reference in New Issue
Block a user