68#define QOF_TYPE_BOOK (qof_book_get_type ())
70 (G_TYPE_CHECK_INSTANCE_CAST ((o), QOF_TYPE_BOOK, QofBook))
71#define QOF_BOOK_CLASS(k) \
72 (G_TYPE_CHECK_CLASS_CAST((k), QOF_TYPE_BOOK, QofBookClass))
73#define QOF_IS_BOOK(o) \
74 (G_TYPE_CHECK_INSTANCE_TYPE ((o), QOF_TYPE_BOOK))
75#define QOF_IS_BOOK_CLASS(k) \
76 (G_TYPE_CHECK_CLASS_TYPE ((k), QOF_TYPE_BOOK))
77#define QOF_BOOK_GET_CLASS(o) \
78 (G_TYPE_INSTANCE_GET_CLASS ((o), QOF_TYPE_BOOK, QofBookClass))
80typedef void (*QofBookDirtyCB) (
QofBook *, gboolean dirty, gpointer user_data);
87 QofInstanceClass parent_class;
90GType qof_book_get_type(
void);
101#define QOF_BOOK_RETURN_ENTITY(book,guid,e_type,c_type) { \
102 QofInstance *val = NULL; \
103 if ((guid != NULL) && (book != NULL)) { \
104 const QofCollection *col; \
105 col = qof_book_get_collection (book, e_type); \
106 val = qof_collection_lookup_entity (col, guid); \
108 return (c_type *) val; \
116typedef void (*QofBookFinalCB) (
QofBook *, gpointer key, gpointer user_data);
136gboolean qof_book_is_open (
const QofBook *book);
192void qof_book_reset_num_days_autoreadonly_cache (
QofBook *book);
299 const char *counter_name);
301const char* qof_book_get_string_option(
const QofBook* book,
const char* opt_name);
302void qof_book_set_string_option(
QofBook* book,
const char* opt_name,
const char* opt_val);
303const GncGUID* qof_book_get_guid_option(
QofBook* book, GSList* path);
304void qof_book_option_frame_delete (
QofBook *book,
const char* opt_name);
309void qof_book_unset_feature (
QofBook *book,
const gchar *key);
310void qof_book_set_feature (
QofBook *book,
const gchar *key,
const gchar *descr);
312void qof_book_begin_edit(
QofBook *book);
313void qof_book_commit_edit(
QofBook *book);
362#define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X))
Holds all of the options for a book, report, or stylesheet, organized by GncOptionSections.
gpointer qof_book_get_data(const QofBook *book, const gchar *key)
Retrieves arbitrary pointers to structs stored by qof_book_set_data.
void qof_book_destroy(QofBook *book)
End any editing sessions associated with book, and free all memory associated with it.
gint64 qof_book_get_counter(QofBook *book, const char *counter_name)
This will get the named counter for this book.
gchar * qof_book_get_default_invoice_report_guid(const QofBook *book)
Get the guid of the Invoice Report to be used as the default for printing Invoices.
QofCollection * qof_book_get_collection(const QofBook *, QofIdType)
Return The table of entities of the given type.
gchar * qof_book_get_default_invoice_report_name(const QofBook *book)
Get the name of the Invoice Report to be used as the default for printing Invoices.
void qof_book_mark_readonly(QofBook *book)
Mark the book as read only.
GHashTable * qof_book_get_features(QofBook *book)
Access functions for reading and setting the used-features on this book.
gboolean qof_book_shutting_down(const QofBook *book)
Is the book shutting down?
void qof_book_mark_session_dirty(QofBook *book)
The qof_book_mark_dirty() routine marks the book as having been modified.
gchar * qof_book_normalize_counter_format(const gchar *format, gchar **err_msg)
Validate a counter format string.
void qof_book_set_data_fin(QofBook *book, const gchar *key, gpointer data, QofBookFinalCB)
Same as qof_book_set_data(), except that the callback will be called when the book is destroyed.
gboolean qof_book_session_not_saved(const QofBook *book)
qof_book_not_saved() returns the value of the session_dirty flag, set when changes to any object in t...
char * qof_book_get_counter_format(const QofBook *book, const char *counter_name)
Get the format string to use for the named counter.
gint qof_book_get_num_days_autoreadonly(const QofBook *book)
Returns the number of days for auto-read-only transactions.
void qof_book_set_dirty_cb(QofBook *book, QofBookDirtyCB cb, gpointer user_data)
Set the function to call when a book transitions from clean to dirty, or vice versa.
QofBook * qof_book_new(void)
Allocate, initialise and return a new QofBook.
gdouble qof_book_get_default_invoice_report_timeout(const QofBook *book)
Get the length of time available to change the used Invoice Report when printing Invoices.
GDate * qof_book_get_autoreadonly_gdate(const QofBook *book)
Returns the GDate that is the threshold for auto-read-only.
void qof_book_mark_closed(QofBook *book)
Close a book to editing.
gboolean qof_book_is_readonly(const QofBook *book)
Return whether the book is read only.
void(* QofCollectionForeachCB)(QofCollection *, gpointer user_data)
Invoke the indicated callback on each collection in the book.
void qof_book_set_default_invoice_report(QofBook *book, const gchar *guid, const gchar *name)
Save the Invoice Report name / guid to be used as the default for printing Invoices.
gboolean qof_book_uses_autoreadonly(const QofBook *book)
Returns TRUE if the auto-read-only feature should be used, otherwise FALSE.
gboolean qof_book_register(void)
Register the book object with the QOF object system.
gboolean qof_book_use_trading_accounts(const QofBook *book)
Returns flag indicating whether this book uses trading accounts.
void qof_book_mark_session_saved(QofBook *book)
The qof_book_mark_saved() routine marks the book as having been saved (to a file, to a database).
gboolean qof_book_use_split_action_for_num_field(const QofBook *book)
Returns TRUE if this book uses split action field as the 'Num' field, FALSE if it uses transaction nu...
void qof_book_set_data(QofBook *book, const gchar *key, gpointer data)
The qof_book_set_data() allows arbitrary pointers to structs to be stored in QofBook.
gboolean qof_book_empty(const QofBook *book)
Check if the book has had anything loaded into it.
GList QofBookList
GList of QofBook.
gchar * qof_book_increment_and_format_counter(QofBook *book, const char *counter_name)
This will increment the named counter for this book and format it.
time64 qof_book_get_session_dirty_time(const QofBook *book)
Retrieve the earliest modification time on the book.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
const gchar * QofIdType
QofIdType declaration.
void qof_book_set_option(QofBook *book, KvpValue *value, GSList *path)
Save a single option value.
KvpValue * qof_book_get_option(QofBook *book, GSList *path)
Read a single option value.
void qof_book_save_options(QofBook *book, GncOptionSave save_cb, GncOptionDB *odb, gboolean clear)
Save a GncOptionsDB back to the book's KVP.
void qof_book_options_delete(QofBook *book, GSList *path)
Delete the options.
void qof_book_load_options(QofBook *book, GncOptionLoad load_cb, GncOptionDB *odb)
Load a GncOptionsDB from KVP data.
API for data storage Backend.
QOF entity type identification system.
Object instance holds common fields that most gnucash objects use.
The type used to store guids in C.
Implements KvpValue using boost::variant.