GnuCash
2.6.99
|
Files | |
file | FreqSpec.h |
Period / Date Frequency Specification. | |
file | SchedXaction.h |
Scheduled Transactions public handling routines. | |
file | SX-book.h |
Anchor Scheduled Transaction info in a book. See src/doc/books.txt for design overview. | |
Data Structures | |
struct | _SchedXaction |
struct | _SchedXactionClass |
struct | _SXTmpStateData |
struct | xaccSchedXactionsDef |
struct | _SchedXactionsClass |
Macros | |
#define | ENUM_LIST_TYPE(_) |
#define | GNC_TYPE_SCHEDXACTION (gnc_schedxaction_get_type ()) |
#define | GNC_SCHEDXACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTION, SchedXaction)) |
#define | GNC_SCHEDXACTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) |
#define | GNC_IS_SCHEDXACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTION)) |
#define | GNC_IS_SCHEDXACTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTION)) |
#define | GNC_SCHEDXACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) |
#define | GNC_IS_SX(obj) GNC_IS_SCHEDXACTION(obj) |
#define | GNC_SX(obj) GNC_SCHEDXACTION(obj) |
#define | xaccSchedXactionSetGUID(X, G) qof_instance_set_guid(QOF_INSTANCE(X),(G)) |
#define | GNC_SX_SHARES "shares" |
#define | GNC_SX_FREQ_SPEC "scheduled-frequency" |
#define | GNC_SX_NAME "sched-xname" |
#define | GNC_SX_START_DATE "sched-start-date" |
#define | GNC_SX_LAST_DATE "sched-last-date" |
#define | GNC_SX_NUM_OCCUR "sx-total-number" |
#define | GNC_SX_REM_OCCUR "sx-remaining-num" |
#define | xaccSchedXactionIsDirty(X) qof_instance_is_dirty (QOF_INSTANCE(X)) |
#define | xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) |
#define | xaccSchedXactionGetSlots(X) qof_instance_get_slots(QOF_INSTANCE(X)) |
#define | GNC_TYPE_SCHEDXACTIONS (gnc_schedxactions_get_type ()) |
#define | GNC_SCHEDXACTIONS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTIONS, SchedXactions)) |
#define | GNC_SCHEDXACTIONS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTIONS, SchedXactionsClass)) |
#define | GNC_IS_SCHEDXACTIONS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTIONS)) |
#define | GNC_IS_SCHEDXACTIONS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTIONS)) |
#define | GNC_SCHEDXACTIONS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTIONS, SchedXactionsClass)) |
#define | GNC_IS_SXES(obj) GNC_IS_SCHEDXACTIONS(obj) |
#define | GNC_SXES(obj) GNC_SCHEDXACTIONS(obj) |
Typedefs | |
typedef struct _SchedXactionClass | SchedXactionClass |
typedef struct _SchedXaction | SchedXaction |
typedef struct _SXTmpStateData | SXTmpStateData |
typedef struct xaccSchedXactionsDef | SchedXactions |
typedef struct _SchedXactionsClass | SchedXactionsClass |
Functions | |
GType | gnc_schedxaction_get_type (void) |
SchedXaction * | xaccSchedXactionMalloc (QofBook *book) |
void | sx_set_template_account (SchedXaction *sx, Account *account) |
void | xaccSchedXactionDestroy (SchedXaction *sx) |
void | gnc_sx_begin_edit (SchedXaction *sx) |
void | gnc_sx_commit_edit (SchedXaction *sx) |
GList * | gnc_sx_get_schedule (const SchedXaction *sx) |
void | gnc_sx_set_schedule (SchedXaction *sx, GList *schedule) |
gchar * | xaccSchedXactionGetName (const SchedXaction *sx) |
void | xaccSchedXactionSetName (SchedXaction *sx, const gchar *newName) |
const GDate * | xaccSchedXactionGetStartDate (const SchedXaction *sx) |
void | xaccSchedXactionSetStartDate (SchedXaction *sx, const GDate *newStart) |
int | xaccSchedXactionHasEndDate (const SchedXaction *sx) |
const GDate * | xaccSchedXactionGetEndDate (const SchedXaction *sx) |
void | xaccSchedXactionSetEndDate (SchedXaction *sx, const GDate *newEnd) |
const GDate * | xaccSchedXactionGetLastOccurDate (const SchedXaction *sx) |
void | xaccSchedXactionSetLastOccurDate (SchedXaction *sx, const GDate *newLastOccur) |
gboolean | xaccSchedXactionHasOccurDef (const SchedXaction *sx) |
gint | xaccSchedXactionGetNumOccur (const SchedXaction *sx) |
void | xaccSchedXactionSetNumOccur (SchedXaction *sx, gint numNum) |
gint | xaccSchedXactionGetRemOccur (const SchedXaction *sx) |
void | xaccSchedXactionSetRemOccur (SchedXaction *sx, gint numRemain) |
gint | gnc_sx_get_num_occur_daterange (const SchedXaction *sx, const GDate *start_date, const GDate *end_date) |
gint | gnc_sx_get_instance_count (const SchedXaction *sx, SXTmpStateData *stateData) |
Get the instance count. More... | |
void | gnc_sx_set_instance_count (SchedXaction *sx, gint instanceNum) |
GList * | xaccSchedXactionGetSplits (const SchedXaction *sx) |
void | xaccSchedXactionSetSplits (SchedXaction *sx, GList *newSplits) |
gboolean | xaccSchedXactionGetEnabled (const SchedXaction *sx) |
void | xaccSchedXactionSetEnabled (SchedXaction *sx, gboolean newEnabled) |
void | xaccSchedXactionGetAutoCreate (const SchedXaction *sx, gboolean *outAutoCreate, gboolean *outNotify) |
void | xaccSchedXactionSetAutoCreate (SchedXaction *sx, gboolean newAutoCreate, gboolean newNotify) |
gint | xaccSchedXactionGetAdvanceCreation (const SchedXaction *sx) |
void | xaccSchedXactionSetAdvanceCreation (SchedXaction *sx, gint createDays) |
gint | xaccSchedXactionGetAdvanceReminder (const SchedXaction *sx) |
void | xaccSchedXactionSetAdvanceReminder (SchedXaction *sx, gint reminderDays) |
GDate | xaccSchedXactionGetNextInstance (const SchedXaction *sx, SXTmpStateData *stateData) |
Returns the next occurrence of a scheduled transaction. More... | |
GDate | xaccSchedXactionGetInstanceAfter (const SchedXaction *sx, GDate *date, SXTmpStateData *stateData) |
void | xaccSchedXactionSetTemplateTrans (SchedXaction *sx, GList *t_t_list, QofBook *book) |
Set the schedxaction's template transaction. More... | |
void | gnc_sx_add_defer_instance (SchedXaction *sx, void *deferStateData) |
Adds an instance to the deferred list of the SX. More... | |
void | gnc_sx_remove_defer_instance (SchedXaction *sx, void *deferStateData) |
Removes an instance from the deferred list. More... | |
GList * | gnc_sx_get_defer_instances (SchedXaction *sx) |
Returns the defer list from the SX. More... | |
gboolean | SXRegister (void) |
QOF registration. | |
GType | gnc_schedxactions_get_type (void) |
SchedXactions * | gnc_book_get_schedxactions (QofBook *book) |
void | gnc_sxes_add_sx (SchedXactions *sxes, SchedXaction *sx) |
void | gnc_sxes_del_sx (SchedXactions *sxes, SchedXaction *sx) |
Account * | gnc_book_get_template_root (const QofBook *book) |
GList * | gnc_sx_get_sxes_referencing_account (QofBook *book, Account *acct) |
Temporal state data. | |
These functions allow us to opaquely save the entire temporal state of ScheduledTransactions. This is used by the "since-last-run" dialog to store the initial state of SXes before modification ... if it later becomes necessary to revert an entire set of changes, we can 'revert' the SX without having to rollback all the individual state changes. | |
SXTmpStateData * | gnc_sx_create_temporal_state (const SchedXaction *sx) |
void | gnc_sx_incr_temporal_state (const SchedXaction *sx, SXTmpStateData *stateData) |
void | gnc_sx_destroy_temporal_state (SXTmpStateData *stateData) |
SXTmpStateData * | gnc_sx_clone_temporal_state (SXTmpStateData *stateData) |
Allocates and returns a one-by-one copy of the given temporal state. More... | |
Scheduled Transactions provide a framework for remembering information about a transactions that are set to occur in the future, either once or periodically.
#define ENUM_LIST_TYPE | ( | _ | ) |
Definition at line 34 of file FreqSpec.h.
#define xaccSchedXactionGetGUID | ( | X | ) | qof_entity_get_guid(QOF_INSTANCE(X)) |
Definition at line 321 of file SchedXaction.h.
#define xaccSchedXactionGetSlots | ( | X | ) | qof_instance_get_slots(QOF_INSTANCE(X)) |
Definition at line 323 of file SchedXaction.h.
#define xaccSchedXactionIsDirty | ( | X | ) | qof_instance_is_dirty (QOF_INSTANCE(X)) |
Definition at line 319 of file SchedXaction.h.
typedef struct _SXTmpStateData SXTmpStateData |
Just the variable temporal bits from the SX structure.
void gnc_sx_add_defer_instance | ( | SchedXaction * | sx, |
void * | deferStateData | ||
) |
Adds an instance to the deferred list of the SX.
Added instances are added in date-sorted order.
Adds an instance to the deferred list of the SX. Added instances are added in (date-)sorted order.
Definition at line 1201 of file SchedXaction.c.
SXTmpStateData* gnc_sx_clone_temporal_state | ( | SXTmpStateData * | stateData | ) |
Allocates and returns a one-by-one copy of the given temporal state.
The caller must destroy the returned object with gnc_sx_destroy_temporal_state() after usage.
Definition at line 1168 of file SchedXaction.c.
SXTmpStateData* gnc_sx_create_temporal_state | ( | const SchedXaction * | sx | ) |
Allocates a new SXTmpStateData object and fills it with the current state of the given sx.
Definition at line 1130 of file SchedXaction.c.
void gnc_sx_destroy_temporal_state | ( | SXTmpStateData * | stateData | ) |
Frees the given stateDate object.
Definition at line 1162 of file SchedXaction.c.
GList* gnc_sx_get_defer_instances | ( | SchedXaction * | sx | ) |
Returns the defer list from the SX.
This is a date-sorted state-data instance list. The list should not be modified by the caller; use the gnc_sx_{add,remove}_defer_instance() functions to modify the list.
Returns the defer list from the SX; this is a (date-)sorted temporal-state-data instance list. The list should not be modified by the caller; use the gnc_sx_{add,remove}_defer_instance() functions to modifiy the list.
sx | Scheduled transaction |
Definition at line 1239 of file SchedXaction.c.
gint gnc_sx_get_instance_count | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Get the instance count.
This is incremented by one for every created instance of the SX. Returns the instance num of the SX unless stateData is non-null, in which case it returns the instance num from the state data.
sx | The instance whose state should be retrieved. |
stateData | may be NULL. |
Definition at line 1009 of file SchedXaction.c.
gint gnc_sx_get_num_occur_daterange | ( | const SchedXaction * | sx, |
const GDate * | start_date, | ||
const GDate * | end_date | ||
) |
Calculates and returns the number of occurrences of the given SX in the given date range (inclusive).
Definition at line 726 of file SchedXaction.c.
GList* gnc_sx_get_schedule | ( | const SchedXaction * | sx | ) |
Definition at line 559 of file SchedXaction.c.
Definition at line 366 of file SX-book.c.
void gnc_sx_incr_temporal_state | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Calculates the next occurrence of the given SX and stores that occurence in the remporalStateDate. The SX is unchanged.
Definition at line 1144 of file SchedXaction.c.
void gnc_sx_remove_defer_instance | ( | SchedXaction * | sx, |
void * | deferStateData | ||
) |
Removes an instance from the deferred list.
If the instance is no longer useful; gnc_sx_destroy_temporal_state() it.
Removes an instance from the deferred list. If the instance is no longer useful; gnc_sx_destroy_temporal_state() it.
Definition at line 1213 of file SchedXaction.c.
void gnc_sx_set_instance_count | ( | SchedXaction * | sx, |
gint | instanceNum | ||
) |
Sets the instance count to something other than the default. As the default is the incorrect value '0', callers should DTRT here.
Definition at line 1028 of file SchedXaction.c.
void gnc_sx_set_schedule | ( | SchedXaction * | sx, |
GList * | schedule | ||
) |
[in] | schedule | A GList<Recurrence*> |
Definition at line 565 of file SchedXaction.c.
void xaccSchedXactionDestroy | ( | SchedXaction * | sx | ) |
Cleans up and frees a SchedXaction and its associated data.
Definition at line 473 of file SchedXaction.c.
const GDate* xaccSchedXactionGetEndDate | ( | const SchedXaction * | sx | ) |
Returns invalid date when there is no end-date specified.
Definition at line 628 of file SchedXaction.c.
GDate xaccSchedXactionGetNextInstance | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Returns the next occurrence of a scheduled transaction.
If the transaction hasn't occurred, then it's based off the start date. Otherwise, it's based off the last-occurrence date.
If state data is NULL, the current value of the SX is used for computation. Otherwise, the values in the state data are used. This allows the caller to correctly create a set of instances into the future for possible action without modifying the SX state until action is actually taken.
Definition at line 874 of file SchedXaction.c.
gboolean xaccSchedXactionHasOccurDef | ( | const SchedXaction * | sx | ) |
Returns true if the scheduled transaction has a defined number of occurrences, false if not.
Definition at line 678 of file SchedXaction.c.
SchedXaction* xaccSchedXactionMalloc | ( | QofBook * | book | ) |
Creates and initializes a scheduled transaction.
Definition at line 404 of file SchedXaction.c.
void xaccSchedXactionSetEndDate | ( | SchedXaction * | sx, |
const GDate * | newEnd | ||
) |
Set to an invalid GDate to turn off 'end-date' definition.
Definition at line 635 of file SchedXaction.c.
void xaccSchedXactionSetName | ( | SchedXaction * | sx, |
const gchar * | newName | ||
) |
A copy of the name is made.
Definition at line 581 of file SchedXaction.c.
void xaccSchedXactionSetNumOccur | ( | SchedXaction * | sx, |
gint | numNum | ||
) |
Set to '0' to turn off number-of-occurrences definition.
Definition at line 690 of file SchedXaction.c.
void xaccSchedXactionSetTemplateTrans | ( | SchedXaction * | sx, |
GList * | t_t_list, | ||
QofBook * | book | ||
) |
Set the schedxaction's template transaction.
t_t_list is a glist of TTInfo's as defined in SX-ttinfo.h. The edit dialog doesn't use this mechanism; maybe it should.
Definition at line 1082 of file SchedXaction.c.