/usr/include/gnucash/gncTaxTable.h is in gnucash-common 1:2.6.15-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | /********************************************************************\
* gncTaxTable.h -- the Gnucash Tax Table interface *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
* *
\********************************************************************/
/** @addtogroup Business
@{ */
/** @addtogroup TaxTable
@{ */
/** @file gncTaxTable.h
@brief Tax Table programming interface
@author Copyright (C) 2002 Derek Atkins <warlord@MIT.EDU>
*/
#ifndef GNC_TAXTABLE_H_
#define GNC_TAXTABLE_H_
/** @struct GncTaxTable
modtime is the internal date of the last modtime\n
See src/doc/business.txt for an explanation of the following\n
Code that handles refcount, parent, child, invisible and children
is *identical* to that in ::GncBillTerm
@param QofInstance inst;
@param char * name;
@param GncTaxTableEntryList* entries;
@param Timespec modtime;
@param gint64 refcount;
@param GncTaxTable * parent; if non-null, we are an immutable child
@param GncTaxTable * child; if non-null, we have not changed
@param gboolean invisible;
@param GList * children; list of children for disconnection
*/
typedef struct _gncTaxTable GncTaxTable;
typedef struct _gncTaxTableClass GncTaxTableClass;
/** @struct GncTaxTableEntry
@param GncTaxTable * table;
@param Account * account;
@param GncAmountType type;
@param gnc_numeric amount;
};
*/
typedef struct _gncTaxTableEntry GncTaxTableEntry;
typedef struct _gncAccountValue GncAccountValue;
#include "Account.h"
#include "qof.h"
#ifdef GNUCASH_MAJOR_VERSION
#include "gncBusiness.h"
#endif
#define GNC_ID_TAXTABLE "gncTaxTable"
/* --- type macros --- */
#define GNC_TYPE_TAXTABLE (gnc_taxtable_get_type ())
#define GNC_TAXTABLE(o) \
(G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_TAXTABLE, GncTaxTable))
#define GNC_TAXTABLE_CLASS(k) \
(G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_TAXTABLE, GncTaxTableClass))
#define GNC_IS_TAXTABLE(o) \
(G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_TAXTABLE))
#define GNC_IS_TAXTABLE_CLASS(k) \
(G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_TAXTABLE))
#define GNC_TAXTABLE_GET_CLASS(o) \
(G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_TAXTABLE, GncTaxTableClass))
GType gnc_taxtable_get_type(void);
/**
* How to interpret the amount.
* You can interpret it as a VALUE or a PERCENT.
*/
typedef enum
{
GNC_AMT_TYPE_VALUE = 1, /**< tax is a number */
GNC_AMT_TYPE_PERCENT /**< tax is a percentage */
} GncAmountType;
/** How to interpret the TaxIncluded */
typedef enum
{
GNC_TAXINCLUDED_YES = 1, /**< tax is included */
GNC_TAXINCLUDED_NO, /**< tax is not included */
GNC_TAXINCLUDED_USEGLOBAL, /**< use the global setting */
} GncTaxIncluded;
const char * gncAmountTypeToString (GncAmountType type);
gboolean gncAmountStringToType (const char *str, GncAmountType *type);
const char * gncTaxIncludedTypeToString (GncTaxIncluded type);
gboolean gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type);
/** @name Create/Destroy Functions
@{ */
GncTaxTable * gncTaxTableCreate (QofBook *book);
void gncTaxTableDestroy (GncTaxTable *table);
GncTaxTableEntry * gncTaxTableEntryCreate (void);
void gncTaxTableEntryDestroy (GncTaxTableEntry *entry);
/** @} */
/** \name Set Functions
@{
*/
void gncTaxTableSetName (GncTaxTable *table, const char *name);
void gncTaxTableIncRef (GncTaxTable *table);
void gncTaxTableDecRef (GncTaxTable *table);
void gncTaxTableEntrySetAccount (GncTaxTableEntry *entry, Account *account);
void gncTaxTableEntrySetType (GncTaxTableEntry *entry, GncAmountType type);
void gncTaxTableEntrySetAmount (GncTaxTableEntry *entry, gnc_numeric amount);
/** @} */
void gncTaxTableAddEntry (GncTaxTable *table, GncTaxTableEntry *entry);
void gncTaxTableRemoveEntry (GncTaxTable *table, GncTaxTableEntry *entry);
void gncTaxTableChanged (GncTaxTable *table);
void gncTaxTableBeginEdit (GncTaxTable *table);
void gncTaxTableCommitEdit (GncTaxTable *table);
gboolean gncTaxTableEqual(const GncTaxTable *a, const GncTaxTable *b);
/** @name Get Functions
@{ */
/** Return a pointer to the instance gncTaxTable that is identified
* by the guid, and is residing in the book. Returns NULL if the
* instance can't be found.
* Equivalent function prototype is
* GncTaxTable * gncTaxTableLookup (QofBook *book, const GncGUID *guid);
*/
static inline GncTaxTable *gncTaxTableLookup (const QofBook* book, const GncGUID *guid)
{
QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_TAXTABLE, GncTaxTable);
}
GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name);
GList * gncTaxTableGetTables (QofBook *book);
const char *gncTaxTableGetName (const GncTaxTable *table);
GncTaxTable *gncTaxTableGetParent (const GncTaxTable *table);
GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new);
#define gncTaxTableGetChild(t) gncTaxTableReturnChild((t),FALSE)
typedef GList GncTaxTableEntryList;
GncTaxTableEntryList* gncTaxTableGetEntries (const GncTaxTable *table);
gint64 gncTaxTableGetRefcount (const GncTaxTable *table);
Timespec gncTaxTableLastModified (const GncTaxTable *table);
Account * gncTaxTableEntryGetAccount (const GncTaxTableEntry *entry);
GncAmountType gncTaxTableEntryGetType (const GncTaxTableEntry *entry);
gnc_numeric gncTaxTableEntryGetAmount (const GncTaxTableEntry *entry);
/** @} */
int gncTaxTableCompare (const GncTaxTable *a, const GncTaxTable *b);
int gncTaxTableEntryCompare (const GncTaxTableEntry *a, const GncTaxTableEntry *b);
gboolean gncTaxTableEntryEqual(const GncTaxTableEntry *a, const GncTaxTableEntry *b);
/************************************************/
struct _gncAccountValue
{
Account * account;
gnc_numeric value;
};
/**
* This will add value to the account-value for acc, creating a new
* list object if necessary
*/
GList *gncAccountValueAdd (GList *list, Account *acc, gnc_numeric value);
/** Merge l2 into l1. l2 is not touched. */
GList *gncAccountValueAddList (GList *l1, GList *l2);
/** return the total for this list */
gnc_numeric gncAccountValueTotal (GList *list);
/** Destroy a list of accountvalues */
void gncAccountValueDestroy (GList *list);
/** QOF parameter definitions */
#define GNC_TT_NAME "tax table name"
#define GNC_TT_REFCOUNT "reference count"
/** @deprecated routine */
#define gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
#define gncTaxTableRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
#define gncTaxTableLookupDirect(G,B) gncTaxTableLookup((B), &(G))
#endif /* GNC_TAXTABLE_H_ */
/** @} */
/** @} */
|