GnuCash fec5643+
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 5952 of file Account.cpp.

5953{
5955
5956 func->get_private = utest_account_get_private;
5957 func->coll_get_root_account = gnc_coll_get_root_account;
5958 func->xaccFreeAccountChildren = xaccFreeAccountChildren;
5959 func->xaccFreeAccount = xaccFreeAccount;
5960 func->qofAccountSetParent = qofAccountSetParent;
5961 func->gnc_account_lookup_by_full_name_helper =
5962 gnc_account_lookup_by_full_name_helper;
5963
5964 return func;
5965}

◆ xaccAccountRegister()

gboolean xaccAccountRegister ( void  )

Definition at line 5832 of file Account.cpp.

5833{
5834 static QofParam params[] =
5835 {
5836 {
5837 ACCOUNT_NAME_, QOF_TYPE_STRING,
5840 },
5841 {
5842 ACCOUNT_CODE_, QOF_TYPE_STRING,
5845 },
5846 {
5847 ACCOUNT_DESCRIPTION_, QOF_TYPE_STRING,
5850 },
5851 {
5852 ACCOUNT_COLOR_, QOF_TYPE_STRING,
5855 },
5856 {
5857 ACCOUNT_FILTER_, QOF_TYPE_STRING,
5860 },
5861 {
5862 ACCOUNT_SORT_ORDER_, QOF_TYPE_STRING,
5865 },
5866 {
5867 ACCOUNT_SORT_REVERSED_, QOF_TYPE_BOOLEAN,
5870 },
5871 {
5872 ACCOUNT_NOTES_, QOF_TYPE_STRING,
5875 },
5876 {
5877 ACCOUNT_PRESENT_, QOF_TYPE_NUMERIC,
5878 (QofAccessFunc) xaccAccountGetPresentBalance, nullptr
5879 },
5880 {
5881 ACCOUNT_BALANCE_, QOF_TYPE_NUMERIC,
5883 },
5884 {
5885 ACCOUNT_CLEARED_, QOF_TYPE_NUMERIC,
5887 },
5888 {
5889 ACCOUNT_RECONCILED_, QOF_TYPE_NUMERIC,
5891 },
5892 {
5893 ACCOUNT_TYPE_, QOF_TYPE_STRING,
5894 (QofAccessFunc) qofAccountGetTypeString,
5895 (QofSetterFunc) qofAccountSetType
5896 },
5897 {
5898 ACCOUNT_FUTURE_MINIMUM_, QOF_TYPE_NUMERIC,
5899 (QofAccessFunc) xaccAccountGetProjectedMinimumBalance, nullptr
5900 },
5901 {
5902 ACCOUNT_TAX_RELATED, QOF_TYPE_BOOLEAN,
5905 },
5906 {
5907 ACCOUNT_OPENING_BALANCE_, QOF_TYPE_BOOLEAN,
5910 },
5911 {
5912 ACCOUNT_SCU, QOF_TYPE_INT32,
5915 },
5916 {
5917 ACCOUNT_NSCU, QOF_TYPE_BOOLEAN,
5920 },
5921 {
5922 ACCOUNT_PARENT, GNC_ID_ACCOUNT,
5924 (QofSetterFunc) qofAccountSetParent
5925 },
5926 {
5927 QOF_PARAM_BOOK, QOF_ID_BOOK,
5929 },
5930 {
5931 QOF_PARAM_GUID, QOF_TYPE_GUID,
5933 },
5934 { nullptr },
5935 };
5936
5937 qof_class_register (GNC_ID_ACCOUNT, (QofSortFunc) qof_xaccAccountOrder, params);
5938
5939 return qof_object_register (&account_object_def);
5940}
const char * xaccAccountGetName(const Account *acc)
Get the account's name.
Definition Account.cpp:3277
const char * xaccAccountGetDescription(const Account *acc)
Get the account's description.
Definition Account.cpp:3331
void xaccAccountSetColor(Account *acc, const char *str)
Set the account's Color.
Definition Account.cpp:2601
const char * xaccAccountGetColor(const Account *acc)
Get the account's color.
Definition Account.cpp:3338
int xaccAccountGetCommoditySCU(const Account *acc)
Return the SCU for the account.
Definition Account.cpp:2733
void xaccAccountSetName(Account *acc, const char *str)
Set the account's name.
Definition Account.cpp:2446
void xaccAccountSetCommoditySCU(Account *acc, int scu)
Set the SCU for the account.
Definition Account.cpp:2710
void xaccAccountSetFilter(Account *acc, const char *str)
Set the account's Filter.
Definition Account.cpp:2607
void xaccAccountSetNonStdSCU(Account *acc, gboolean flag)
Set the flag indicating that this account uses a non-standard SCU.
Definition Account.cpp:2746
const char * xaccAccountGetSortOrder(const Account *acc)
Get the account's Sort Order.
Definition Account.cpp:3350
void xaccAccountSetDescription(Account *acc, const char *str)
Set the account's description.
Definition Account.cpp:2485
void xaccAccountSetSortReversed(Account *acc, gboolean sortreversed)
Set the account's Sort Order direction.
Definition Account.cpp:2619
gnc_numeric xaccAccountGetBalance(const Account *acc)
Get the current balance of the account, which may include future splits.
Definition Account.cpp:3455
Account * gnc_account_get_parent(const Account *acc)
This routine returns a pointer to the parent of the specified account.
Definition Account.cpp:2923
void xaccAccountSetNotes(Account *acc, const char *str)
Set the account's notes.
Definition Account.cpp:2643
const char * xaccAccountGetFilter(const Account *acc)
Get the account's filter.
Definition Account.cpp:3344
void xaccAccountSetCode(Account *acc, const char *str)
Set the account's accounting code.
Definition Account.cpp:2466
const char * xaccAccountGetNotes(const Account *acc)
Get the account's notes.
Definition Account.cpp:3362
void xaccAccountSetSortOrder(Account *acc, const char *str)
Set the account's Sort Order.
Definition Account.cpp:2613
gnc_numeric xaccAccountGetClearedBalance(const Account *acc)
Get the current balance of the account, only including cleared transactions.
Definition Account.cpp:3462
gnc_numeric xaccAccountGetReconciledBalance(const Account *acc)
Get the current balance of the account, only including reconciled transactions.
Definition Account.cpp:3469
gboolean xaccAccountGetNonStdSCU(const Account *acc)
Return boolean, indicating whether this account uses a non-standard SCU.
Definition Account.cpp:2762
const char * xaccAccountGetCode(const Account *acc)
Get the account's accounting code.
Definition Account.cpp:3324
gboolean xaccAccountGetSortReversed(const Account *acc)
Get the account's Sort Order direction.
Definition Account.cpp:3356
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:4131
void xaccAccountSetIsOpeningBalance(Account *acc, gboolean val)
Set the "opening-balance" flag for an account.
Definition Account.cpp:4141
gboolean xaccAccountGetTaxRelated(const Account *acc)
DOCUMENT ME!
Definition Account.cpp:4023
void xaccAccountSetTaxRelated(Account *acc, gboolean tax_related)
DOCUMENT ME!
Definition Account.cpp:4029
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 2021 of file Account.cpp.

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