00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00059 #ifndef GNC_LOT_H
00060 #define GNC_LOT_H
00061
00062 typedef struct _GncLotClass GNCLotClass;
00063
00064 #include "qof.h"
00065 #include "gnc-lot-p.h"
00066
00067
00068 #define GNC_TYPE_LOT (gnc_lot_get_type ())
00069 #define GNC_LOT(o) \
00070 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_LOT, GNCLot))
00071 #define GNC_LOT_CLASS(k) \
00072 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_LOT, GNCLotClass))
00073 #define GNC_IS_LOT(o) \
00074 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_LOT))
00075 #define GNC_IS_LOT_CLASS(k) \
00076 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_LOT))
00077 #define GNC_LOT_GET_CLASS(o) \
00078 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_LOT, GNCLotClass))
00079 GType gnc_lot_get_type(void);
00080
00081
00082 GNCLot * gnc_lot_new (QofBook *);
00083 void gnc_lot_destroy (GNCLot *);
00084
00085 GNCLot * gnc_lot_lookup (const GUID *guid, QofBook *book);
00086 QofBook * gnc_lot_get_book (GNCLot *);
00087
00088 void gnc_lot_begin_edit (GNCLot *lot);
00089 void gnc_lot_commit_edit (GNCLot *lot);
00090
00098 void gnc_lot_add_split (GNCLot *, Split *);
00099 void gnc_lot_remove_split (GNCLot *, Split *);
00100
00108 SplitList * gnc_lot_get_split_list (const GNCLot *);
00109 gint gnc_lot_count_splits (const GNCLot *);
00110
00113 Account * gnc_lot_get_account (const GNCLot *);
00114
00118 gnc_numeric gnc_lot_get_balance (GNCLot *);
00119
00124 void gnc_lot_get_balance_before (const GNCLot *, const Split *,
00125 gnc_numeric *, gnc_numeric *);
00126
00132 gboolean gnc_lot_is_closed (GNCLot *);
00133
00139 Split * gnc_lot_get_earliest_split (GNCLot *lot);
00140
00146 Split * gnc_lot_get_latest_split (GNCLot *lot);
00147
00149 const char * gnc_lot_get_title (const GNCLot *);
00150 const char * gnc_lot_get_notes (const GNCLot *);
00151 void gnc_lot_set_title (GNCLot *, const char *);
00152 void gnc_lot_set_notes (GNCLot *, const char *);
00153
00157 KvpFrame * gnc_lot_get_slots (const GNCLot *);
00158
00160 GNCLot * gnc_lot_make_default (Account * acc);
00161
00162 #define gnc_lot_get_guid(X) qof_entity_get_guid(QOF_INSTANCE(X))
00163
00164 #define LOT_IS_CLOSED "is-closed?"
00165 #define LOT_BALANCE "balance"
00166 #define LOT_TITLE "lot-title"
00167 #define LOT_NOTES "notes"
00168 #endif
00169