GnuCash c935c2f+
Loading...
Searching...
No Matches
Modules | Files | Data Structures | Macros | Enumerator | Functions | Variables

An infrastructure for building a modular matrix of cells like a spreadsheet or checkbook register. More...

Modules

 Cell
 A "Cell" is an active object which is designed to read a specific kind of user input.
 
 Cellblock
 A "Cellblock" is an array of active cells.
 
 Table
 The "Table" is a displayed matrix.
 

Files

file  register-common.h
 Common declarations for the register core.
 

Data Structures

struct  VirtualCellLocation
 The VirtualCellLocation structure contains the virtual location of a virtual cell. More...
 
struct  VirtualLocation
 The VirtualLocation structure contains the virtual location of a physical cell. More...
 

Macros

#define BASIC_CELL_TYPE_NAME   "basic-cell"
 
#define COMBO_CELL_TYPE_NAME   "combo-cell"
 
#define DATE_CELL_TYPE_NAME   "date-cell"
 
#define NUM_CELL_TYPE_NAME   "num-cell"
 
#define PRICE_CELL_TYPE_NAME   "price-cell"
 
#define RECN_CELL_TYPE_NAME   "recn-cell"
 
#define DOCLINK_CELL_TYPE_NAME   "doclink-cell"
 
#define QUICKFILL_CELL_TYPE_NAME   "quickfill-cell"
 
#define FORMULA_CELL_TYPE_NAME   "formula-cell"
 
#define CHECKBOX_CELL_TYPE_NAME   "checkbox-cell"
 
#define COMPLETION_CELL_TYPE_NAME   "completion-cell"
 

Functions

void gnc_register_init (void)
 
void gnc_register_shutdown (void)
 
void gnc_register_add_cell_type (const char *cell_type_name, CellCreateFunc cell_creator)
 
BasicCell * gnc_register_make_cell (const char *cell_type_name)
 
gboolean virt_cell_loc_equal (VirtualCellLocation vcl1, VirtualCellLocation vcl2)
 
gboolean virt_loc_equal (VirtualLocation vl1, VirtualLocation vl2)
 

Variables

char * BasicCell::cell_name
 
gchar * BasicCell::cell_type_name
 
char * BasicCell::value
 
guint BasicCell::value_chars
 current value
 
gboolean BasicCell::changed
 number of characters in value
 
gboolean BasicCell::conditionally_changed
 true if value modified
 
CellSetValueFunc BasicCell::set_value
 true if value modified conditionally
 
CellDestroyFunc BasicCell::destroy
 
CellEnterFunc BasicCell::enter_cell
 
CellModifyVerifyFunc BasicCell::modify_verify
 
CellDirectUpdateFunc BasicCell::direct_update
 
CellLeaveFunc BasicCell::leave_cell
 
CellRealizeFunc BasicCell::gui_realize
 
CellMoveFunc BasicCell::gui_move
 
CellDestroyFunc BasicCell::gui_destroy
 
char * BasicCell::sample_text
 
CellAlignment BasicCell::alignment
 sample text for sizing purposes
 
gboolean BasicCell::expandable
 horizontal alignment in column
 
gboolean BasicCell::span
 can fill with extra space
 
gboolean BasicCell::is_popup
 can span multiple columns
 
gpointer BasicCell::gui_private
 is a popup widget
 

Detailed Description

An infrastructure for building a modular matrix of cells like a spreadsheet or checkbook register.

Each cell may be specialized to perform a particular function, e.g. to read dates, numerical amounts, or text. The register core 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 spreadsheets.

The register core is built from several types of components: Cells, Cellblocks, Cursors, and the Table.

The register core should not have any 'knowledge' of the accounting model of GnuCash or of the workings of the main application. It should not be specific to a particular GUI (such as Gnome/GTK). It should be possible to use the register core in a stand-alone fashion.

For information on the GnuCash-specific register implementation that has been built atop this core, see Split Register.

Macro Definition Documentation

◆ BASIC_CELL_TYPE_NAME

#define BASIC_CELL_TYPE_NAME   "basic-cell"

Definition at line 64 of file register-common.h.

◆ CHECKBOX_CELL_TYPE_NAME

#define CHECKBOX_CELL_TYPE_NAME   "checkbox-cell"

Definition at line 73 of file register-common.h.

◆ COMBO_CELL_TYPE_NAME

#define COMBO_CELL_TYPE_NAME   "combo-cell"

Definition at line 65 of file register-common.h.

◆ COMPLETION_CELL_TYPE_NAME

#define COMPLETION_CELL_TYPE_NAME   "completion-cell"

Definition at line 74 of file register-common.h.

◆ DATE_CELL_TYPE_NAME

#define DATE_CELL_TYPE_NAME   "date-cell"

Definition at line 66 of file register-common.h.

◆ DOCLINK_CELL_TYPE_NAME

#define DOCLINK_CELL_TYPE_NAME   "doclink-cell"

Definition at line 70 of file register-common.h.

◆ FORMULA_CELL_TYPE_NAME

#define FORMULA_CELL_TYPE_NAME   "formula-cell"

Definition at line 72 of file register-common.h.

◆ NUM_CELL_TYPE_NAME

#define NUM_CELL_TYPE_NAME   "num-cell"

Definition at line 67 of file register-common.h.

◆ PRICE_CELL_TYPE_NAME

#define PRICE_CELL_TYPE_NAME   "price-cell"

Definition at line 68 of file register-common.h.

◆ QUICKFILL_CELL_TYPE_NAME

#define QUICKFILL_CELL_TYPE_NAME   "quickfill-cell"

Definition at line 71 of file register-common.h.

◆ RECN_CELL_TYPE_NAME

#define RECN_CELL_TYPE_NAME   "recn-cell"

Definition at line 69 of file register-common.h.

Function Documentation

◆ gnc_register_add_cell_type()

void gnc_register_add_cell_type ( const char *  cell_type_name,
CellCreateFunc  cell_creator 
)

Definition at line 84 of file register-common.c.

86{
87 gnc_register_init ();
88
89 gnc_cell_factory_add_cell_type (global_factory,
90 cell_type_name, cell_creator);
91}

◆ gnc_register_init()

void gnc_register_init ( void  )

Definition at line 45 of file register-common.c.

46{
47 if (register_inited)
48 return;
49
50 register_inited = TRUE;
51
52 global_factory = gnc_cell_factory_new ();
53
54 gnc_register_add_cell_type (BASIC_CELL_TYPE_NAME, gnc_basic_cell_new);
55
56 gnc_register_add_cell_type (NUM_CELL_TYPE_NAME, gnc_num_cell_new);
57
58 gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME, gnc_price_cell_new);
59
60 gnc_register_add_cell_type (RECN_CELL_TYPE_NAME, gnc_recn_cell_new);
61
62 gnc_register_add_cell_type (DOCLINK_CELL_TYPE_NAME, gnc_doclink_cell_new);
63
64 gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME,
65 gnc_quickfill_cell_new);
66
67 gnc_register_add_cell_type (FORMULA_CELL_TYPE_NAME,
68 gnc_formula_cell_new);
69
70 gnc_register_add_cell_type (CHECKBOX_CELL_TYPE_NAME, gnc_checkbox_cell_new);
71}
BasicCell * gnc_price_cell_new(void)
installs a callback to handle price recording
Definition pricecell.c:168

◆ gnc_register_make_cell()

BasicCell * gnc_register_make_cell ( const char *  cell_type_name)

Definition at line 94 of file register-common.c.

95{
96 gnc_register_init ();
97
98 return gnc_cell_factory_make_cell (global_factory, cell_type_name);
99}

◆ gnc_register_shutdown()

void gnc_register_shutdown ( void  )

Definition at line 74 of file register-common.c.

75{
76 if (!register_inited)
77 return;
78
79 gnc_cell_factory_destroy (global_factory);
80 global_factory = NULL;
81}

◆ virt_cell_loc_equal()

gboolean virt_cell_loc_equal ( VirtualCellLocation  vcl1,
VirtualCellLocation  vcl2 
)

Definition at line 102 of file register-common.c.

103{
104 return ((vcl1.virt_row == vcl2.virt_row) &&
105 (vcl1.virt_col == vcl2.virt_col));
106}

◆ virt_loc_equal()

gboolean virt_loc_equal ( VirtualLocation  vl1,
VirtualLocation  vl2 
)

Definition at line 109 of file register-common.c.

110{
111 return (virt_cell_loc_equal (vl1.vcell_loc, vl2.vcell_loc) &&
112 (vl1.phys_row_offset == vl2.phys_row_offset) &&
113 (vl1.phys_col_offset == vl2.phys_col_offset));
114}

Variable Documentation

◆ alignment

CellAlignment BasicCell::alignment

sample text for sizing purposes

Definition at line 239 of file basiccell.h.

◆ cell_name

char* BasicCell::cell_name

Definition at line 214 of file basiccell.h.

◆ cell_type_name

gchar* BasicCell::cell_type_name

Definition at line 215 of file basiccell.h.

◆ changed

gboolean BasicCell::changed

number of characters in value

Definition at line 219 of file basiccell.h.

◆ conditionally_changed

gboolean BasicCell::conditionally_changed

true if value modified

Definition at line 220 of file basiccell.h.

◆ destroy

CellDestroyFunc BasicCell::destroy

Definition at line 224 of file basiccell.h.

◆ direct_update

CellDirectUpdateFunc BasicCell::direct_update

Definition at line 229 of file basiccell.h.

◆ enter_cell

CellEnterFunc BasicCell::enter_cell

Definition at line 227 of file basiccell.h.

◆ expandable

gboolean BasicCell::expandable

horizontal alignment in column

Definition at line 240 of file basiccell.h.

◆ gui_destroy

CellDestroyFunc BasicCell::gui_destroy

Definition at line 235 of file basiccell.h.

◆ gui_move

CellMoveFunc BasicCell::gui_move

Definition at line 234 of file basiccell.h.

◆ gui_private

gpointer BasicCell::gui_private

is a popup widget

Definition at line 244 of file basiccell.h.

◆ gui_realize

CellRealizeFunc BasicCell::gui_realize

Definition at line 233 of file basiccell.h.

◆ is_popup

gboolean BasicCell::is_popup

can span multiple columns

Definition at line 242 of file basiccell.h.

◆ leave_cell

CellLeaveFunc BasicCell::leave_cell

Definition at line 230 of file basiccell.h.

◆ modify_verify

CellModifyVerifyFunc BasicCell::modify_verify

Definition at line 228 of file basiccell.h.

◆ sample_text

char* BasicCell::sample_text

Definition at line 238 of file basiccell.h.

◆ set_value

CellSetValueFunc BasicCell::set_value

true if value modified conditionally

Definition at line 223 of file basiccell.h.

◆ span

gboolean BasicCell::span

can fill with extra space

Definition at line 241 of file basiccell.h.

◆ value

char* BasicCell::value

Definition at line 216 of file basiccell.h.

◆ value_chars

guint BasicCell::value_chars

current value

Definition at line 217 of file basiccell.h.