GnuCash 7574033+
Loading...
Searching...
No Matches
AccountP.hpp File Reference

This is the private header for the account structure. More...

#include <vector>
#include <optional>
#include "Account.h"

Go to the source code of this file.

Data Structures

struct  AccountPrivate
struct  Account
 Account in Gnucash. More...
struct  AccountTestFunctions

Macros

#define GNC_ID_ROOT_ACCOUNT   "RootAccount"

Functions

void xaccAccountSetGUID (Account *account, const GncGUID *guid)
gboolean xaccAccountRegister (void)
AccountTestFunctions * _utest_account_fill_functions (void)

Detailed Description

This is the private header for the account structure.

No one outside of the engine should ever include this file.

This header includes prototypes for "dangerous" functions. Invoking any of these functions potentially leave the account in an inconsistent state. If they are not used in the proper setting, they can leave the account structures in an inconsistent state. Thus, these methods should never be used outside of the engine, which is why they are "hidden" here.

Definition in file AccountP.hpp.

Macro Definition Documentation

◆ GNC_ID_ROOT_ACCOUNT

#define GNC_ID_ROOT_ACCOUNT   "RootAccount"

Definition at line 47 of file AccountP.hpp.

Function Documentation

◆ _utest_account_fill_functions()

AccountTestFunctions * _utest_account_fill_functions ( void )

Definition at line 5945 of file Account.cpp.

5946{
5948
5949 func->get_private = utest_account_get_private;
5950 func->coll_get_root_account = gnc_coll_get_root_account;
5951 func->xaccFreeAccountChildren = xaccFreeAccountChildren;
5952 func->xaccFreeAccount = xaccFreeAccount;
5953 func->qofAccountSetParent = qofAccountSetParent;
5954 func->gnc_account_lookup_by_full_name_helper =
5955 gnc_account_lookup_by_full_name_helper;
5956
5957 return func;
5958}

◆ xaccAccountRegister()

gboolean xaccAccountRegister ( void )

Definition at line 5825 of file Account.cpp.

5826{
5827 static QofParam params[] =
5828 {
5829 {
5830 ACCOUNT_NAME_, QOF_TYPE_STRING,
5833 },
5834 {
5835 ACCOUNT_CODE_, QOF_TYPE_STRING,
5838 },
5839 {
5840 ACCOUNT_DESCRIPTION_, QOF_TYPE_STRING,
5843 },
5844 {
5845 ACCOUNT_COLOR_, QOF_TYPE_STRING,
5848 },
5849 {
5850 ACCOUNT_FILTER_, QOF_TYPE_STRING,
5853 },
5854 {
5855 ACCOUNT_SORT_ORDER_, QOF_TYPE_STRING,
5858 },
5859 {
5860 ACCOUNT_SORT_REVERSED_, QOF_TYPE_BOOLEAN,
5863 },
5864 {
5865 ACCOUNT_NOTES_, QOF_TYPE_STRING,
5868 },
5869 {
5870 ACCOUNT_PRESENT_, QOF_TYPE_NUMERIC,
5871 (QofAccessFunc) xaccAccountGetPresentBalance, nullptr
5872 },
5873 {
5874 ACCOUNT_BALANCE_, QOF_TYPE_NUMERIC,
5876 },
5877 {
5878 ACCOUNT_CLEARED_, QOF_TYPE_NUMERIC,
5880 },
5881 {
5882 ACCOUNT_RECONCILED_, QOF_TYPE_NUMERIC,
5884 },
5885 {
5886 ACCOUNT_TYPE_, QOF_TYPE_STRING,
5887 (QofAccessFunc) qofAccountGetTypeString,
5888 (QofSetterFunc) qofAccountSetType
5889 },
5890 {
5891 ACCOUNT_FUTURE_MINIMUM_, QOF_TYPE_NUMERIC,
5892 (QofAccessFunc) xaccAccountGetProjectedMinimumBalance, nullptr
5893 },
5894 {
5895 ACCOUNT_TAX_RELATED, QOF_TYPE_BOOLEAN,
5898 },
5899 {
5900 ACCOUNT_OPENING_BALANCE_, QOF_TYPE_BOOLEAN,
5903 },
5904 {
5905 ACCOUNT_SCU, QOF_TYPE_INT32,
5908 },
5909 {
5910 ACCOUNT_NSCU, QOF_TYPE_BOOLEAN,
5913 },
5914 {
5915 ACCOUNT_PARENT, GNC_ID_ACCOUNT,
5917 (QofSetterFunc) qofAccountSetParent
5918 },
5919 {
5920 QOF_PARAM_BOOK, QOF_ID_BOOK,
5922 },
5923 {
5924 QOF_PARAM_GUID, QOF_TYPE_GUID,
5926 },
5927 { nullptr },
5928 };
5929
5930 qof_class_register (GNC_ID_ACCOUNT, (QofSortFunc) qof_xaccAccountOrder, params);
5931
5932 return qof_object_register (&account_object_def);
5933}
const char * xaccAccountGetName(const Account *acc)
Get the account's name.
Definition Account.cpp:3270
const char * xaccAccountGetDescription(const Account *acc)
Get the account's description.
Definition Account.cpp:3324
void xaccAccountSetColor(Account *acc, const char *str)
Set the account's Color.
Definition Account.cpp:2594
const char * xaccAccountGetColor(const Account *acc)
Get the account's color.
Definition Account.cpp:3331
int xaccAccountGetCommoditySCU(const Account *acc)
Return the SCU for the account.
Definition Account.cpp:2726
void xaccAccountSetName(Account *acc, const char *str)
Set the account's name.
Definition Account.cpp:2439
void xaccAccountSetCommoditySCU(Account *acc, int scu)
Set the SCU for the account.
Definition Account.cpp:2703
void xaccAccountSetFilter(Account *acc, const char *str)
Set the account's Filter.
Definition Account.cpp:2600
void xaccAccountSetNonStdSCU(Account *acc, gboolean flag)
Set the flag indicating that this account uses a non-standard SCU.
Definition Account.cpp:2739
const char * xaccAccountGetSortOrder(const Account *acc)
Get the account's Sort Order.
Definition Account.cpp:3343
void xaccAccountSetDescription(Account *acc, const char *str)
Set the account's description.
Definition Account.cpp:2478
void xaccAccountSetSortReversed(Account *acc, gboolean sortreversed)
Set the account's Sort Order direction.
Definition Account.cpp:2612
gnc_numeric xaccAccountGetBalance(const Account *acc)
Get the current balance of the account, which may include future splits.
Definition Account.cpp:3448
Account * gnc_account_get_parent(const Account *acc)
This routine returns a pointer to the parent of the specified account.
Definition Account.cpp:2916
void xaccAccountSetNotes(Account *acc, const char *str)
Set the account's notes.
Definition Account.cpp:2636
const char * xaccAccountGetFilter(const Account *acc)
Get the account's filter.
Definition Account.cpp:3337
void xaccAccountSetCode(Account *acc, const char *str)
Set the account's accounting code.
Definition Account.cpp:2459
const char * xaccAccountGetNotes(const Account *acc)
Get the account's notes.
Definition Account.cpp:3355
void xaccAccountSetSortOrder(Account *acc, const char *str)
Set the account's Sort Order.
Definition Account.cpp:2606
gnc_numeric xaccAccountGetClearedBalance(const Account *acc)
Get the current balance of the account, only including cleared transactions.
Definition Account.cpp:3455
gnc_numeric xaccAccountGetReconciledBalance(const Account *acc)
Get the current balance of the account, only including reconciled transactions.
Definition Account.cpp:3462
gboolean xaccAccountGetNonStdSCU(const Account *acc)
Return boolean, indicating whether this account uses a non-standard SCU.
Definition Account.cpp:2755
const char * xaccAccountGetCode(const Account *acc)
Get the account's accounting code.
Definition Account.cpp:3317
gboolean xaccAccountGetSortReversed(const Account *acc)
Get the account's Sort Order direction.
Definition Account.cpp:3349
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
The QofAccessFunc defines an arbitrary function pointer for access functions.
Definition qofclass.h:124
void(* QofSetterFunc)(gpointer, gpointer)
The QofSetterFunc defines an function pointer for parameter setters.
Definition qofclass.h:131
void qof_class_register(QofIdTypeConst obj_name, QofSortFunc default_sort_function, const QofParam *params)
This function registers a new object class with the Qof subsystem.
Definition qofclass.cpp:86
int(* QofSortFunc)(gconstpointer, gconstpointer)
This function is the default sort function for a particular object type.
Definition qofclass.h:169
gboolean xaccAccountGetIsOpeningBalance(const Account *acc)
Get the "opening-balance" flag for an account.
Definition Account.cpp:4124
void xaccAccountSetIsOpeningBalance(Account *acc, gboolean val)
Set the "opening-balance" flag for an account.
Definition Account.cpp:4134
gboolean xaccAccountGetTaxRelated(const Account *acc)
DOCUMENT ME!
Definition Account.cpp:4016
void xaccAccountSetTaxRelated(Account *acc, gboolean tax_related)
DOCUMENT ME!
Definition Account.cpp:4022
QofBook * qof_instance_get_book(gconstpointer inst)
Return the book pointer.
const GncGUID * qof_instance_get_guid(gconstpointer inst)
Return the GncGUID of this instance.
gboolean qof_object_register(const QofObject *object)
Register new types of object objects.
#define QOF_PARAM_BOOK
"Known" Object Parameters – all objects must support these
Definition qofquery.h:108

◆ xaccAccountSetGUID()

void xaccAccountSetGUID ( Account * account,
const GncGUID * guid )

Definition at line 2022 of file Account.cpp.

2023{
2024 g_return_if_fail(GNC_IS_ACCOUNT(acc));
2025 g_return_if_fail(guid);
2026
2027 /* XXX this looks fishy and weird to me ... */
2028 PINFO("acct=%p", acc);
2030 qof_instance_set_guid (&acc->inst, guid);
2031 qof_instance_set_dirty(&acc->inst);
2033}
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition Account.cpp:1505
void xaccAccountBeginEdit(Account *acc)
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account up...
Definition Account.cpp:1464
#define PINFO(format, args...)
Print an informational note.
Definition qoflog.h:256