GnuCash  4.14+
Data Structures | Typedefs | Enumerations | Functions
split-register.h File Reference

API for checkbook register display area. More...

#include <glib.h>
#include "Transaction.h"
#include "table-allgui.h"

Go to the source code of this file.

Data Structures

struct  SplitRegister
 The type, style and table for the register. More...


Cell Names

T* cells are transaction summary cells

#define ACTN_CELL   "action"
#define DOCLINK_CELL   "doclink"
#define BALN_CELL   "balance"
#define CRED_CELL   "credit"
#define DATE_CELL   "date"
#define DDUE_CELL   "date-due"
#define DEBT_CELL   "debit"
#define DESC_CELL   "description"
#define FCRED_CELL   "credit-formula"
#define FDEBT_CELL   "debit-formula"
#define MEMO_CELL   "memo"
#define MXFRM_CELL   "transfer"
#define NOTES_CELL   "notes"
#define NUM_CELL   "num"
#define TNUM_CELL   "trans-num"
#define PRIC_CELL   "price"
#define RATE_CELL   "exchrate"
#define RECN_CELL   "reconcile"
#define SHRS_CELL   "shares"
#define TBALN_CELL   "trans-balance"
#define TCRED_CELL   "trans-credit"
#define TDEBT_CELL   "trans-debit"
#define TSHRS_CELL   "trans-shares"
#define TYPE_CELL   "split-type"
#define XFRM_CELL   "account"
#define VNOTES_CELL   "void-notes"
#define RBALN_CELL   "reg-run-balance"
Cursor Names

Cursors ending in 'NUM_ACTN' use the split action field for the NUM_CELL rather than the transaction number field which is shown in the TNUM_CELL

#define CURSOR_SINGLE_LEDGER   "cursor-single-ledger"
#define CURSOR_DOUBLE_LEDGER   "cursor-double-ledger"
#define CURSOR_DOUBLE_LEDGER_NUM_ACTN   "cursor-double-ledger-num-actn"
#define CURSOR_SINGLE_JOURNAL   "cursor-single-journal"
#define CURSOR_DOUBLE_JOURNAL   "cursor-double-journal"
#define CURSOR_DOUBLE_JOURNAL_NUM_ACTN   "cursor-double-journal-num-actn"
#define CURSOR_SPLIT   "cursor-split"


typedef GtkWidget *(* SRGetParentCallback) (gpointer user_data)
 Callback function type.


enum  SplitRegisterType {
 Register types. More...
enum  SplitRegisterTypeGroup {
 Register group types. More...
 Register styles.
 Types of cursors.


SplitRegister * gnc_split_register_new (SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line, gboolean is_template, gboolean mismatched_commodities)
 Creates a new split register. More...
void gnc_split_register_destroy (SplitRegister *reg)
 Destroys a split register. More...
void gnc_split_register_config (SplitRegister *reg, SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line)
 Sets a split register's type, style or line use. More...
void gnc_split_register_set_reverse_sort (SplitRegister *reg, gboolean reverse_sort)
 Sets a split register's reverse sort order based on register. More...
void gnc_split_register_set_auto_complete (SplitRegister *reg, gboolean do_auto_complete)
 Sets whether a register uses auto-completion. More...
void gnc_split_register_set_read_only (SplitRegister *reg, gboolean read_only)
 Sets whether a register window is "read only". More...
SplitRegisterTypeGroup gnc_split_register_get_register_group (SplitRegister *reg)
 Group registers for common layouts. More...
void gnc_split_register_set_template_account (SplitRegister *reg, Account *template_account)
 Set the template account for use in a template register. More...
void gnc_split_register_set_data (SplitRegister *reg, gpointer user_data, SRGetParentCallback get_parent)
 Sets the user data and callback hooks for the register. More...
CursorClass gnc_split_register_get_current_cursor_class (SplitRegister *reg)
 Returns the class of a register's current cursor. More...
CursorClass gnc_split_register_get_cursor_class (SplitRegister *reg, VirtualCellLocation vcell_loc)
 Returns the class of the cursor at the given virtual cell location. More...
Transaction * gnc_split_register_get_current_trans (SplitRegister *reg)
 Gets the transaction at the current cursor location, which may be on the transaction itself or on any of its splits. More...
Split * gnc_split_register_get_current_trans_split (SplitRegister *reg, VirtualCellLocation *vcell_loc)
 Gets the anchoring split of the transaction at the current cursor location, which may be on the transaction itself or on any of its splits. More...
Split * gnc_split_register_get_current_split (SplitRegister *reg)
 Returns the split at which the cursor is currently located. More...
Split * gnc_split_register_get_blank_split (SplitRegister *reg)
 Gets the blank split for a register. More...
gboolean gnc_split_register_get_split_virt_loc (SplitRegister *reg, Split *split, VirtualCellLocation *vcell_loc)
 Searches the split register for a given split. More...
gboolean gnc_split_register_get_split_amount_virt_loc (SplitRegister *reg, Split *split, VirtualLocation *virt_loc)
 Searches the split register for the given split and determines the location of either its credit (if non-zero) or debit cell. More...
Split * gnc_split_register_duplicate_current (SplitRegister *reg)
 Duplicates either the current transaction or the current split depending on the register mode and cursor position. More...
void gnc_split_register_copy_current (SplitRegister *reg)
 Makes a copy of the current entity, either a split or a transaction, so that it can be pasted later. More...
void gnc_split_register_cut_current (SplitRegister *reg)
 Equivalent to copying the current entity and the deleting it with the appropriate delete method. More...
void gnc_split_register_paste_current (SplitRegister *reg)
 Pastes a previous copied entity onto the current entity, but only if the copied and current entity have the same type. More...
void gnc_split_register_delete_current_split (SplitRegister *reg)
 Deletes the split associated with the current cursor, if both are non-NULL. More...
void gnc_split_register_delete_current_trans (SplitRegister *reg)
 Deletes the transaction associated with the current cursor, if both are non-NULL. More...
void gnc_split_register_void_current_trans (SplitRegister *reg, const char *reason)
 Voids the transaction associated with the current cursor, if non-NULL. More...
void gnc_split_register_unvoid_current_trans (SplitRegister *reg)
 Unvoids the transaction associated with the current cursor, if non-NULL. More...
void gnc_split_register_empty_current_trans_except_split (SplitRegister *reg, Split *split)
 Deletes the non-transaction splits associated with the current cursor, if both are non-NULL. More...
void gnc_split_register_empty_current_trans (SplitRegister *reg)
void gnc_split_register_cancel_cursor_split_changes (SplitRegister *reg)
 Cancels any changes made to the current cursor, reloads the cursor from the engine, reloads the table from the cursor, and updates the GUI. More...
void gnc_split_register_cancel_cursor_trans_changes (SplitRegister *reg)
 Cancels any changes made to the current pending transaction, reloads the table from the engine, and updates the GUI. More...
void gnc_split_register_load (SplitRegister *reg, GList *slist, Account *default_account)
 Populates the rows of a register. More...
gboolean gnc_split_register_save (SplitRegister *reg, gboolean do_commit)
 Copy the contents of the current cursor to a split. More...
void gnc_split_register_redraw (SplitRegister *reg)
 Causes a redraw of the register window associated with reg. More...
gboolean gnc_split_register_changed (SplitRegister *reg)
 Returns TRUE if the register has changed cells. More...
void gnc_split_register_show_present_divider (SplitRegister *reg, gboolean show_present)
 If TRUE, visually indicate the demarcation between splits with post dates prior to the present, and after. More...
void gnc_split_register_expand_current_trans (SplitRegister *reg, gboolean expand)
 Expand the current transaction if it is collapsed. More...
void gnc_split_register_collapse_current_trans (SplitRegister *reg)
 Mark the current transaction as collapsed, and do callbacks. More...
gboolean gnc_split_register_current_trans_expanded (SplitRegister *reg)
 Return TRUE if current trans is expanded and style is REG_STYLE_LEDGER. More...
const char * gnc_split_register_get_debit_string (SplitRegister *reg)
 Return the debit string used in the register. More...
const char * gnc_split_register_get_credit_string (SplitRegister *reg)
 Return the credit string used in the register. More...
gboolean gnc_split_register_is_blank_split (SplitRegister *reg, Split *split)
 Return TRUE if split is the blank_split. More...
void gnc_split_register_change_blank_split_ref (SplitRegister *reg, Split *split)
 Change the blank_split reference from pointing to split to another split of the transaction. More...
gboolean gnc_split_register_handle_exchange (SplitRegister *reg, gboolean force_dialog)
 Pop up the exchange-rate dialog, maybe, for the current split. More...
gboolean gnc_split_register_begin_edit_or_warn (SRInfo *info, Transaction *trans)
gboolean gnc_split_register_full_refresh_ok (SplitRegister *reg)
 Private function – outsiders must not use this.
void gnc_copy_trans_onto_trans (Transaction *from, Transaction *to, gboolean use_cut_semantics, gboolean do_commit)
 Private function – outsiders must not use this.

Detailed Description

API for checkbook register display area.

Copyright (C) 1998-2000 Linas Vepstas

Definition in file split-register.h.