GnuCash  4.11-137-g155922540d+
QuickFill.h
Go to the documentation of this file.
1 /********************************************************************\
2  * QuickFill.h -- the quickfill tree data structure *
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 \********************************************************************/
50 #ifndef QUICKFILL_H
51 #define QUICKFILL_H
52 
53 #include <glib.h>
54 
55 typedef enum
56 {
57  QUICKFILL_LIFO,
58  QUICKFILL_ALPHA
59 } QuickFillSort;
60 
61 typedef struct _QuickFill QuickFill;
62 
63 
64 /* PROTOTYPES ******************************************************/
65 
66 QuickFill * gnc_quickfill_new (void);
67 void gnc_quickfill_destroy (QuickFill *qf);
68 void gnc_quickfill_purge (QuickFill *qf);
69 
72 const char * gnc_quickfill_string (QuickFill *qf);
73 
83 QuickFill * gnc_quickfill_get_char_match (QuickFill *qf, gunichar c);
84 
97 QuickFill * gnc_quickfill_get_string_match (QuickFill *qf,
98  const char *str);
99 
103 QuickFill * gnc_quickfill_get_string_len_match (QuickFill *qf,
104  const char *str, int len);
105 
119 QuickFill * gnc_quickfill_get_unique_len_match (QuickFill *qf, int *len);
120 
122 void gnc_quickfill_insert (QuickFill *root, const char *text,
123  QuickFillSort sort_code);
124 
125 void gnc_quickfill_remove (QuickFill *root, const gchar *text,
126  QuickFillSort sort_code);
127 
130 #endif /* QUICKFILL_H */
void gnc_quickfill_insert(QuickFill *root, const char *text, QuickFillSort sort_code)
Add the string "text" to the collection of searchable strings.
Definition: QuickFill.c:229
QuickFill * gnc_quickfill_get_char_match(QuickFill *qf, gunichar c)
Return the subnode of the tree whose strings all hold &#39;wc&#39; as the next letter.
Definition: QuickFill.c:135
QuickFill * gnc_quickfill_get_string_len_match(QuickFill *qf, const char *str, int len)
Same as gnc_quickfill_get_string_match(), except that the string length is explicitly specified...
Definition: QuickFill.c:150
QuickFill * gnc_quickfill_get_string_match(QuickFill *qf, const char *str)
Return a subnode in the tree whose strings all match the string &#39;str&#39; as the next substring...
Definition: QuickFill.c:179
const char * gnc_quickfill_string(QuickFill *qf)
For the given node &#39;qf&#39;, return the best-guess matching string.
Definition: QuickFill.c:123
QuickFill * gnc_quickfill_get_unique_len_match(QuickFill *qf, int *len)
Walk a &#39;unique&#39; part of the QuickFill tree.
Definition: QuickFill.c:199