64 #ifndef __GNC_BUDGET_H__ 65 #define __GNC_BUDGET_H__ 75 #include "Recurrence.h" 83 #define GNC_TYPE_BUDGET (gnc_budget_get_type ()) 84 #define GNC_BUDGET(o) \ 85 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_BUDGET, GncBudget)) 86 #define GNC_BUDGET_CLASS(k) \ 87 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_BUDGET, GncBudgetClass)) 88 #define GNC_IS_BUDGET(o) \ 89 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_BUDGET)) 90 #define GNC_IS_BUDGET_CLASS(k) \ 91 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_BUDGET)) 92 #define GNC_BUDGET_GET_CLASS(o) \ 93 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_BUDGET, GncBudgetClass)) 94 GType gnc_budget_get_type(
void);
96 #define GNC_BUDGET_MAX_NUM_PERIODS_DIGITS 3 // max num periods == 999 98 #define GNC_BUDGET_NOTES_PATH "notes" 100 gboolean gnc_budget_register(
void);
111 void gnc_budget_begin_edit(GncBudget *bgt);
112 void gnc_budget_commit_edit(GncBudget *bgt);
118 const GncGUID* gnc_budget_get_guid(
const GncBudget* budget);
119 #define gnc_budget_return_guid(X) \ 120 (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null())) 125 const gchar* gnc_budget_get_name(
const GncBudget* budget);
130 const gchar* gnc_budget_get_description(
const GncBudget* budget);
134 guint gnc_budget_get_num_periods(
const GncBudget* budget);
136 void gnc_budget_set_recurrence(GncBudget *budget,
const Recurrence *r);
138 const Recurrence * gnc_budget_get_recurrence(
const GncBudget *budget);
147 void gnc_budget_set_account_period_value(
148 GncBudget* budget,
const Account* account, guint period_num, gnc_numeric val);
149 void gnc_budget_unset_account_period_value(
150 GncBudget* budget,
const Account* account, guint period_num);
152 gboolean gnc_budget_is_account_period_value_set(
153 const GncBudget *budget,
const Account *account, guint period_num);
156 gnc_numeric gnc_budget_get_account_period_value(
157 const GncBudget *budget,
const Account *account, guint period_num);
161 gnc_numeric gnc_budget_get_account_period_actual_value(
162 const GncBudget *budget,
Account *account, guint period_num);
165 void gnc_budget_set_account_period_note(GncBudget *budget,
166 const Account *account, guint period_num,
const gchar *note);
167 const gchar *gnc_budget_get_account_period_note (
const GncBudget *budget,
168 const Account *account, guint period_num);
171 GncBudget* gnc_budget_get_default(QofBook *book);
175 GncBudget* gnc_budget_lookup (
const GncGUID *guid,
const QofBook *book);
176 #define gnc_budget_lookup_direct(g,b) gnc_budget_lookup(&(g),(b)) 183 #endif // __BUDGET_H__ void gnc_budget_set_num_periods(GncBudget *budget, guint num_periods)
Set/Get the number of periods in the Budget.
void gnc_budget_destroy(GncBudget *budget)
Deletes the given budget object.
GncBudget * gnc_budget_new(QofBook *book)
Creates and initializes a Budget.
Account handling public routines.
time64 gnc_budget_get_period_start_date(const GncBudget *budget, guint period_num)
Get the starting date of the Budget period.
GncBudget * gnc_budget_clone(const GncBudget *budget)
Clones a budget creating a copy.
void gnc_budget_set_name(GncBudget *budget, const gchar *name)
Set/Get the name of the Budget.
void gnc_budget_set_description(GncBudget *budget, const gchar *description)
Set/Get the description of the Budget.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
time64 gnc_budget_get_period_end_date(const GncBudget *budget, guint period_num)
Get the ending date of the Budget period.
The type used to store guids in C.