GnuCash
5.6-150-g038405b370+
|
A "Cellblock" is an array of active cells. More...
Files | |
file | cellblock.h |
Declarations for the CellBlock object. | |
Data Structures | |
struct | CellBlock |
Functions | |
CellBlock * | gnc_cellblock_new (int rows, int cols, const char *cursor_name) |
Create a new CellBlock on the heap. More... | |
void | gnc_cellblock_destroy (CellBlock *cellblock) |
Delete a CellBlock and its Cells. More... | |
void | gnc_cellblock_set_cell (CellBlock *cellblock, int row, int col, BasicCell *cell) |
Add a cell to the CellBlock at the specified coordinates. More... | |
BasicCell * | gnc_cellblock_get_cell (CellBlock *cellblock, int row, int col) |
Retrieve the Cell at the specified coordinates. More... | |
BasicCell * | gnc_cellblock_get_cell_by_name (CellBlock *cellblock, const char *cell_name, int *row, int *col) |
Searches by name for a particular cell in a CellBlock. More... | |
int | gnc_cellblock_changed (CellBlock *cursor, gboolean include_conditional) |
Return number of changed cells. More... | |
void | gnc_cellblock_clear_changes (CellBlock *cursor) |
Sets all cells in the cellblock to not changed. More... | |
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.
int gnc_cellblock_changed | ( | CellBlock * | cursor, |
gboolean | include_conditional | ||
) |
Return number of changed cells.
cursor | The cellblock to query |
include_conditional | If TRUE counts conditionally-changed cells |
Definition at line 157 of file cellblock.c.
void gnc_cellblock_clear_changes | ( | CellBlock * | cursor | ) |
Sets all cells in the cellblock to not changed.
cursor | The cellblock. |
Definition at line 189 of file cellblock.c.
void gnc_cellblock_destroy | ( | CellBlock * | cellblock | ) |
Delete a CellBlock and its Cells.
cellblock | The CellBlock to destroy. |
Definition at line 78 of file cellblock.c.
BasicCell* gnc_cellblock_get_cell | ( | CellBlock * | cellblock, |
int | row, | ||
int | col | ||
) |
Retrieve the Cell at the specified coordinates.
cellblock | The CellBlock |
row | The row of the requested Cell |
col | The column of the requested Cell |
Definition at line 109 of file cellblock.c.
BasicCell* gnc_cellblock_get_cell_by_name | ( | CellBlock * | cellblock, |
const char * | cell_name, | ||
int * | row, | ||
int * | col | ||
) |
Searches by name for a particular cell in a CellBlock.
Parameters row
and/or col
may be NULL
.
cellblock | a CellBlock to search |
cell_name | the name of the cell to find |
row | pointer for returning the row in which the cell was found, or NULL |
col | pointer for returning the column in which the cell was found, or NULL |
NULL
Definition at line 124 of file cellblock.c.
CellBlock* gnc_cellblock_new | ( | int | rows, |
int | cols, | ||
const char * | cursor_name | ||
) |
Create a new CellBlock on the heap.
rows | Number of rows. |
cols | Number of columns. |
cursor_name | A string name for the CellBlock. It will be copied with a new string on the heap. |
Definition at line 44 of file cellblock.c.
void gnc_cellblock_set_cell | ( | CellBlock * | cellblock, |
int | row, | ||
int | col, | ||
BasicCell * | cell | ||
) |
Add a cell to the CellBlock at the specified coordinates.
The CellBlock takes ownership of the Cell. If there's already a Cell at the location it will be leaked, so callers should first call gnc_cellblock_get_cell() and delete the result if it's not NULL.
cellblock | The CellBlock |
row | The row at which to add the cell |
col | The column at which to add the cell |
cell | The cell to place at the coordinates. |
Definition at line 92 of file cellblock.c.