GnuCash 2.4.99
quickfillcell.h
00001 /********************************************************************\
00002  * quickfillcell.h -- autocompletion based on memorized history     *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (at your option) any later version.              *
00008  *                                                                  *
00009  * This program is distributed in the hope that it will be useful,  *
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00012  * GNU General Public License for more details.                     *
00013  *                                                                  *
00014  * You should have received a copy of the GNU General Public License*
00015  * along with this program; if not, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00020  *                                                                  *
00021 \********************************************************************/
00022 
00023 /*
00024  * FILE:
00025  * quickfillcell.h
00026  *
00027  * FUNCTION:
00028  * The QuickFillCell implements a text cell with quick-fill
00029  * capabilities.  By "quick fill" we mean a cell that will
00030  * automatically sentence-complete the entry after the user
00031  * typed a sufficient number of letters to identify a unique
00032  * entry.
00033  *
00034  * On the output side, this is just a plain text cell.
00035  *
00036  * METHODS:
00037  * The xaccSetQuickFillCellValue() method sets the
00038  * current cell value to the indicated string,
00039  * simultaneously adding the string to the quick-fill
00040  * tree.
00041  *
00042  * HISTORY:
00043  * Copyright (c) 1997, 1998 Linas Vepstas
00044  * Copyright (c) 2000 Dave Peticolas
00045  */
00046 
00047 #ifndef QUICKFILL_CELL_H
00048 #define QUICKFILL_CELL_H
00049 
00050 #include "basiccell.h"
00051 #include "QuickFill.h"
00052 
00053 typedef struct
00054 {
00055     BasicCell cell;
00056     QuickFill *qf;       /* quickfill-tree handled by this cell */
00057 
00058     QuickFillSort sort;  /* determines order of strings matched.
00059                         * default is QUICKFILL_LIFO. */
00060 
00061     char *original;  /* original string entered in original case */
00062 
00063     gboolean use_quickfill_cache;  /* If TRUE, we don't own the qf */
00064 } QuickFillCell;
00065 
00066 BasicCell *      gnc_quickfill_cell_new (void);
00067 
00068 void             gnc_quickfill_cell_set_value (QuickFillCell *cell,
00069         const char *value);
00070 
00071 void             gnc_quickfill_cell_set_sort (QuickFillCell *cell,
00072         QuickFillSort sort);
00073 
00074 void             gnc_quickfill_cell_add_completion (QuickFillCell *cell,
00075         const char *completion);
00076 
00080 void
00081 gnc_quickfill_cell_use_quickfill_cache (QuickFillCell *cell, QuickFill *shared_qf);
00082 
00083 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines