36#ifndef XACC_SCHEDXACTION_H
37#define XACC_SCHEDXACTION_H
44#include "Recurrence.h"
52#define GNC_TYPE_SCHEDXACTION (gnc_schedxaction_get_type ())
53#define GNC_SCHEDXACTION(o) \
54 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTION, SchedXaction))
55#define GNC_SCHEDXACTION_CLASS(k) \
56 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTION, SchedXactionClass))
57#define GNC_IS_SCHEDXACTION(o) \
58 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTION))
59#define GNC_IS_SCHEDXACTION_CLASS(k) \
60 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTION))
61#define GNC_SCHEDXACTION_GET_CLASS(o) \
62 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTION, SchedXactionClass))
63GType gnc_schedxaction_get_type(
void);
65#define GNC_IS_SX(obj) GNC_IS_SCHEDXACTION(obj)
66#define GNC_SX(obj) GNC_SCHEDXACTION(obj)
105 gint num_occurances_total;
107 gint num_occurances_remain;
113 gboolean autoCreateOption;
114 gboolean autoCreateNotify;
115 gint advanceCreateDays;
116 gint advanceRemindDays;
127 QofInstanceClass parent_class;
131typedef struct _SXTmpStateData
138#define xaccSchedXactionSetGUID(X,G) qof_instance_set_guid(QOF_INSTANCE(X),(G))
145void sx_set_template_account (SchedXaction *sx,
Account *account);
152void gnc_sx_begin_edit (SchedXaction *sx);
153void gnc_sx_commit_edit (SchedXaction *sx);
161gchar *xaccSchedXactionGetName(
const SchedXaction *sx );
167const GDate* xaccSchedXactionGetStartDate(
const SchedXaction *sx );
168time64 xaccSchedXactionGetStartDateTT(
const SchedXaction *sx );
169void xaccSchedXactionSetStartDate( SchedXaction *sx,
const GDate* newStart );
170void xaccSchedXactionSetStartDateTT( SchedXaction *sx,
const time64 newStart );
172int xaccSchedXactionHasEndDate(
const SchedXaction *sx );
182const GDate* xaccSchedXactionGetLastOccurDate(
const SchedXaction *sx );
183time64 xaccSchedXactionGetLastOccurDateTT(
const SchedXaction *sx );
184void xaccSchedXactionSetLastOccurDate( SchedXaction *sx,
const GDate* newLastOccur );
185void xaccSchedXactionSetLastOccurDateTT( SchedXaction *sx,
const time64 newLastOccur );
192gint xaccSchedXactionGetNumOccur(
const SchedXaction *sx );
197gint xaccSchedXactionGetRemOccur(
const SchedXaction *sx );
198void xaccSchedXactionSetRemOccur( SchedXaction *sx, gint numRemain );
221GList *xaccSchedXactionGetSplits(
const SchedXaction *sx );
222void xaccSchedXactionSetSplits( SchedXaction *sx, GList *newSplits );
224gboolean xaccSchedXactionGetEnabled(
const SchedXaction *sx );
225void xaccSchedXactionSetEnabled( SchedXaction *sx, gboolean newEnabled );
227void xaccSchedXactionGetAutoCreate(
const SchedXaction *sx,
228 gboolean *outAutoCreate,
229 gboolean *outNotify );
230void xaccSchedXactionSetAutoCreate( SchedXaction *sx,
231 gboolean newAutoCreate,
232 gboolean newNotify );
234gint xaccSchedXactionGetAdvanceCreation(
const SchedXaction *sx );
235void xaccSchedXactionSetAdvanceCreation( SchedXaction *sx, gint createDays );
237gint xaccSchedXactionGetAdvanceReminder(
const SchedXaction *sx );
238void xaccSchedXactionSetAdvanceReminder( SchedXaction *sx, gint reminderDays );
305#define GNC_SX_SHARES "shares"
306#define GNC_SX_FREQ_SPEC "scheduled-frequency"
307#define GNC_SX_NAME "sched-xname"
308#define GNC_SX_START_DATE "sched-start-date"
309#define GNC_SX_LAST_DATE "sched-last-date"
310#define GNC_SX_NUM_OCCUR "sx-total-number"
311#define GNC_SX_REM_OCCUR "sx-remaining-num"
317#define xaccSchedXactionIsDirty(X) qof_instance_is_dirty (QOF_INSTANCE(X))
319#define xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X))
All type declarations for the whole Gnucash engine.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
SXTmpStateData * gnc_sx_clone_temporal_state(SXTmpStateData *stateData)
Allocates and returns a one-by-one copy of the given temporal state.
GList * gnc_sx_get_defer_instances(SchedXaction *sx)
Returns the defer list from the SX.
gint gnc_sx_get_instance_count(const SchedXaction *sx, SXTmpStateData *stateData)
Get the instance count.
void gnc_sx_set_schedule(SchedXaction *sx, GList *schedule)
GDate xaccSchedXactionGetNextInstance(const SchedXaction *sx, SXTmpStateData *stateData)
Returns the next occurrence of a scheduled transaction.
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).
void gnc_sx_remove_defer_instance(SchedXaction *sx, void *deferStateData)
Removes an instance from the deferred list.
void gnc_sx_add_defer_instance(SchedXaction *sx, void *deferStateData)
Adds an instance to the deferred list of the SX.
gboolean xaccSchedXactionHasOccurDef(const SchedXaction *sx)
Returns true if the scheduled transaction has a defined number of occurrences, false if not.
const GDate * xaccSchedXactionGetEndDate(const SchedXaction *sx)
Returns invalid date when there is no end-date specified.
SchedXaction * xaccSchedXactionMalloc(QofBook *book)
Creates and initializes a scheduled transaction.
GList * gnc_sx_get_schedule(const SchedXaction *sx)
gboolean SXRegister(void)
QOF registration.
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.
void xaccSchedXactionSetName(SchedXaction *sx, const gchar *newName)
A copy of the name is made.
void xaccSchedXactionSetEndDate(SchedXaction *sx, const GDate *newEnd)
Set to an invalid GDate to turn off 'end-date' definition.
void gnc_sx_destroy_temporal_state(SXTmpStateData *stateData)
Frees the given stateDate object.
void gnc_sx_incr_temporal_state(const SchedXaction *sx, SXTmpStateData *stateData)
Calculates the next occurrence of the given SX and stores that occurrence in the remporalStateDate.
void xaccSchedXactionDestroy(SchedXaction *sx)
Cleans up and frees a SchedXaction and its associated data.
void xaccSchedXactionSetNumOccur(SchedXaction *sx, gint numNum)
Set to '0' to turn off number-of-occurrences definition.
void gnc_sx_set_instance_count(SchedXaction *sx, gint instanceNum)
Sets the instance count to something other than the default.
Just the variable temporal bits from the SX structure.
A single scheduled transaction.
GList * deferredList
The list of deferred SX instances.