GnuCash
5.6-150-g038405b370+
|
QuickFill is meant to be used by the GUI to auto-complete (e.g. More...
Modules | |
Account Names | |
For systems with a large number of accounts (>500), the creation of the account name quickfill can take a significant amount of time (tens of seconds in bad cases). | |
Files | |
file | QuickFill.h |
QuickFill is used to auto-complete typed user entries. | |
Enumerations | |
enum | QuickFillSort { QUICKFILL_LIFO, QUICKFILL_ALPHA } |
Functions | |
QuickFill * | gnc_get_shared_address_addr2_quickfill (QofBook *book, const char *key) |
Similar to the Account Names account name quickfill, we create a cached quickfill with the address lines of all GncAddress. More... | |
QuickFill * | gnc_get_shared_address_addr3_quickfill (QofBook *book, const char *key) |
Create/fetch a quickfill GncAddress description strings on the Addr3 part. More... | |
QuickFill * | gnc_get_shared_address_addr4_quickfill (QofBook *book, const char *key) |
Create/fetch a quickfill GncAddress description strings on the Addr4 part. More... | |
QuickFill * | gnc_get_shared_entry_desc_quickfill (QofBook *book, const char *key, gboolean use_invoices) |
Similar to the Account Names account name quickfill, we create a cached quickfill with the description of all entries. More... | |
QuickFill * | gnc_quickfill_new (void) |
void | gnc_quickfill_destroy (QuickFill *qf) |
void | gnc_quickfill_purge (QuickFill *qf) |
const char * | gnc_quickfill_string (QuickFill *qf) |
For the given node 'qf', return the best-guess matching string. | |
QuickFill * | gnc_quickfill_get_char_match (QuickFill *qf, gunichar c) |
Return the subnode of the tree whose strings all hold 'c' as the next letter. More... | |
QuickFill * | gnc_quickfill_get_string_match (QuickFill *qf, const char *str) |
Return a subnode in the tree whose strings all match the string 'str' as the next substring. More... | |
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. | |
QuickFill * | gnc_quickfill_get_unique_len_match (QuickFill *qf, int *len) |
Walk a 'unique' part of the QuickFill tree. More... | |
void | gnc_quickfill_insert (QuickFill *root, const char *text, QuickFillSort sort_code) |
Add the string "text" to the collection of searchable strings. More... | |
void | gnc_quickfill_remove (QuickFill *root, const gchar *text, QuickFillSort sort_code) |
QuickFill is meant to be used by the GUI to auto-complete (e.g.
tab-complete) typed user input. QuickFill is implemented as a hierarchical tree of partial matching strings. The root of the tree contains all of the strings that user input should be matched to. Then, given a short string segment, QuickFill will return a subtree containing only those strings that start with desired substring. As additional letters are added to the substring, QuickFill will thus narrow down to the unique matching string (or to nothing if no match).
QuickFill works with national-language i18n'ed/l10n'ed multi-byte and wide-char strings, as well as plain-old C-locale strings.
QuickFill* gnc_get_shared_address_addr2_quickfill | ( | QofBook * | book, |
const char * | key | ||
) |
Similar to the Account Names account name quickfill, we create a cached quickfill with the address lines of all GncAddress.
Create/fetch a quickfill GncAddress description strings on the Addr2 part.
Multiple, distinct quickfills, for different uses, are allowed. Each is identified with the 'key'. Be sure to use distinct, unique keys that don't conflict with other users of QofBook.
This code listens to GncAddress creation events, and automatically adds new items to the quickfill list. This code also listens to the item deletion events and removes those entries from the quickfill; however, this does not yet seem to fully remove them from the GUI.
book | The book |
key | The identifier to look up the shared object in the book |
Definition at line 177 of file gnc-addr-quickfill.c.
QuickFill* gnc_get_shared_address_addr3_quickfill | ( | QofBook * | book, |
const char * | key | ||
) |
Create/fetch a quickfill GncAddress description strings on the Addr3 part.
Identical to gnc_get_shared_address_addr2_quickfill(). You should also use the same key as for the other function because the internal quickfills are updated simultaneously.
Definition at line 194 of file gnc-addr-quickfill.c.
QuickFill* gnc_get_shared_address_addr4_quickfill | ( | QofBook * | book, |
const char * | key | ||
) |
Create/fetch a quickfill GncAddress description strings on the Addr4 part.
Identical to gnc_get_shared_address_addr2_quickfill(). You should also use the same key as for the other function because the internal quickfills are updated simultaneously.
Definition at line 211 of file gnc-addr-quickfill.c.
QuickFill* gnc_get_shared_entry_desc_quickfill | ( | QofBook * | book, |
const char * | key, | ||
gboolean | use_invoices | ||
) |
Similar to the Account Names account name quickfill, we create a cached quickfill with the description of all entries.
Create/fetch a quickfill GncEntry description strings.
Multiple, distinct quickfills, for different uses, are allowed. Each is identified with the 'key'. Be sure to use distinct, unique keys that don't conflict with other users of QofBook.
This code listens to entry creation events, and automatically adds new entry's descriptions to the quickfill list. This code also listens to the entry's deletion events and removes those descriptions from the quickfill; however, this does not yet seem to fully remove them from the GUI.
book | The book |
key | The identifier to look up the shared object in the book |
use_invoices | If TRUE, this quickfill considers only the entries from GncInvoice objects. If FALSE, this quickfill considers only the entries from bills/expense vouchers. Watch out: This parameter must be identical each time the same key is used for lookup, or otherwise an assertion will fail. |
Definition at line 150 of file gnc-entry-quickfill.c.
QuickFill* gnc_quickfill_get_char_match | ( | QuickFill * | qf, |
gunichar | c | ||
) |
Return the subnode of the tree whose strings all hold 'c' as the next letter.
That is, if 'qf' holds all strings starting with the letter 'a', and we ask for the letter 'b', then this routine will return the node holding all strings that start with "ab".
The best-guess matching string can be retrieved with gnc_quickfill_string().
Definition at line 135 of file QuickFill.c.
QuickFill* gnc_quickfill_get_string_match | ( | QuickFill * | qf, |
const char * | str | ||
) |
Return a subnode in the tree whose strings all match the string 'str' as the next substring.
Thus, for example, if the argument 'qf' holds strings that start with "abc", and this routine is called with "def", then the returned node will hold strings that start with "abcdef".
The best-guess matching string can be retrieved with gnc_quickfill_string().
To convert a plain C-locale char * string to GdkWChar *, use the gnc_mbstowcs() routine.
Definition at line 179 of file QuickFill.c.
QuickFill* gnc_quickfill_get_unique_len_match | ( | QuickFill * | qf, |
int * | len | ||
) |
Walk a 'unique' part of the QuickFill tree.
This routine is typically used to assist in the tab-completion of strings. If the initial portion of the string is unique, but some later portion is not, this routine will advance to the first non-unique part of the string. If len is non-NULL, then *len will be set to the length of the unique portion of the string.
Thus, for example, if the root node contains the strings "The Book" and "The Movie", then the returned len will be 4, and the returned node will distinguish "Book" and "Movie". Thus, for example, gnc_quickfill_get_char_match(.., 'B') on the result will identify "The Book".
Definition at line 199 of file QuickFill.c.
void gnc_quickfill_insert | ( | QuickFill * | root, |
const char * | text, | ||
QuickFillSort | sort_code | ||
) |
Add the string "text" to the collection of searchable strings.
Definition at line 229 of file QuickFill.c.