GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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  split_register
 The type, style and table for the register. More...
 

Macros

Cell Names

T* cells are transaction summary cells

#define ACTN_CELL   "action"
 
#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"
 

Typedefs

typedef struct split_register SplitRegister
 A split register created with gnc_split_register_new.
 
typedef struct sr_info SRInfo
 
typedef GtkWidget *(* SRGetParentCallback )(gpointer user_data)
 

Enumerations

enum  CursorClass { CURSOR_CLASS_NONE = -1, CURSOR_CLASS_SPLIT, CURSOR_CLASS_TRANS, NUM_CURSOR_CLASSES }
 
enum  SplitRegisterType {
  BANK_REGISTER, CASH_REGISTER, ASSET_REGISTER, CREDIT_REGISTER,
  LIABILITY_REGISTER, INCOME_REGISTER, EXPENSE_REGISTER, EQUITY_REGISTER,
  STOCK_REGISTER, CURRENCY_REGISTER, RECEIVABLE_REGISTER, PAYABLE_REGISTER,
  TRADING_REGISTER, NUM_SINGLE_REGISTER_TYPES, GENERAL_LEDGER = NUM_SINGLE_REGISTER_TYPES, INCOME_LEDGER,
  PORTFOLIO_LEDGER, SEARCH_LEDGER, NUM_REGISTER_TYPES
}
 Register types. More...
 
enum  SplitRegisterStyle { REG_STYLE_LEDGER, REG_STYLE_AUTO_LEDGER, REG_STYLE_JOURNAL }
 

Functions

SplitRegistergnc_split_register_new (SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line, gboolean is_template)
 
void gnc_split_register_destroy (SplitRegister *reg)
 
void gnc_split_register_config (SplitRegister *reg, SplitRegisterType type, SplitRegisterStyle style, gboolean use_double_line)
 
void gnc_split_register_set_auto_complete (SplitRegister *reg, gboolean do_auto_complete)
 
void gnc_split_register_set_read_only (SplitRegister *reg, gboolean read_only)
 
void gnc_split_register_set_template_account (SplitRegister *reg, Account *template_account)
 
void gnc_split_register_set_data (SplitRegister *reg, gpointer user_data, SRGetParentCallback get_parent)
 
CursorClass gnc_split_register_get_current_cursor_class (SplitRegister *reg)
 
CursorClass gnc_split_register_get_cursor_class (SplitRegister *reg, VirtualCellLocation vcell_loc)
 
Transactiongnc_split_register_get_current_trans (SplitRegister *reg)
 
Splitgnc_split_register_get_current_trans_split (SplitRegister *reg, VirtualCellLocation *vcell_loc)
 
Splitgnc_split_register_get_current_split (SplitRegister *reg)
 
Splitgnc_split_register_get_blank_split (SplitRegister *reg)
 
gboolean gnc_split_register_get_split_virt_loc (SplitRegister *reg, Split *split, VirtualCellLocation *vcell_loc)
 
gboolean gnc_split_register_get_split_amount_virt_loc (SplitRegister *reg, Split *split, VirtualLocation *virt_loc)
 
Splitgnc_split_register_duplicate_current (SplitRegister *reg)
 
void gnc_split_register_copy_current (SplitRegister *reg)
 
void gnc_split_register_cut_current (SplitRegister *reg)
 
void gnc_split_register_paste_current (SplitRegister *reg)
 
void gnc_split_register_delete_current_split (SplitRegister *reg)
 
void gnc_split_register_delete_current_trans (SplitRegister *reg)
 
void gnc_split_register_void_current_trans (SplitRegister *reg, const char *reason)
 
void gnc_split_register_unvoid_current_trans (SplitRegister *reg)
 
void gnc_split_register_empty_current_trans_except_split (SplitRegister *reg, Split *split)
 
void gnc_split_register_empty_current_trans (SplitRegister *reg)
 
void gnc_split_register_cancel_cursor_split_changes (SplitRegister *reg)
 
void gnc_split_register_cancel_cursor_trans_changes (SplitRegister *reg)
 
void gnc_split_register_load (SplitRegister *reg, GList *slist, Account *default_account)
 
gboolean gnc_split_register_save (SplitRegister *reg, gboolean do_commit)
 
void gnc_split_register_redraw (SplitRegister *reg)
 
gboolean gnc_split_register_changed (SplitRegister *reg)
 
void gnc_split_register_show_present_divider (SplitRegister *reg, gboolean show_present)
 
void gnc_split_register_expand_current_trans (SplitRegister *reg, gboolean expand)
 
void gnc_split_register_collapse_current_trans (SplitRegister *reg)
 
gboolean gnc_split_register_current_trans_expanded (SplitRegister *reg)
 
const char * gnc_split_register_get_debit_string (SplitRegister *reg)
 
const char * gnc_split_register_get_credit_string (SplitRegister *reg)
 
gboolean gnc_split_register_handle_exchange (SplitRegister *reg, gboolean force_dialog)
 
gboolean gnc_split_register_begin_edit_or_warn (SRInfo *info, Transaction *trans)
 
gboolean gnc_split_register_full_refresh_ok (SplitRegister *reg)
 
void gnc_copy_trans_onto_trans (Transaction *from, Transaction *to, gboolean use_cut_semantics, gboolean do_commit)
 

Detailed Description

API for checkbook register display area.

The Register itself is independent of GnuCash, and is designed so that it can be used with other applications. The Ledger is an adaptation of the Register for use by GnuCash. The Ledger sets up an explicit visual layout, putting certain types of cells in specific locations (e.g. date on left, summary in middle, value at right), and hooks up these cells to the various GnuCash financial objects.

This code is also theoretically independent of the actual GUI toolkit/widget-set (it once worked with both Motif and Gnome). The actual GUI-toolkit specific code is supposed to be in a GUI portability layer. Over the years, some gnome-isms may have snuck in; these should also be cleaned up.

Author
Copyright (C) 1998-2000 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g

Definition in file split-register.h.

Function Documentation

void gnc_copy_trans_onto_trans ( Transaction from,
Transaction to,
gboolean  use_cut_semantics,
gboolean  do_commit 
)

Private function – outsiders must not use this

Definition at line 98 of file split-register.c.

101 {
102  SCM trans_scm;
103 
104  if ((from == NULL) || (to == NULL))
105  return;
106 
107  trans_scm = gnc_copy_trans(from, use_cut_semantics);
108  if (trans_scm == SCM_UNDEFINED)
109  return;
110 
111  gnc_copy_trans_scm_onto_trans(trans_scm, to, do_commit,
112  gnc_get_current_book ());
113 }
gboolean gnc_split_register_full_refresh_ok ( SplitRegister reg)

Private function – outsiders must not use this

Definition at line 2389 of file split-register.c.

2390 {
2391  SRInfo *info = gnc_split_register_get_info (reg);
2392 
2393  if (!info)
2394  return FALSE;
2395 
2396  return info->full_refresh;
2397 }