26 #ifndef _GNC_SX_INSTANCE_MODEL_H 27 #define _GNC_SX_INSTANCE_MODEL_H 31 #include <glib-object.h> 37 #define GNC_TYPE_SX_INSTANCE_MODEL (gnc_sx_instance_model_get_type ()) 38 #define GNC_SX_INSTANCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModel)) 39 #define GNC_SX_INSTANCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModelClass)) 40 #define GNC_IS_SX_INSTANCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_SX_INSTANCE_MODEL)) 41 #define GNC_IS_SX_INSTANCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_SX_INSTANCE_MODEL)) 42 #define GNC_SX_INSTANCE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModelClass)) 44 typedef struct _GncSxInstanceModel
50 gint qof_event_handler_id;
59 gboolean include_disabled;
60 GList *sx_instance_list;
63 typedef struct _GncSxInstanceModelClass
67 guint removing_signal_id;
68 guint updated_signal_id;
69 guint added_signal_id;
72 typedef struct _GncSxInstances
76 gboolean variable_names_parsed;
78 GDate next_instance_date;
86 SX_INSTANCE_STATE_IGNORED,
87 SX_INSTANCE_STATE_POSTPONED,
88 SX_INSTANCE_STATE_TO_CREATE,
89 SX_INSTANCE_STATE_REMINDER,
90 SX_INSTANCE_STATE_CREATED,
91 SX_INSTANCE_STATE_MAX_STATE
94 typedef struct _GncSxVariable
101 typedef struct _GncSxInstance
111 typedef struct _GncSxVariableNeeded
117 GType gnc_sx_instance_model_get_type(
void);
137 void gnc_sx_instance_model_remove_sx_instances(
GncSxInstanceModel *model, SchedXaction *sx);
149 Account* gnc_sx_get_template_transaction_account(
const SchedXaction *sx);
156 GncSxVariable* gnc_sx_variable_new_full(gchar *name, gnc_numeric value, gboolean editable);
187 GncSxInstanceState new_state);
192 gnc_numeric *new_value);
203 gboolean auto_create_only,
204 GList **created_transaction_guids,
205 GList **creation_errors);
207 typedef struct _GncSxSummary
227 void gnc_sx_get_variables(SchedXaction *sx, GHashTable *var_hash);
228 int gnc_sx_parse_vars_from_formula(
const char *formula, GHashTable *var_hash, gnc_numeric *result);
229 void gnc_sx_randomize_variables(GHashTable *vars);
247 const GDate *range_start,
const GDate *range_end,
248 GHashTable* map, GList **creation_errors);
262 #endif // _GNC_SX_INSTANCE_MODEL_H GHashTable * variable_bindings
variable bindings.
GHashTable * gnc_g_hash_new_guid_numeric(void)
Returns a GHashTable<GUID*, gnc_numeric*> with no destructor for the key, but a destructor for the va...
SXTmpStateData * temporal_state
the sx creation temporal state.
GHashTable * variable_names
<name:char*,GncSxVariable*>
void gnc_sx_scrub_split_numerics(gpointer psplit, gpointer user)
Fix up numerics where they've gotten out-of-sync with the formulas.
void gnc_sx_instance_model_change_instance_state(GncSxInstanceModel *model, GncSxInstance *instance, GncSxInstanceState new_state)
There is a constraint around a sequence of upcoming instance states.
GHashTable * gnc_sx_all_instantiate_cashflow_all(GDate range_start, GDate range_end)
Simplified wrapper around gnc_sx_all_instantiate_cashflow(): Run that function on all SX of the curre...
gint num_auto_create_no_notify_instances
The number of automatically-created instances that do no request notification.
An exact-rational-number library for gnucash.
GncSxInstanceState orig_state
the original state at generation time.
GHashTable * gnc_sx_instance_get_variables_for_parser(GHashTable *instance_var_hash)
void gnc_sx_instance_model_summarize(GncSxInstanceModel *model, GncSxSummary *summary)
void gnc_sx_instance_model_update_sx_instances(GncSxInstanceModel *model, SchedXaction *sx)
Regenerates and updates the GncSxInstances* for the given SX.
void gnc_sx_instance_model_effect_change(GncSxInstanceModel *model, gboolean auto_create_only, GList **created_transaction_guids, GList **creation_errors)
Really ("effectively") create the transactions from the SX instances in the given model...
Just the variable temporal bits from the SX structure.
gint num_to_create_instances
The number of (not-auto-create) to-create instances.
gint num_instances
The number of total instances (in any state).
void gnc_sx_summary_print(const GncSxSummary *summary)
Debug output to trace file.
GncSxInstances * parent
the parent instances collection.
gint num_auto_create_instances
The total number of auto-create instances.
GDate date
the instance date.
void gnc_sx_all_instantiate_cashflow(GList *all_sxes, const GDate *range_start, const GDate *range_end, GHashTable *map, GList **creation_errors)
Instantiates the cash flow of all given SXs (in the given GList<SchedXAction*>) into the GHashTable<G...
GList * gnc_sx_instance_get_variables(GncSxInstance *inst)
GncSxInstanceModel * gnc_sx_get_instances(const GDate *range_end, gboolean include_disabled)
Allocates a new SxInstanceModel and fills it with generated instances for all scheduled transactions ...
gnc_numeric value
only numeric values are supported.
GncSxInstanceState state
the current state of the instance (during editing)
GncSxInstanceModel * gnc_sx_get_current_instances(void)
Shorthand for get_instances(now, FALSE);.
GList * instance_list
GList<GncSxInstance*>
Scheduled Transactions public handling routines.
gboolean need_dialog
If the dialog needs to be displayed.
GList * gnc_sx_instance_model_check_variables(GncSxInstanceModel *model)