| [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you".
A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements."
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the license is included in the section entitled "GNU Free Documentation License". |
If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document defines the design and architecture of the GnuCash program, an application for tracking finances. GnuCash is composed of several subsystems or modules. This document describes each module, specifying its interface and, where appropriate, its implementation, as well as describing the interactions between each module.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Anyone who plans on making a significant change or addition to GnuCash's functionality should read this document. By adhering to the structure presented here, your contribution will be more likely to work correctly with existing and future features.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GnuCash is intended to be a finance and accounting program for individuals and small businesses. As such, it should have the following primary features:
A more comprehensive list of current and planned features for GnuCash is located at http://cvs.gnucash.org/linux/gnucash/projects.html.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GnuCash is written primarily in two languages: C and Scheme. The engine/server is written in C primarily for speed, portability, stability and historical purposes. Much of the day-to-day workhorse code is written in Scheme, primarily for its power, expressiveness and ease of development. The user interface is Gtk/Gnome, some of it written in C, some in scheme, and some with the GUI designer tool Glade glade.pn.org.
GnuCash is modular, thereby allowing separate individuals to maintain, develop and enhance certain modules without disturbing the overall development. (Never mind that modules help avoid spaghetti code and nasty, ugly hacks). The interfaces between modules are documented, and, for the most part, stable and unchanging.
GnuCash currently consists of the following modules:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Engine (located under the `src/engine' directory in the GnuCash codebase) provides an interface for creating, manipulating, and destroying three basic financial entities: Accounts, Transactions (known as Journal Entries in accounting practice), and Splits (known as Ledger Entries). These three entities are the central data structures of the GnuCash financial data model.
The Engine code contains no GUI code whatsoever.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Query module (`src/engine/Query.*') provides an interface into the engine for finding transactions based on a set of criteria, such as description, date posted, account membership, etc. Simple queries can be combined using standard boolean operators.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The File I/O module (`src/engine/FileIO.*') provides an interface for reading and writing a set of Accounts, Transactions, and Splits to a binary file. This module is deprecated.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The XML I/O module (`src/engine/*xml*.*' and `src/engine/*sixtp*.*') provides an interface for reading and writing the engine information to an XML format.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Backend module (`src/engine/Backend*.*') provides hooks to allow different modules to be used for storing and retrieving Engine data. There are two backends currently under development, a Postgresql backend (`src/engine/sql/*') and an RPC backend (`src/engine/rpc/*').
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Register (`src/register') implements a ledger-like GUI that allows the user to dynamically enter dates, prices, memos descriptions, etc. in an intuitive fashion that should be obvious to anyone who's used a checkbook register. The code is highly configurable, allowing the ledger columns and rows to be laid out in any way, with no restrictions on the function, type, and number of columns/rows. For example, one can define a ledger with three date fields, one price field, and four memo fields in a straightforward fashion. Cell handling objects support and automatically validate date entry, memo entry (w/auto-completion), prices, combo-boxes (pull-down menus), and multi-state check-boxes. Cells can be marked read-write, or output-only. Cells can be assigned unique colors. The currently active ledger row-block can be highlighted with a unique color.
The register code is completely independent of the engine code, knows nothing about accounting or any of the other GnuCash subsystems. It can be used in independent projects that have nothing to do with accounting.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Reports module (`src/scm/report.scm', `src/scm/reports') is a scheme (guile) based system to create balance sheets, profit & loss statements, etc. by using the engine API to fetch and display data formatted in HTML.
For the most part, this module uses the Query API to fetch the engine information instead of using the raw engine interface. This design uses Queries to extract the data and assemble it into a view-independent format. This data is then be converted to HTML reports and/or graphs such as bar and pie charts.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Graphs module implements GUI graphs such as bar and pie charts. These graphs can be interactive in that the user can, for example, move pie wedges, and 'live' in that the user can click on graph subsections to see a detail graph or report of that particular subsection.
This module is implemented using the GUPPI library being developed by Jon Trowbridge (http://www.gnome.org/guppi).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Price Quotes module (`src/quotes') is a Perl system to fetch stock price data off the Internet and insert it into the GnuCash Engine. This module requires the functionality of the Finance::Quote module available at SourceForge. The Finance::Quote module can fetch price quotes from many different sources including Yahoo, Yahoo Europe, and some international exchanges.
The Finance::Quote module also supports fetching currency exchange rates. GnuCash will be extended to allow the fetching and use of currency exchange rates.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The User Preferences module (`src/scm/options.scm', `src/scm/prefs.scm') provides an infrastructure for defining both user-configurable and internal preferences. Preferences are defined in scheme using several predefined preference types such as boolean, string, date, etc. Preferences are 'implemented' by providing a GUI which allows the user to see and change preference values. An API is provided to query preference values and to register callbacks which will be invoked when preferences change.
Preference values which are different from the default values are stored as scheme forms in a user-specific preferences file (`~/.gnucash/config.auto'). This file is automatically loaded upon startup.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The QIF Import module (`src/scm/qif-import') provides functionality for importing QIF (Quicken Interchange Format) data into GnuCash.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GnuCash module (`src/gnome', `src/register/gnome' and `src/*.[ch]') is the main GUI application. It consists of a collection of miscellaneous GUI code to glue together all of the pieces above into a coherent, point-and-click whole. It is meant to be easy to use and intuitive to the novice user without sacrificing the power and flexibility that a professional might expect. When people say that GnuCash is trying to be a "Quicken or MS Money look/work/act-alike", this is the piece that they are referring to. It really is meant to be a personal-finance manager with enough power for the power user and the ease of use for the beginner.
Currently, the Gnome interface is the only operational interface. There is an obsolete Motif interface which is not maintained and which is removed in current CVS. There is also old Qt code (removed in current CVS) which won't compile, and most/all functions are missing.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Engine provides an interface to a financial engine with three basic financial entities: Accounts, Transactions (known as Journal Entries in accounting practice), and Splits (known as Ledger Entries). These three entities are the central data structures of the GnuCash financial data model.
In addition, the Engine provides the abstraction of Account Groups (collections of related accounts) and GNCBooks. A GNCBook abstracts both a set of related GnuCash data (financial entities plus additional information such as budgets, per-file preferences, etc.) plus a file-editing session allowing transparent support for locking and implementation with other backends such as SQL.
The Engine code contains no GUI code whatsoever and is designed to be created as a shared library for use by other programs.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Splits (see section 2.11 Splits), or "Ledger Entries" are the fundamental accounting units. Each Split consists of a quantity (number of dollar bills, number of shares, etc.), the value of that quantity expressed in a (possibly) different currency than the quantity, a Memo, a pointer to the parent Transaction, a pointer to the debited Account, a reconciled flag and timestamp, an "Action" field, and a key-value frame which can store arbitrary data (see section 2.5 Key-Value Pair Frames).
Transactions (see section 2.12 Transactions) embody the notion of "double entry" accounting. A Transaction consists of a date, a description, a number, a list of one or more Splits, and a key-value frame. When double-entry rules are enforced, the total value of the splits is zero. Note that if there is just one split, its value must be zero for double-entry accounting; this used to be used for storing prices, but with the advent of the Price DB, this is no longer the case. If there are two splits, then the value of one must be positive, the other negative: this denotes that one account is debited, and another is credited by an equal amount. Positive Split values are 'debits' and negative Split values are 'credits'. Ensuring the Splits to 'add up' to zero causes a double-entry accounting system to always balance.
The engine does not enforce double-entry accounting, but provides an API to enable user-code to find unbalanced transactions and 'repair' them so that they are in balance. See section 2.16 Scrub.
Note the sum of the values of Splits in a Transaction is always computed with respect to a currency; thus splits can be balanced even when they are in different currencies, as long as they share a common currency. This feature allows currency-trading accounts to be established.
Every Split must point to its parent Transaction, and that Transaction must in turn include that Split in the Transaction's list of Splits. A Split can belong to at most one Transaction. These relationships are enforced by the engine. The engine user cannnot accidentally destroy this relationship as long as they stick to using the API and never access internal structures directly.
Splits are grouped into Accounts (see section 2.13 Accounts) which are also known as "Ledgers" in accounting practice. Each Account consists of a list of Splits that debit that Account. To ensure consistency, if a Split points to an Account, then the Account must point to the Split, and vice-versa. A Split can belong to at most one Account. Besides merely containing a list of Splits, the Account structure also give the Account a name, a code number, description and notes fields, a key-value frame, a pointer to the currency that is used for all splits in this account, and a pointer to the "security" used for all splits in this account. The "security" can be the name of a stock (e.g. "IBM", "McDonald's"), or another currency (e.g. "USD", "GBP"). The security is used during Transaction balancing to enable trading between accounts denominated in different currencies, or to, for example, move stocks from one Account to another.
Accounts can be arranged in a hierarchical tree. The nodes of the tree are called "Account Groups" (see section 2.14 Account Groups). By accounting convention, the value of an Account is equal to the value of all of its Splits plus the value of all of its sub-Accounts.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Engine API calls are named using a specific convention. For example,
the function to access the Memo field of a Split is
xaccSplitGetMemo. The prefix xacc comes
first(1), followed by the name of
the entity for which the API call applies (Split), followed by
the action performed by the call (Get), followed by the name of
the field being accessed (Memo). Future API calls should conform
to this naming convention.
The formal arguments to Engine API calls always begin with the entity to
which the call applies. Thus, the arguments to xaccSplitSetMemo
are the Split pointer followed by the pointer to a memo
string. Future API calls should also conform to this convention.
Engine API calls should be implemented to behave as gracefully as
possible with unexpected input. Specifically, public API calls should
gracefully handle NULL pointer arguments. User code should be
able to handle NULL return values from Engine calls as well.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is common for Engine structures to reference other Engine structures. For example, an Account must reference its Splits, its parent Account Group, and its child Account Group. Furthermore, other GnuCash modules may need to reference Engine structures. For example, a GUI implementation may wish to save a list of Accounts which the user has open when the application exits in order to restore that same state upon the next invocation.
One way to uniquely identify an Engine structure, at least while the program is running, is using the C pointer which points to the structure. C pointers have the advantage of speed, but also have some disadvantages:
The GUID (Globally Unique Identifier) provides a way to reference Engine structures that is more flexible than C pointers. Each Engine structure has an associated GUID which can be used to reference that structure. Engine GUIDs have the following features:
| 2.3.1 When to use GUIDs | ||
| 2.3.2 GUID Types | ||
| 2.3.3 How to use GUIDs | ||
| 2.3.4 GUIDs and GnuCash Entities | ||
| 2.3.5 The GUID Generator |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Although GUIDs are very flexible, the engine structures like Accounts will probably continue to use C pointers for the forseeable future, since they are much faster (and in certain respects more convenient) than using GUIDs. In general, however, it is much safer to use GUIDs. In particular, you should consider using GUIDs if any of the following is true:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GUIDs in GnuCash are typed using the enum GNCIdType.
Possible values and their meanings for GUID types are:
GNC_ID_NONE
GNC_ID_NULL
GNC_ID_ACCOUNT
GNC_ID_TRANS
GNC_ID_SPLIT
GNC_ID_NULL.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Engine API functions which access the GUID for a specific entity return a pointer to the GUID. Note: Do not store the pointer itself! Instead, store a copy of the GUID. Storing the pointer itself would present some of the same problems as using the account pointer directly. Example:
{
GUID saved_guid;
Account *account;
account = < something to get an Account pointer >
saved_guid = *xaccAccountGetGUID(account);
...
account = xaccAccountLookup(&saved_guid);
...
}
|
You can compare two GUIDs with the following functions.
memcmp of the two GUID's.
You can encode and decode GUIDs and their string representations using the next two functions.
0
through 9 and a through f. The encoding will
always be GUID_ENCODING_LENGTH characters long. The returned
string should be freed when no longer needed.
guid_to_string, except that the
string is written into the memory pointed at by buff. The
buffer must be at least GUID_ENCODING_LENGTH+1 characters long.
This routine is handy for avoiding a malloc/free cycle.
It returns a pointer to the end of what was written.
(i.e. it can be used like stpcpy during string concatenation)
You can allocate and deallocate space for GUIDs using standard memory routines. However, if your code is allocating and deallocating lots of GUID objects, then the next two functions should be used.
xaccGUIDFree. In general, this function is
faster than using the standard libc allocators.
xaccGUIDMalloc.
You can use the following two functions to aid in using GUIDS in hash tables.
GHashTable.
ptr must point to a GUID.
GHashTable which uses GUIDs as keys.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section documents a low-level API for associating entities with GUIDs. User code and general engine code should not use this API; instead use the API documented in the sections for the specific GnuCash entities such as Accounts and Transactions.
guid_new!
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GUIDs are created by the GUID generator. The API for this generator is low-level and should not be used by user-code.
xaccGUIDNew.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Financial quantities in GnuCash (Split quantities and values) are stored
as exact quantities measured in the smallest denominational unit of the
appropriate currency. For example, 100.50 US Dollars would be stored as
(10050 / 100) US Dollars. GnuCash uses the gnc_numeric datatype
to store financial quantities.
The gnc_numeric API provides data types and functions for
manipulating exact numeric quantities. While the gnc_numeric
library was developed to represent and operate on exact financial
quantities in GnuCash, the library is also (hopefully) suitable for use
in any application where exact numeric representation for rational
numbers is needed.
A gnc_numeric value represents a number in rational form, with a
64-bit long long integer as numerator and denominator. If more
precision, a higher-precision representation of irrational numbers, or a
wider dynamic range is needed, a floating point format may be
appropriate. There are reasonable rational approximations to common
irrational constants (see section 2.4.9 Numeric Example), but the transcendental
functions have not been implemented for gnc_numeric objects.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is useful to specify a denominator in cases where it is known that the output value is of constrained precision. For example, monetary transactions must be executed in an integer number of the "smallest currency unit" of the transaction. In US Dollars, the smallest currency unit is the cent, and all monetary transactions must be done in units of cents. Therefore, any fractional cents in a computed price must be rounded away.
Most of the gnc_numeric arithmetic functions take two arguments
in addition to their numeric args: denom, which is the denominator
to use in the output gnc_numeric object, and how, which
describes how the arithmetic result is to be converted to that
denominator. This combination of output denominator and rounding policy
allows the results of financial and other exact computations to be
properly rounded to the appropriate units.
Valid values for denom are:
n (positive int)
n as the denominator of the output value.
GNC_DENOM_RECIPROCAL (n)
1/n as the denominator of the output value.
GNC_DENOM_SIGFIGS (n)
n
significant figures in the result.
GNC_DENOM_AUTO
Valid values for how are bitwise combinations of zero or one "rounding instructions" with zero or one "denominator types".
Rounding instructions control how fractional parts in the specified denominator affect the result. For example, if a computed result is "3/4" but the specified denominator for the return value is 2, should the return value be "1/2" or "2/2"?
Possible rounding instructions are:
GNC_RND_FLOOR
GNC_RND_CEIL
GNC_RND_TRUNC
GNC_RND_PROMOTE
GNC_RND_ROUND
GNC_RND_ROUND_HALF_UP
GNC_RND_ROUND_HALF_DOWN
GNC_RND_NEVER
The denominator type specifies how to compute a denominator if
GNC_DENOM_AUTO is specified as the denom. Valid denominator
types are:
GNC_DENOM_EXACT
GNC_DENOM_REDUCE
GNC_DENOM_LCD
GNC_DENOM_FIXED
GNC_DENOM_SIGFIG
To use traditional rational-number operational semantics (all results
are exact and are reduced to relatively-prime fractions) pass the
argument GNC_DENOM_AUTO as denom and GNC_DENOM_REDUCE
| GNC_RND_NEVER as how.
To enforce strict financial semantics (such that all operands must have
the same denominator as each other and as the result), use
GNC_DENOM_AUTO as denom and GNC_DENOM_FIXED |
GNC_RND_NEVER as how.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_numeric object with a value of "num / denom".
gnc_numeric object with a value of 0.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
See 2.4.1 Standard Numeric Arguments for a description of the denom and how arguments to each arithmetic function.
gnc_numeric_add on a and b with
GNC_DENOM_AUTO for denom and GNC_DENOM_FIXED |
GNC_RND_NEVER for how.
gnc_numeric_sub on a and b with
GNC_DENOM_AUTO for denom and GNC_DENOM_FIXED |
GNC_RND_NEVER for how.
gnc_numeric_add, but uses error for accumulating
conversion roundoff error.
gnc_numeric_sub, but uses error for accumulating
conversion roundoff error.
gnc_numeric_mul, but uses error for accumulating
conversion roundoff error.
gnc_numeric_div, but uses error for accumulating
conversion roundoff error.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a == 0, otherwise returns 0.
a > 0, otherwise returns 0.
a < 0, otherwise returns 0.
a > b, -1 if b > a, 0 if a == b.
numerator(a) == numerator(b) and
denominator(a) == denominator(b), otherwise returns 0.
For example, if |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_numeric_convert, but return a remainder value for
accumulating conversion error.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_numeric. Both denom
and how are used as in arithmetic, but GNC_DENOM_AUTO is
not recognized.
double value.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
g_free.
gnc_numeric from str, skipping any leading
whitespace, and returning a pointer to just past the last byte
read. Return NULL on error.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNC_ERROR_OK
GNC_ERROR_ARG
GNC_ERROR_OVERFLOW
GNC_ERROR_DENOM_DIFF
GNC_DENOM_FIXED was specified, but argument denominators differed.
GNC_ERROR_REMAINDER
GNC_RND_NEVER was specified, but the result could not be
converted to the desired denominator without a remainder.
gnc_numeric object that signals the error condition
noted by error_code rather than a number.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following program finds the best gnc_numeric approximation to
the `math.h' constant M_PI given a maximum denominator. For
large denominators, the gnc_numeric approximation is accurate to
more decimal places than will generally be needed, but in some cases
this may not be good enough. For example,
M_PI = 3.14159265358979323846
245850922 / 78256779 = 3.14159265358979311599 (16 sig figs)
3126535 / 995207 = 3.14159265358865047446 (12 sig figs)
355 / 113 = 3.14159292035398252096 (7 sig figs)
|
#include <glib.h>
#include "gnc-numeric.h"
#include <math.h>
int
main(int argc, char ** argv)
{
gnc_numeric approx, best;
double err, best_err=1.0;
double m_pi = M_PI;
gint64 denom;
gint64 max;
sscanf(argv[1], "%Ld", &max);
for (denom = 1; denom < max; denom++)
{
approx = double_to_gnc_numeric (m_pi, denom, GNC_RND_ROUND);
err = m_pi - gnc_numeric_to_double (approx);
if (fabs (err) < fabs (best_err))
{
best = approx;
best_err = err;
printf ("%Ld / %Ld = %.30f\n", gnc_numeric_num (best),
gnc_numeric_denom (best), gnc_numeric_to_double (best));
}
}
}
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The number and types of data items which are associated with the financial abstractions (Accounts, Transactions, and Splits) can vary widely. For example, an Account which represents a user's checking account might need to store the bank name, a telephone number, and a username for online banking purposes. Another Account representing the user's ownership of a stock might need to store information about retrieving price quotes online such as the ticker symbol and the exchange.
To meet this need for varying data storage, the GnuCash accounting
entities use Key-Value Pair Frames (hereafter referred to as the
datatype kvp_frame). A kvp_frame is a set of associations
between character strings (keys) and kvp_value structures. A
kvp_value is a union with possible types enumerated in the
kvp_value_t enum which indicates the type of data stored in a
kvp_value object.
| 2.5.1 Key-Value Policy | ||
| 2.5.2 kvp_frame | ||
| 2.5.3 kvp_value | ||
| 2.5.4 kvp_list |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section defines the policy that programmers should follow when using key-value pairs to store information. Because of the large amount of information which can potentially be stored using this mechanism, it is important to follow these guidelines so that order will be maintained.
The following rules should be followed for using key-value pairs:
bank-info. Because the '/' character is useful for
describing keys in sub-frames (bank-info/routing-number), do not
use the '/' character in key names.
online-banking-info is better than onln-bnk.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A kvp_frame is the datatype used to associate key strings with
kvp_value objects (see section 2.5.3 kvp_value).
kvp_frame object and return
a pointer to it.
kvp_frame_set_slot, except that value is used
directly, instead of being copied. This call transfers 'ownership'
of value to frame.
kvp_value object associated with key
in frame or return NULL if there is no association
for key. The value returned is not a copy.
kvp_frame_set_slot_path, except that the key path is
specified using a GSList. All the keys in the list should be non-NULL.
NULL if none.
The path is specified as in kvp_frame_set_slot_path.
NULL if none.
The path is specified as in kvp_frame_set_slot_path_gslist.
kvp_frame_get_slot_path, but returns the last frame
in the path. All the keys should refer to frames. If the frame path
does not exist, it is created.
kvp_frame_get_slot_path_gslist, but returns the last
frame in the path. All the keys should refer to frames. If the frame
path does not exist, it is created.
kvp_frame_get_frame, but the frame path is specified
as a single string where the keys are separated by slashes; thus, for
example: /this/is/a/valid/path and ///so//is////this/.
Multiple slashes are compresed and a leading slash is optional. The
pointers . and .. are not followed/obeyed. (This
is arguably a bug that needs fixing).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The kvp_value object stores the 'value' part of a key-value
association in a kvp_frame object.
A kvp_value_t enum must have one of the following values:
KVP_TYPE_NONE
kvp_frame.
KVP_TYPE_INT64
gint64 value.
KVP_TYPE_FLOAT64
double value.
KVP_TYPE_STRING
char * value of arbitrary length.
KVP_TYPE_GUID
GUID value. See section 2.3 Globally Unique Identifiers.
KVP_TYPE_BINARY
KVP_TYPE_LIST
kvp_list item which contains a list of kvp_value items.
KVP_TYPE_FRAME
kvp_frame object. Thus, frames may contain other frames in a
recursive manner.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following functions create and return kvp_value objects with
particular values. In the case of pointer arguments, deep copies are
performed.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following functions access the value of a given kvp_value
object. If the type of the object does not correspond to that named
in the function, NULL, 0, or 0.0 is returned
as appropriate.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A kvp_list object abstract a list of kvp_value objects.
kvp_list object.
kvp_value objects in list.
TRUE if list is the empty list.
NULL or the empty list, return NULL.
Otherwise, return the first kvp_value object in the list.
NULL or the empty list, return NULL.
Otherwise, return a kvp_list object consisting of list
with the first value removed. NOTE: the returned list is not a copy!
NULL, return NULL. Otherwise,
return a kvp_list object consisting of the value of car followed
by the values of cdr. This function uses 'hand-over' semantics, i.e.,
the arguments car and cdr are no longer the responsibility of
the caller and should not be accessed after the function returns.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Engine supports the concept of Events which notify external code when engine entities are created, modified, or destroyed.
User code can register event handers which are invoked for each event, giving information about the specific engine entity generating the event and the nature of the event (creation, modification, or deletion).
| 2.6.1 Event API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Engine events are classified using the GNCEngineEventType
bitmask which has the following predefined values:
GNC_EVENT_NONE
GNC_EVENT_CREATE
GNC_EVENT_MODIFY
GNC_EVENT_DESTROY
GNC_EVENT_ALL
GNC_EVENT_CREATE, GNC_EVENT_MODIFY,
and GNC_EVENT_DESTROY.
Event handlers are functions with the following type:
GUID of the entity generating the event. event_type is
one of GNC_EVENT_CREATE, GNC_EVENT_MODIFY, or
GNC_EVENT_DESTROY. user_data is the user data parameter
supplied when the handler was registered.
gnc_engine_resume_events must be made.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Commodity is the Engine abstraction of a tradable quantity, like a national currency or shares of a stock. A commodity object contains the following pieces of information:
| 2.7.1 General Commodity API | ||
| 2.7.2 Commodity Getters | ||
| 2.7.3 Commodity Setters |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NULL if any of the values are invalid.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Commodity Table holds a set of commodities and allows user code to add, remove, and access the commodities in the table.
There is a single, global Commodity Table used by the Engine.
| 2.8.1 General Commodity Table API | ||
| 2.8.2 Commodity Table Access API | ||
| 2.8.3 Commodity Table Modification API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_commodity_table. The returned
table must be destroyed with gnc_commodity_table_destroy.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NULL is returned.
NULL is returned.
g_list_free but the namespaces should not be freed
or modified.
g_list_free but the commodities
should not be freed.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Price is the Engine abstraction of an "instantaneous" price quote for a given commodity with respect to another commodity. For example, a given price might represent the value of LNUX in USD on 2001-02-03. A Price contains the following pieces of information:
| 2.9.1 Price Implementation Details | ||
| 2.9.2 General Price API | ||
| 2.9.3 Price Getters | ||
| 2.9.4 Price Setters |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For the source and type fields, NULL and the empty string are
considered the same, so if one of these is the empty string then it
might be NULL after a file save/restore.
GNCPrices are reference counted. When you create a price or or clone
one, the new price's reference count is set to 1. When you are finished
with a price, call gnc_price_unref. If you hand the price pointer
to some other code that needs to keep it, make sure it calls
gnc_price_ref to indicate its interest in that price, and calls
gnc_price_unref when it's finished with the price. For those
unfamiliar with reference counting, basically each price stores an
integer count which starts at 1 and is incremented every time someone
calls gnc_price_ref. Conversely, the count is decremented every
time someone calls gnc_price_unref. If the count ever reaches 0,
the price is destroyed.
All of the getters return data that's internal to the GNCPrice, not copies, so don't free or modify these values.
All of the setters store copies of the data given, with the exception of the commodity field which just stores the pointer given. It is assumed that commodities are a global resource and are pointer unique.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_price_unref when no
longer needed, but the price should not be freed by user code.
NULL
if there is no such price.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Invocations of the setters should be wrapped with calls to
gnc_price_begin_edit and gnc_price_commit_edit. The
begin/commit calls help ensure that the local price db is synchronized
with the backend.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Price Database stores GNCPrices and allows prices to be looked up based on currency, commodity, and time.
| 2.10.1 Price Lists | ||
| 2.10.2 General Price Database API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Price Lists are used by Price Databases to organize prices for a given commodity and currency. A Price List is a list of prices with the same commodity and currency, sorted by decreasing time (earlier prices come later in the list).
gnc_price_unref on p during the process.
gnc_price_unref
on all the prices in the list.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gnc_price_unref)
if the call succeeds (returns true).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Split is the Engine abstraction of an accounting entry in an Account Ledger. In accounting terms, a Split is a Ledger Entry. As such, it contains the following pieces of information:
In addition to the above, Splits contain a Memo field, an Action field, and a key-value pair frame. The Memo and Action fields are for arbitrary user input. See src/engine/kvp_frame.txt for the names of keys that have already been reserved for use in the frame.
| 2.11.1 General Split API | ||
| 2.11.2 Split Getters | ||
| 2.11.3 Split Setters |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If the deletion of the Split leaves the Transaction with no Splits, then
the Transaction will be marked for deletion, but will not be deleted
until the xaccTransCommitEdit() routine is called.
NULL if there is
no such split.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NREC
CREC
YREC
FREC
split)
split)
split)
split)
normal
stock-split
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccSplitSetShareAmount and
xaccSplitSetSharePrice in succesion.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Transaction is the Engine abstraction of an accounting entry in a Journal. In accounting terms, a Transaction is a Journal Entry. As such, it contains the following pieces of information:
In addition to the above, Transactions contain a key-value pair frame.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Engine supports (and, in fact, requires) a 2-phase commit/rollback
cycle for modifying Transactions and their constituent Splits. A Transaction
must be opened for editing using xaccTransBeginEdit() before any of
the following actions may be taken.
After the desired changes have been made, they must either be committed
using xaccTransCommitEdit() or rolled back using
xaccTransRollbackEdit(). Rolling back a transaction will undo any
changes which have been made to it or to its Splits since it was opened
for editing.
| 2.12.2 General Transaction API | ||
| 2.12.3 Transaction Getters | ||
| 2.12.4 Transaction Setters |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccTransCommitEdit() in which case the transaction memory will
be freed, or by xaccTransRollbackEdit(), in which case all the
original Splits are put back into place.
xaccTransDestroy() was called on the Transaction.
xaccTransBeginEdit()
call. This includes restoring any deleted Splits, removing any added
Splits, and undoing the effects of xaccTransDestroy(), as well
as restoring share quantities, memos, descriptions, etc.
TRUE if trans is open for editing. Otherwise, it
returns FALSE.
NULL if
there is no such Transaction.
kvp_value associated with key in trans.
If there is none, NULL is returned.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GList of the Splits in trans. This list is owned
by trans and should not be modified in any way!
time_t value.
long long value.
free() after
use.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Remember, before you modify a Transaction, you must open it for editing
with xaccTransBeginEdit.
time_t value.
time_t value.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An Account is the Engine abstraction of an, well, an account. Accounts contain the following pieces of information:
In addition to the above, Accounts contain a key-value pair frame.
| 2.13.1 Account Types | ||
| 2.13.2 General Account API | ||
| 2.13.3 Account Type API | ||
| 2.13.4 Account Getters | ||
| 2.13.5 Account Tax API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Account Types are defined by the GNCAccountType enumeration.
Possible values are:
BAD_TYPE, NO_TYPE
BANK
CASH
CREDIT
ASSET
LIABILITY
STOCK
MUTUAL
CURRENCY
INCOME
EXPENSE
EQUITY = 10,
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccAccountBeginEdit followed
by xaccAccountDestroy.
xaccAccountBeginEdit before calling
this function.
xaccAccountCommitEdit,
provide a two-phase-commit wrapper for account updates
much in the same way as xaccTransBeginEdit and
xaccTransCommitEdit do for Transactions.
xaccMallocAccount.
kvp_frame associated with account. User code
may modify this kvp_frame, but must not destroy it.
kvp_frame associated wih account. After the call,
frame is owned by account, so don't destroy it.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccAccountTypeEnumAsString
to a type, return in type. Returns true if the string corresponds
to an actual type.
xaccAccountStringToEnum, but returns the type. If
str does not correspond to any valid type, BAD_TYPE is
returned.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NULL.
NULL,
indicating account has no children.
NULL,
indicating account is a top-level Account. However, even if the
parent is not NULL, the account may still be top-level if the
parent Group has no parent Account.
xaccAccountGetParent, but returns the parent Account
of the parent Group if the parent Group exists. Otherwise, returns
NULL.
GList of the Splits in account. This list must
not be modified in any way.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This set of API calls is related to tax information. All accounts have a tax-related boolean flag that can be set or unset. There is an additional set of API calls related to United States taxes that have `US' in the function call names. Future API calls that are specific to other countries should include the appropriate 2-letter country code in the function names.
NULL if there is none. These codes are internal to GnuCash
and currently defined in `src/scm/report/txf-export.scm'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Account Groups are used by the Engine to connect Accounts together into an Account hierarchy. Account Groups do not correspond to any accounting concept -- they are specific to the GnuCash engine. Account Groups contain the following pieces of information:
Account Groups do not have key-value frames or GUIDs.
| 2.14.1 General Account Group API | ||
| 2.14.2 Account Group Account API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccFreeAccountGroup.
xaccAccountCommitEdit on all child accounts
and their children.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
xaccGroupInsertAccount, but uses a parent Account instead
of a parent group. If parent does not have a child Group, one
will be created.
NULL is returned.
g_list_free when no longer
needed.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GNCBook interface encapsulates all the information about a GnuCash dataset, including the methods used to read and write the dataset to datastores. This class provides several important services:
The current implementation assumes the use of files and file locks; however, the API was designed to be general enough to allow the use of generic URL's, and/or implementation on top of SQL or other database/persistant object technology.
| 2.15.1 GNCBook API |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The 'ignore_lock' argument, if set to TRUE, will cause this routine to ignore any file locks that it finds. If set to FALSE, then file locks will be tested and obeyed.
If the file exists, can be opened and read, and a lock can be obtained then a lock will be obtained and the function returns TRUE.
If the file/database doesn't exist, and the create_if_nonexistent flag is set to TRUE, then the database is created.
Otherwise the function returns FALSE.
Some important error values:
EINVAL
ETXTBSY
ENOSYS
ERANGE
ENOLCK
gnc_book_save() was called.
gnc_book_get_error, but the error value is reset
in book.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Component Manager (hereafter referred to as the CM) is a framework for managing GUI objects in GnuCash. The CM provides several services.
First, components may request automatic invocation of a 'refresh' handler that is called when a component may need to be redrawn. This mechanism is tied into the Engine's Event mechanism (see section 2.6 Events), so that GUI components are notified when relevant Engine entities are created, modified, or destroyed.
Components may also provide a 'close' handler so that the component may be closed through the CM API.
The CM also provides the ability to search for existing components.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GnuCash GUI must manage many different components (registers, reconcile windows, reports, graphs, main window, etc.). Functions which need to be performed on or with GUI components include:
In particular, keeping components updated in the face of changes in the Engine is a difficult problem. Requirements for handling refreshes include:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The major design decisions of the CM relate to the refresh mechanism. The refresh mechanism consists of two parts, the Engine component and the GUI component. The Engine component is the Event mechanism (see section 2.6 Events), while the GUI component is the Component Manager, which provide refresh functionality as well as other services.
The diagram below illustrated the design of the GnuCash refresh mechanism.
----------
| |
| Engine |
| |
----------
/|\
|
|--- Events (from Engine)
|
\|/
-------------------------
| |
| Component Manager |
| |
-------------------------
/ /|\ \ GUI Commands
/ | \--- including refresh
/ \|/ \ invocations (from CM)
----------------- -----------------
| | | |
| GUI Component | | GUI Component | ...
| | | |
----------------- -----------------
|
The top-level component is the Engine, which emits Events to the Component Manager. In fact, the Engine will send events to any registered handler, but in GnuCash, only the CM registers with the engine. All other GUI components register with the CM.
The CM invokes the refresh handlers of GUI components based on the Engine events received the CM has received as well as information provided by the GUI components (such as which specific Engine entities the components are 'watching').
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When a component registers itself with the CM, it may specify two different handlers: a refresh handler and a close handler. A refresh handler is a function with the following type signature:
NULL, meaning the component must perform a refresh.
The user_data pointer is the data pointer supplied when the
component was registered.
When a refresh handler is invoked, it should perform the following actions:
Components must test for the destruction of critical Engine objects in two ways.
GUID lookup functions (such as
xaccAccountLookup), to determine if the engine object is still
bound to its GUID. Of course, this means that components should
store the GUIDs of critical Engine objects instead of simply
storing their C pointers.
GUIDs to EventInfo structures. An EventInfo
structure has a single member, event_mask, of type
GNCEngineEventType. The event_mask is a logical or of the
GNC_EVENT_CREATE, GNC_EVENT_MODIFY, and
GNC_EVENT_DESTROY event types. Since refreshes may not occur with
every Engine event, event_mask may have all three values.
There is a utility function for accessing the changes hash:
NULL is returned.
If the changes hash is NULL, then the first test is sufficient to determine whether an object has been destroyed.
If the refresh handler determines the component should be destroyed, it should destroy the component and return.
NULL, then the component must refresh itself. Otherwise,
it may use the changes hash to determine whether or not a refresh
is actually necessary. However, since the component may specify which
particular Engine objects are relevant (see "Watching Components"
below), generally a component will simply refresh unconditionally.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A close handler is a function with the following type signature:
user_data
pointer is the data pointer supplied when the component was registered.
The invocation of a close handler is a command to the component to close itself. The component must close itself -- the handler should not be ignored. The component is still responsible for unregistering itself with the Component Manager.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The variable component_class is a string specifying a class of components. Certain CM functions can be performed on all components in a class. For that reason, components in the same class should all use the same type for user_data.
refresh_handler and close_handler specify the refresh and close
handlers, respectively. Either or both may be NULL.
The user_data is supplied as an argument when the handlers are invoked.
The function returns the id of the newly-registered component, or
NO_COMPONENT if there was an error.
After a refresh handler is registered, the component must use the API calls under "Watching Engine Objects" below to inform the Component Manager which engine entities are being watched, i.e., which engine entities may cause the component to need refreshing. When a component is first registered, it is not watching anything, and thus will not receive refresh events.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NULL value for changes.
This routine may only be invoked when the suspend counter is zero. It should never be mixed with the suspend/resume refresh routines.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Component Manager API provides two functions that allow components to be searched for. Each function uses a find handler to perform the actual search work. A find handler is a function with the following signature:
GList of the user data pointers of matching components.
gnc_find_gui_components above, but return the user data pointer
of the first matching component, or NULL if there are no matching
components.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Component Manager API provides a function for iterating over all components in a class as well as all registered components regardless of class.
In either case, a generic component handler is invoked for each component. The handler has the following signature:
NULL, then iteration is performed over
every registered component. iter_data is supplied to handler
as the third argument.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The register is an infrastructure for building a modular matrix of cells in which each cell may be specialized to perform a particular function, e.g., to read dates, numerical amounts, or text. The register has been designed to be easy to extend, modular, easy to maintain, and memory efficient. It is intended to be used for building financial apps and spread-sheets.
The register object should not have any 'knowledge' of the accounting model of GnuCash or of the workings of the main application. The register should not be specific to a particular GUI (such as Gnome/GTK). It should be possible to use the register in a stand-alone fashion.
The register is built from several types of components: Cells, Cellblocks, Cursors, the Table, and the Split Register.
| 4.1 Cells | ||
| 4.2 Cellblocks | ||
| 4.3 Table | ||
| 4.4 Split Register |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Cell is an active object which is designed to read a specific kind of user input. A Cell object has callbacks that are called when the user enters the cell (e.g. by mouse-clicking on a cell in a table, or tabbing into it), when the user attempts to modify text in the cell (e.g. by typing in it), and when the user leaves the cell (e.g. by mouse-clicking elsewhere, or tabbing away).
Special-purpose cells can be created by "inheriting" from the basic cell object. Thus, there are special-purpose cells for handling dates, pull-down menus, text fields with auto-completion from a list of alternatives, monetary amounts, etc.
Cells implementations may or may not contain GUI code. Cells which require only that text be displayed are completely "GUI-independent", that is, they depend on the underlying table to display the text. Cells which require additional GUI elements (such as pull-down menus) must implement the proper GUI handling on their own (using, e.g., GTK).
| 4.1.1 BasicCell |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The BasicCell interface defines the core functionality that all cells must implement. A BasicCell contains the following data members.
char *value
GdkWChar *w_value
gint value_len
guint32 changed
guint32 conditionally_changed
char * blank_help
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Cellblock is an array of active cells. The cells are laid out in rows and columns. The cellblock serves as a convenient container for organizing active cells in an array. Through the mechanism of Cursors (defined below), it allows a group of cells to be treated as a single transactional entity. That is, the cursor/cellblock allows all edits to a groups of cells to be simultaneously committed or rejected by underlying engines. This makes it appropriate for use as a GUI for transaction-processing applications with two-phase commit requirements.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Table is a displayed matrix. The table is a complex object; it is not merely a cellblock. The table provides all of the GUI infrastructure for displaying a row-column matrix of strings.
The table provides one very important function for minimizing memory usage for large matrixes -- the notion of a Cursor. The cursor is a cellblock (an array of active cells) that is moved to the location that the user is currently editing. The cursor "virtualizes" cell functions; that is, it makes it seem to the user as if all cells in the table are active, when in fact the only cell that actually needs to be active is the one that the user is currently editing.
The table design allows multiple cursors to be defined. When a user enters a cell, the appropriate cursor is positioned within the table. Cursors cannot overlap: any given cell can be mapped to at most one cursor. Multiple-cursor support allows tables to be designed that have a non-uniform layout. For example, the multiple-cursor support can be used to define a tree structure of headings and sub-headings, where the layout/format of the heading is different from the sub-headings. A financial example is a table which lists splits underneath their parent transaction. This is very different from a checkbook register, where all entries are uniform, and can be handled with a single repeated cursor.
Users of the table must provide a TableView object which provides an API the table uses to obtain information about the data it is displaying such as strings, colors, etc. Thus, the table represents the non-GUI portion of the View object in the Model-View-Controller paradigm.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The split register is a special-purpose object aimed at the display of financial transactions. It includes cells for the date, prices, balances, transfer accounts, etc. The register is where the cells, cursor and table get put together into a unified whole. The register defines specific, actual layouts and widths of the date, price, etc. cells in a table. It includes a table header, and defines more than ten specific layouts: bank, credit-card, stock, general ledger, etc.
The split register implementation is divided into two components. The first component (src/register/splitreg.[ch]) defines the basic structure and implementation of a split register, but does not specifically use or depend on the other GnuCash modules, including the Engine. Of course, this implementation was created with the engine financial structures in mind.
The second component (src/SplitLedger.[ch]) implements the full register behavior (the Controller in MVC) and makes full use of the Engine API. This component is responsible for loading transactions and splits into the register, modifying transactions and splits according to user input, and accomplishing tasks such as performing automatic completion.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The reporting infrastructure is designed facilitate the creation of sophisticated reports including tables, graphs, and hyperlinks. The infrastructure includes functionality to support the following:
| 5.1 Creating a Report |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To define a report, your report must have
(gnc:support <your_report_name>)
and should have
(gnc:depend "report-utilities.scm")
as well as
(gnc:depend "report-html.scm")
if you wish to use the html generation facilities. You should
avoid creating HTML directly wherever possible.
To autoload your report, you should add the line (gnc:depend
<your_report_name>) to the file `src/scm/report/report-list.scm'.
(gnc:depend "date-utilities.scm")
has lots of date-manipulation functions you'll almost certainly need.
To define a report, you call (gnc:define-report). This function
can accept a variable number of arguments, but at the moment four
distinct arguments are recognised, as in the following from
the transaction report:
(gnc:define-report 'version 1 'name (N_ "Transaction Report") 'options-generator trep-options-generator 'renderer trep-renderer) |
version
name
(N_ ).
options-generator
renderer
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The options system is used to obtain user preferences, both globally, and when displaying a report. A wide variety of option types are supported, so it should be possible to create an option for just about any property the user might wish to specify. New option types can be added if necessary, but as the process requires detailed knowledge of GnuCash internals and GTK+/GNOME, it is not documented here.
At present, users are most likely to come across the options system when designing custom reports, and are consequently mostly going to use the Scheme interface. There is also a C interface to much of the options system which is used to access preferences for the UI, but it is not yet documented.
| 6.1 Option Databases | ||
| 6.2 Option Types | ||
| 6.3 Option Creation | ||
| 6.4 Option Values |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The options for a particular report are placed in an options database. For doing a report, the option-generator function must return an options database. The function
(gnc:new-option)
returns a new, empty options database that you can then add options to.
Options are organised into sections, which are each given a title string such as "Register" or "International". The UI displays each section on a seperate page. Each section has a number of options. Each option has a name that uniquely identifies it in that section, and an alphabetic sort tag that determines the relative ordering of the options for display.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Sometimes, GnuCash requires the user to specify true/false properties. Others properties most easily specified by selections from a list, others from a number, others still by selecting dates, or one or more accounts in the account hierachy, or even colors. GnuCash supports all of these and more:
boolean
These are displayed as a checkbox by the UI. They are used to specify yes/no answers.
string
The UI provides a text entry box where arbitrary text may be entered.
font
This allows users to select fonts from those available on the system.
currency
For specifying a currency such as "USD", "AUD", "UKP" etc.
date
For specifying dates. Depending on exactly what is required, you can choose to let the user specify an absolute date, a relative date such as "one month ago", or "start of the current accounting period", or let the user choose how whether to specify the required date in relative or absolute terms.
account-list
For selecting a particular account or accounts. The UI displays a tree of the account hierachy.
multichoice
For selecting one of a group of choices.
list
Similar to the multichoice option, but allows the selection of one or more items from the group.
number-range
For specifying a numeric quantity. The programmer can bound the range and precision of the quantity.
pixmap
For selecting a pixmap located on the filesystem.
color
For selecting a color value.
internal
An option that isn't specified through an options dialog box. For instance, this is used to store the window dimensions so that they are preserved along with other preferences.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To add an option to an options database, you first create that option,
then register it with the database. For example, to create a simple
checkbox-style boolean option, you would use
gnc:make-simple-boolean-option to create the option. Once
created, you can then register the option. With
gnc:register-option.
The example below shows how to create an options database, then register a boolean option with it:
(define gnc:*hello-world-options* (gnc:new-options))
(gnc:register-option gnc:*hello-world-options*
(gnc:make-simple-boolean-option
"Hello, World!" "Boolean Option"
"a" "This is a boolean option." #t))
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Creates a boolean option, with option section section and name name specified as strings. Note that the section and name strings uniquely specify the option for the option database that they get registered to, and are used for looking up the option when the value is required. sort-tag is a string tag that specifies the relative order when displaying the options. Options are displayed top to bottom in case-sensitive alphabetical order. documentation-string is a string containing a short string describing the purpose of the option, which the UI displays as a tooltip. default-value should be a boolean value indicating the default value of this option.
Note that section, name, sort-tag, and documentation-string are common to all the following functions.
As above, but the function specified in option-widget-changed-cb is called when the GUI widget representing the option is changed (the user clicks on the toggle button), and setter-function-called-cb is called when the option's setter is called (when the user selects "OK" or "Apply").
One use for having a non-false option-widget-changed-cb is to make
another option mutable (in concert with gnc:option-set-sensitive,
discussed later).
Make an option where the user can specify a string.
Create a date option. There are three different variations of date
options, specified by the variable subtype, which should be one of
'relative, 'absolute, or both. absolute
date options allow the selection of a specific day/month/year
combination. relative date options allow the selection from a
list of different dates specified in relation to the current date, such
as "today", "start of the current month", or "six months ago". Finally
both allows the user to choose either using absolute or relative
date options.
'relative or 'absolute, to indicate whether the
default value is relative or absolute. If the car is relative,
then the cdr should be a one of the relative date symbols listed in
relative-date-list. If the car is absolute, it should be a
timepair containing the default date/time.
show-time is a boolean that indicates whether when selecting an
absolute date, the user can specify a time. It is ignored if the
subtype is relative.
relative-date-list is a list of symbols that indicate the relative dates permitted. The symbols used must have been previously defined as indicating a particular relative date. gnc:relative-dates contains a list of symbols that have already been set up for the most common relative dates. FIXME: document relative date system.
Create a multichoice option. value-list is a list of vectors of length 3, each representing a different choice. Each vector should contain - in the following order:
Like a multichoice option, but users can select one or more values from a list. default-values is a list of selected values instead of just one.
Allow the user to specify the font. Font options store font descriptions as strings, like the X Logical Font Description. You must provide a default value, as there is unfortunately no easy way for the GUI to pick a default value.
Allow the user to select a color. The default value should be a list of length 4 containing the red, green, blue, and alpha channel values for the color. The scale is the maximum value for a channel, and the use-alpha? is a boolean that, if false, disregards the alpha channel (note: if you don't know what an alpha channel is, you don't need it).
Let the user specify a currency using a currency code. The GUI provides a specialised widget for currency selection.
Create an option for selecting a numerical quantity. lower-bound and upper-bound specify the domain of acceptable figures, and num-decimals specifies the range to which the option will be displayed (FIXME:and rounded to?). Step-size specifies the step size for the UI's up/down buttons.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To get the value of an option, you must first lookup the option in the options database.
Looks up the option in section section and name name in the options database options.
Once you have looked up the option, you can get its value using
the function gnc:option-value.
Get the value of an option. Option values returned are of the same type as how the default values are specified (except the date option which needs to be fixed).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| Jump to: | D G K S X |
|---|
| Jump to: | D G K S X |
|---|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| Jump to: | A B E G K S T |
|---|
| Jump to: | A B E G K S T |
|---|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| Jump to: | B C G K N O R S T U W |
|---|
| Jump to: | B C G K N O R S T U W |
|---|
| [Top] | [Contents] | [Index] | [ ? ] |
The xacc prefix is a historical artifact. GnuCash
was derived from X-Accountant by Robin Clark.
| [Top] | [Contents] | [Index] | [ ? ] |
GNU Free Documentation License
PreambleIntroduction
APPLICABILITY AND DEFINITIONS
VERBATIM COPYING
COPYING IN QUANTITY
MODIFICATIONS
COMBINING DOCUMENTS
COLLECTIONS OF DOCUMENTS
AGGREGATION WITH INDEPENDENT WORKS
TRANSLATION
TERMINATION
FUTURE REVISIONS OF THIS LICENSE
ADDENDUM: How to use this License for your documents
Who Should Read This Document?1. Architectural Overview
Goals
1.1 The Engine2. Engine
1.1.1 Query1.2 The Register
1.1.2 File I/O
1.1.3 XML I/O
1.1.4 Backend
1.3 Reports
1.4 Graphs
1.5 Price Quotes
1.6 User Preferences
1.7 QIF Import
1.8 GnuCash
2.1 Introduction3. Component Manager
2.2 Using and Extending the Engine API
2.3 Globally Unique Identifiers
2.3.1 When to use GUIDs2.4 Numeric Library
2.3.2 GUID Types
2.3.3 How to use GUIDs
2.3.4 GUIDs and GnuCash Entities
2.3.5 The GUID Generator
2.4.1 Standard Numeric Arguments2.5 Key-Value Pair Frames
2.4.2 Creating Numeric Objects
2.4.3 Basic Arithmetic Operations
2.4.4 Numeric Comparisons and Predicates
2.4.5 Numeric Denominator Conversion
2.4.6 Numeric Floating Point Conversion
2.4.7 Numeric String Conversion
2.4.8 Numeric Error Handling
2.4.9 Numeric Example
2.5.1 Key-Value Policy2.6 Events
2.5.2 kvp_frame
2.5.3 kvp_value
2.5.3.1 Value Constructors2.5.4 kvp_list
2.5.3.2 Value Accessors
2.6.1 Event API2.7 Commodities
2.7.1 General Commodity API2.8 Commodity Tables
2.7.2 Commodity Getters
2.7.3 Commodity Setters
2.8.1 General Commodity Table API2.9 Prices
2.8.2 Commodity Table Access API
2.8.3 Commodity Table Modification API
2.9.1 Price Implementation Details2.10 Price Databases
2.9.2 General Price API
2.9.3 Price Getters
2.9.4 Price Setters
2.10.1 Price Lists2.11 Splits
2.10.2 General Price Database API
2.11.1 General Split API2.12 Transactions
2.11.2 Split Getters
2.11.3 Split Setters
2.12.1 The Transaction Edit Cycle2.13 Accounts
2.12.2 General Transaction API
2.12.3 Transaction Getters
2.12.4 Transaction Setters
2.13.1 Account Types2.14 Account Groups
2.13.2 General Account API
2.13.3 Account Type API
2.13.4 Account Getters
2.13.5 Account Tax API
2.14.1 General Account Group API2.15 GNCBooks
2.14.2 Account Group Account API
2.15.1 GNCBook API2.16 Scrub
3.1 Introduction4. Register
3.2 Refresh Mechanism
3.3 Initialization and Shutdown
3.4 Refresh Handlers
3.5 Close Handlers
3.6 Registering and Unregistering Components
3.7 Watching Engine Objects
3.8 Controlling Refreshes
3.9 Finding Components
3.10 Iterating over Components
4.1 Cells5. Reports
4.1.1 BasicCell4.2 Cellblocks
4.3 Table
4.4 Split Register
5.1 Creating a Report6. User Preferences
6.1 Option DatabasesFunction Index
6.2 Option Types
6.3 Option Creation
6.3.1 Option Creation Functions6.4 Option Values
Date Type Index
Concept Index
| [Top] | [Contents] | [Index] | [ ? ] |
GNU Free Documentation License
Introduction
1. Architectural Overview
2. Engine
3. Component Manager
4. Register
5. Reports
6. User Preferences
Function Index
Date Type Index
Concept Index
| [Top] | [Contents] | [Index] | [ ? ] |
| Button | Name | Go to | From 1.2.3 go to |
|---|---|---|---|
| [ < ] | Back | previous section in reading order | 1.2.2 |
| [ > ] | Forward | next section in reading order | 1.2.4 |
| [ << ] | FastBack | beginning of this chapter or previous chapter | 1 |
| [ Up ] | Up | up section | 1.2 |
| [ >> ] | FastForward | next chapter | 2 |
| [Top] | Top | cover (top) of document | |
| [Contents] | Contents | table of contents | |
| [Index] | Index | concept index | |
| [ ? ] | About | this page |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure: