1 /********************************************************************\ 2 * register-common.h -- Common declarations for the register * 3 * Copyright (c) 2000 Dave Peticolas * 4 * * 5 * This program is free software; you can redistribute it and/or * 6 * modify it under the terms of the GNU General Public License as * 7 * published by the Free Software Foundation; either version 2 of * 8 * the License, or (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License* 16 * along with this program; if not, contact: * 17 * * 18 * Free Software Foundation Voice: +1-617-542-5942 * 19 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 20 * Boston, MA 02110-1301, USA gnu@gnu.org * 21 * * 22 \********************************************************************/ 23 /** @addtogroup GUI 24 * @{ 25 */ 26 /** @addtogroup Register Registers, Ledgers and Journals 27 * @{ 28 */ 29 /** @addtogroup RegisterCore Register Core 30 * @brief An infrastructure for building a modular matrix of cells like a 31 * spreadsheet or checkbook register. 32 * 33 * @details Each cell may be specialized to perform a particular function, 34 * e.g. to read dates, numerical amounts, or text. The register core has been 35 * designed to be easy to extend, modular, easy to maintain, and memory 36 * efficient. It is intended to be used for building financial apps and 37 * spreadsheets. 38 * 39 * The register core is built from several types of components: Cells, 40 * Cellblocks, Cursors, and the Table. 41 * 42 * The register core should not have any 'knowledge' of the accounting model 43 * of GnuCash or of the workings of the main application. It should not be 44 * specific to a particular GUI (such as Gnome/GTK). It should be possible 45 * to use the register core in a stand-alone fashion. 46 * 47 * For information on the GnuCash-specific register implementation that has 48 * been built atop this core, see @ref SplitRegister. 49 * 50 * @{ 51 */ 52 /** @file register-common.h 53 * @brief Common declarations for the register core 54 * @author Copyright (c) 2000 Dave Peticolas 55 */ 56 57 #ifndef REGISTER_COMMON_H 58 #define REGISTER_COMMON_H 59 60 #include <glib.h> 61 62 #include "basiccell.h" 63 64 #define BASIC_CELL_TYPE_NAME "basic-cell" 65 #define COMBO_CELL_TYPE_NAME "combo-cell" 66 #define DATE_CELL_TYPE_NAME "date-cell" 67 #define NUM_CELL_TYPE_NAME "num-cell" 68 #define PRICE_CELL_TYPE_NAME "price-cell" 69 #define RECN_CELL_TYPE_NAME "recn-cell" 70 #define DOCLINK_CELL_TYPE_NAME "doclink-cell" 71 #define QUICKFILL_CELL_TYPE_NAME "quickfill-cell" 72 #define FORMULA_CELL_TYPE_NAME "formula-cell" 73 #define CHECKBOX_CELL_TYPE_NAME "checkbox-cell" 74 75 void gnc_register_init (void); 76 void gnc_register_shutdown (void); 77 78 void gnc_register_add_cell_type (const char *cell_type_name, 79 CellCreateFunc cell_creator); 80 BasicCell * gnc_register_make_cell (const char *cell_type_name); 81 82 83 /** The VirtualCellLocation structure contains the virtual 84 * location of a virtual cell. 85 */ 86 typedef struct _VirtualCellLocation VirtualCellLocation; 87 struct _VirtualCellLocation 88 { 89 int virt_row; 90 int virt_col; 91 }; 92 93 94 gboolean virt_cell_loc_equal (VirtualCellLocation vcl1, 95 VirtualCellLocation vcl2); 96 97 98 /** The VirtualLocation structure contains the virtual 99 * location of a physical cell. 100 * 101 * There is one instance of Locator for each physical cell. 102 * The virt_row and virt_col members identify the corresponding 103 * cellblock/virtual cell that this physical cell is a member of. 104 * The two phys_offsets provide the location of the physical cell 105 * as an offset from the cell block origin. That is, the offsets 106 * should never be less than zero, or greater than the size of 107 * the cell block. 108 */ 109 typedef struct _VirtualLocation VirtualLocation; 110 struct _VirtualLocation 111 { 112 VirtualCellLocation vcell_loc; 113 int phys_row_offset; 114 int phys_col_offset; 115 }; 116 117 118 gboolean virt_loc_equal (VirtualLocation vl1, VirtualLocation vl2); 119 120 #endif 121 /** @} */ 122 /** @} */ 123 /** @} */ 124