GnuCash  5.6-150-g038405b370+
recncell.h
Go to the documentation of this file.
1 /********************************************************************\
2  * recncell.h -- reconcile checkbox cell *
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 \********************************************************************/
22 
31 /* HISTORY:
32  * Copyright (c) 1998 Linas Vepstas
33  * Copyright (c) 2000 Dave Peticolas
34  * Copyright (c) 2001 Derek Atkins
35  */
36 
37 #ifndef RECN_CELL_H
38 #define RECN_CELL_H
39 
40 #include <glib.h>
41 
42 #include "basiccell.h"
43 
44 typedef const char * (*RecnCellStringGetter) (char flag);
45 typedef gboolean (*RecnCellConfirm) (char old_flag, gpointer data);
46 
47 typedef struct
48 {
49  BasicCell cell;
50 
51  char flag;
53  char * valid_flags;
54  char * flag_order;
55  char default_flag;
57  RecnCellStringGetter get_string;
58  RecnCellConfirm confirm_cb;
59  gpointer confirm_data;
60  gboolean read_only;
61 } RecnCell;
62 
63 BasicCell * gnc_recn_cell_new (void);
64 
65 void gnc_recn_cell_set_flag (RecnCell *cell, char flag);
66 char gnc_recn_cell_get_flag (RecnCell *cell);
67 
68 void gnc_recn_cell_set_confirm_cb (RecnCell *cell,
69  RecnCellConfirm confirm_cb,
70  gpointer data);
71 
72 void gnc_recn_cell_set_string_getter (RecnCell *cell,
73  RecnCellStringGetter getter);
74 
82 void gnc_recn_cell_set_valid_flags (RecnCell *cell, const char *flags,
83  char default_flag);
84 void gnc_recn_cell_set_flag_order (RecnCell *cell, const char *flags);
85 
86 void gnc_recn_cell_set_read_only (RecnCell *cell, gboolean read_only);
88 #endif
void gnc_recn_cell_set_valid_flags(RecnCell *cell, const char *flags, char default_flag)
note that chars is copied into the RecnCell directly, but remains the "property" of the caller...
Definition: recncell.c:196
The RecnCell object implements a cell handler that will cycle through a series of single-character va...
Definition: recncell.h:47
char default_flag
Automatic flag selection order.
Definition: recncell.h:55
char * flag_order
The list of valid flags.
Definition: recncell.h:54
char * valid_flags
The actual flag value.
Definition: recncell.h:53