GnuCash c935c2f+
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
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 5964 of file Account.cpp.

5965{
5967
5968 func->get_private = utest_account_get_private;
5969 func->coll_get_root_account = gnc_coll_get_root_account;
5970 func->xaccFreeAccountChildren = xaccFreeAccountChildren;
5971 func->xaccFreeAccount = xaccFreeAccount;
5972 func->qofAccountSetParent = qofAccountSetParent;
5973 func->gnc_account_lookup_by_full_name_helper =
5974 gnc_account_lookup_by_full_name_helper;
5975
5976 return func;
5977}

◆ xaccAccountRegister()

gboolean xaccAccountRegister ( void  )

Definition at line 5844 of file Account.cpp.

5845{
5846 static QofParam params[] =
5847 {
5848 {
5849 ACCOUNT_NAME_, QOF_TYPE_STRING,
5852 },
5853 {
5854 ACCOUNT_CODE_, QOF_TYPE_STRING,
5857 },
5858 {
5859 ACCOUNT_DESCRIPTION_, QOF_TYPE_STRING,
5862 },
5863 {
5864 ACCOUNT_COLOR_, QOF_TYPE_STRING,
5867 },
5868 {
5869 ACCOUNT_FILTER_, QOF_TYPE_STRING,
5872 },
5873 {
5874 ACCOUNT_SORT_ORDER_, QOF_TYPE_STRING,
5877 },
5878 {
5879 ACCOUNT_SORT_REVERSED_, QOF_TYPE_BOOLEAN,
5882 },
5883 {
5884 ACCOUNT_NOTES_, QOF_TYPE_STRING,
5887 },
5888 {
5889 ACCOUNT_PRESENT_, QOF_TYPE_NUMERIC,
5890 (QofAccessFunc) xaccAccountGetPresentBalance, nullptr
5891 },
5892 {
5893 ACCOUNT_BALANCE_, QOF_TYPE_NUMERIC,
5895 },
5896 {
5897 ACCOUNT_CLEARED_, QOF_TYPE_NUMERIC,
5899 },
5900 {
5901 ACCOUNT_RECONCILED_, QOF_TYPE_NUMERIC,
5903 },
5904 {
5905 ACCOUNT_TYPE_, QOF_TYPE_STRING,
5906 (QofAccessFunc) qofAccountGetTypeString,
5907 (QofSetterFunc) qofAccountSetType
5908 },
5909 {
5910 ACCOUNT_FUTURE_MINIMUM_, QOF_TYPE_NUMERIC,
5911 (QofAccessFunc) xaccAccountGetProjectedMinimumBalance, nullptr
5912 },
5913 {
5914 ACCOUNT_TAX_RELATED, QOF_TYPE_BOOLEAN,
5917 },
5918 {
5919 ACCOUNT_OPENING_BALANCE_, QOF_TYPE_BOOLEAN,
5922 },
5923 {
5924 ACCOUNT_SCU, QOF_TYPE_INT32,
5927 },
5928 {
5929 ACCOUNT_NSCU, QOF_TYPE_BOOLEAN,
5932 },
5933 {
5934 ACCOUNT_PARENT, GNC_ID_ACCOUNT,
5936 (QofSetterFunc) qofAccountSetParent
5937 },
5938 {
5939 QOF_PARAM_BOOK, QOF_ID_BOOK,
5941 },
5942 {
5943 QOF_PARAM_GUID, QOF_TYPE_GUID,
5945 },
5946 { nullptr },
5947 };
5948
5949 qof_class_register (GNC_ID_ACCOUNT, (QofSortFunc) qof_xaccAccountOrder, params);
5950
5951 return qof_object_register (&account_object_def);
5952}
const char * xaccAccountGetName(const Account *acc)
Get the account's name.
Definition Account.cpp:3289
const char * xaccAccountGetDescription(const Account *acc)
Get the account's description.
Definition Account.cpp:3343
void xaccAccountSetColor(Account *acc, const char *str)
Set the account's Color.
Definition Account.cpp:2613
const char * xaccAccountGetColor(const Account *acc)
Get the account's color.
Definition Account.cpp:3350
int xaccAccountGetCommoditySCU(const Account *acc)
Return the SCU for the account.
Definition Account.cpp:2745
void xaccAccountSetName(Account *acc, const char *str)
Set the account's name.
Definition Account.cpp:2458
void xaccAccountSetCommoditySCU(Account *acc, int scu)
Set the SCU for the account.
Definition Account.cpp:2722
void xaccAccountSetFilter(Account *acc, const char *str)
Set the account's Filter.
Definition Account.cpp:2619
void xaccAccountSetNonStdSCU(Account *acc, gboolean flag)
Set the flag indicating that this account uses a non-standard SCU.
Definition Account.cpp:2758
const char * xaccAccountGetSortOrder(const Account *acc)
Get the account's Sort Order.
Definition Account.cpp:3362
void xaccAccountSetDescription(Account *acc, const char *str)
Set the account's description.
Definition Account.cpp:2497
void xaccAccountSetSortReversed(Account *acc, gboolean sortreversed)
Set the account's Sort Order direction.
Definition Account.cpp:2631
gnc_numeric xaccAccountGetBalance(const Account *acc)
Get the current balance of the account, which may include future splits.
Definition Account.cpp:3467
Account * gnc_account_get_parent(const Account *acc)
This routine returns a pointer to the parent of the specified account.
Definition Account.cpp:2935
void xaccAccountSetNotes(Account *acc, const char *str)
Set the account's notes.
Definition Account.cpp:2655
const char * xaccAccountGetFilter(const Account *acc)
Get the account's filter.
Definition Account.cpp:3356
void xaccAccountSetCode(Account *acc, const char *str)
Set the account's accounting code.
Definition Account.cpp:2478
const char * xaccAccountGetNotes(const Account *acc)
Get the account's notes.
Definition Account.cpp:3374
void xaccAccountSetSortOrder(Account *acc, const char *str)
Set the account's Sort Order.
Definition Account.cpp:2625
gnc_numeric xaccAccountGetClearedBalance(const Account *acc)
Get the current balance of the account, only including cleared transactions.
Definition Account.cpp:3474
gnc_numeric xaccAccountGetReconciledBalance(const Account *acc)
Get the current balance of the account, only including reconciled transactions.
Definition Account.cpp:3481
gboolean xaccAccountGetNonStdSCU(const Account *acc)
Return boolean, indicating whether this account uses a non-standard SCU.
Definition Account.cpp:2774
const char * xaccAccountGetCode(const Account *acc)
Get the account's accounting code.
Definition Account.cpp:3336
gboolean xaccAccountGetSortReversed(const Account *acc)
Get the account's Sort Order direction.
Definition Account.cpp:3368
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
The QofAccessFunc defines an arbitrary function pointer for access functions.
Definition qofclass.h:123
void(* QofSetterFunc)(gpointer, gpointer)
The QofSetterFunc defines an function pointer for parameter setters.
Definition qofclass.h:130
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:168
gboolean xaccAccountGetIsOpeningBalance(const Account *acc)
Get the "opening-balance" flag for an account.
Definition Account.cpp:4143
void xaccAccountSetIsOpeningBalance(Account *acc, gboolean val)
Set the "opening-balance" flag for an account.
Definition Account.cpp:4153
gboolean xaccAccountGetTaxRelated(const Account *acc)
DOCUMENT ME!
Definition Account.cpp:4035
void xaccAccountSetTaxRelated(Account *acc, gboolean tax_related)
DOCUMENT ME!
Definition Account.cpp:4041
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 2033 of file Account.cpp.

2034{
2035 g_return_if_fail(GNC_IS_ACCOUNT(acc));
2036 g_return_if_fail(guid);
2037
2038 /* XXX this looks fishy and weird to me ... */
2039 PINFO("acct=%p", acc);
2041 qof_instance_set_guid (&acc->inst, guid);
2042 qof_instance_set_dirty(&acc->inst);
2044}
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition Account.cpp:1516
void xaccAccountBeginEdit(Account *acc)
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account up...
Definition Account.cpp:1475
#define PINFO(format, args...)
Print an informational note.
Definition qoflog.h:256