GnuCash  4.11-517-g41de4cefce
cellblock.h
Go to the documentation of this file.
1 /********************************************************************\
2  * cellblock.h -- group of cells that act as cursor within a table *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21 \********************************************************************/
46 #ifndef XACC_CELL_BLOCK_H
47 #define XACC_CELL_BLOCK_H
48 
49 #include "basiccell.h"
50 
51 #include "gtable.h"
52 
53 typedef struct
54 {
55  short num_rows;
56  short num_cols;
57 
58  short start_col;
59  short stop_col;
60 
61  char *cursor_name;
62 
63  GPtrArray *cells; /* Holds the CellBlockCell table */
64 } CellBlock;
65 
66 
75 CellBlock * gnc_cellblock_new (int rows, int cols, const char *cursor_name);
76 
80 void gnc_cellblock_destroy (CellBlock *cellblock);
81 
91 void gnc_cellblock_set_cell (CellBlock *cellblock,
92  int row, int col,
93  BasicCell *cell);
94 
101 BasicCell * gnc_cellblock_get_cell (CellBlock *cellblock,
102  int row, int col);
103 
119 BasicCell * gnc_cellblock_get_cell_by_name(CellBlock *cellblock,
120  const char *cell_name,
121  int *row, int *col);
122 
128 int gnc_cellblock_changed (CellBlock *cursor,
129  gboolean include_conditional);
130 
135 
136 #endif
137 
void gnc_cellblock_clear_changes(CellBlock *cursor)
Sets all cells in the cellblock to not changed.
Definition: cellblock.c:189
void gnc_cellblock_destroy(CellBlock *cellblock)
Delete a CellBlock and its Cells.
Definition: cellblock.c:78
CellBlock * gnc_cellblock_new(int rows, int cols, const char *cursor_name)
Create a new CellBlock on the heap.
Definition: cellblock.c:44
void gnc_cellblock_set_cell(CellBlock *cellblock, int row, int col, BasicCell *cell)
Add a cell to the CellBlock at the specified coordinates.
Definition: cellblock.c:92
This is the API for GTables, a datatype for 2-dimensional tables with automatic resizing and memory m...
int gnc_cellblock_changed(CellBlock *cursor, gboolean include_conditional)
Return number of changed cells.
Definition: cellblock.c:157
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.
Definition: cellblock.c:124
BasicCell * gnc_cellblock_get_cell(CellBlock *cellblock, int row, int col)
Retrieve the Cell at the specified coordinates.
Definition: cellblock.c:109