GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
table-control.h
1 /********************************************************************\
2  * table-control.h -- table control object *
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 [email protected] *
20  * *
21 \********************************************************************/
22 
23 #ifndef TABLE_CONTROL_H
24 #define TABLE_CONTROL_H
25 
26 #include "register-common.h"
27 
28 typedef enum
29 {
30  GNC_TABLE_TRAVERSE_POINTER,
31  GNC_TABLE_TRAVERSE_LEFT,
32  GNC_TABLE_TRAVERSE_RIGHT,
33  GNC_TABLE_TRAVERSE_UP,
34  GNC_TABLE_TRAVERSE_DOWN
35 } gncTableTraversalDir;
36 
37 typedef void (*TableMoveFunc) (VirtualLocation *new_virt_loc,
38  gpointer user_data);
39 
40 typedef gboolean (*TableTraverseFunc) (VirtualLocation *new_virt_loc,
41  gncTableTraversalDir dir,
42  gpointer user_data);
43 
44 typedef struct table_control
45 {
46  /* called when the cursor is moved */
47  TableMoveFunc move_cursor;
48 
49  gboolean allow_move;
50 
51  /* called to determine traversal when user requests a move */
52  TableTraverseFunc traverse;
53 
54  gpointer user_data;
55 } TableControl;
56 
57 
58 TableControl * gnc_table_control_new (void);
59 void gnc_table_control_destroy (TableControl *control);
60 
61 void gnc_table_control_allow_move (TableControl *control,
62  gboolean allow_move);
63 
64 #endif
Common declarations for the register core.