GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
quickfillcell.h
1 /********************************************************************\
2  * quickfillcell.h -- autocompletion based on memorized history *
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 /*
24  * FILE:
25  * quickfillcell.h
26  *
27  * FUNCTION:
28  * The QuickFillCell implements a text cell with quick-fill
29  * capabilities. By "quick fill" we mean a cell that will
30  * automatically sentence-complete the entry after the user
31  * typed a sufficient number of letters to identify a unique
32  * entry.
33  *
34  * On the output side, this is just a plain text cell.
35  *
36  * METHODS:
37  * The xaccSetQuickFillCellValue() method sets the
38  * current cell value to the indicated string,
39  * simultaneously adding the string to the quick-fill
40  * tree.
41  *
42  * HISTORY:
43  * Copyright (c) 1997, 1998 Linas Vepstas
44  * Copyright (c) 2000 Dave Peticolas
45  */
46 
47 #ifndef QUICKFILL_CELL_H
48 #define QUICKFILL_CELL_H
49 
50 #include "basiccell.h"
51 #include "QuickFill.h"
52 
53 typedef struct
54 {
55  BasicCell cell;
56  QuickFill *qf; /* quickfill-tree handled by this cell */
57 
58  QuickFillSort sort; /* determines order of strings matched.
59  * default is QUICKFILL_LIFO. */
60 
61  char *original; /* original string entered in original case */
62 
63  gboolean use_quickfill_cache; /* If TRUE, we don't own the qf */
65 
66 BasicCell * gnc_quickfill_cell_new (void);
67 
68 void gnc_quickfill_cell_set_value (QuickFillCell *cell,
69  const char *value);
70 
71 void gnc_quickfill_cell_set_sort (QuickFillCell *cell,
72  QuickFillSort sort);
73 
74 void gnc_quickfill_cell_add_completion (QuickFillCell *cell,
75  const char *completion);
76 
80 void
81 gnc_quickfill_cell_use_quickfill_cache (QuickFillCell *cell, QuickFill *shared_qf);
82 
83 #endif
QuickFill is used to auto-complete typed user entries.