GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnucash-item-list.h
1 /********************************************************************\
2  * gnucash-item-list.h -- A scrollable list box *
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 #ifndef GNUCASH_ITEM_LIST_H
24 #define GNUCASH_ITEM_LIST_H
25 
26 #include <libgnomecanvas/libgnomecanvas.h>
27 
28 #define GNC_TYPE_ITEM_LIST (gnc_item_list_get_type ())
29 #define GNC_ITEM_LIST(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_ITEM_LIST, GncItemList))
30 #define GNC_ITEM_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_ITEM_LIST, GncItemListClass))
31 #define IS_GNC_ITEM_LIST(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_ITEM_LIST))
32 
33 typedef struct
34 {
35  GnomeCanvasWidget canvas_widget;
36 
37  GtkTreeView *tree_view;
38  GtkListStore *list_store; /* Contains the list items */
39  GtkWidget *frame; /* frame around everything */
40 } GncItemList;
41 
42 typedef struct
43 {
44  GnomeCanvasWidgetClass parent_class;
45 
46  void (*select_item) (GncItemList *item_list,
47  char *item_string);
48 
49  void (*change_item) (GncItemList *item_list,
50  char *item_string);
51 
52  void (*activate_item) (GncItemList *item_list,
53  char *item_string);
54 
55  void (*key_press_event) (GncItemList *item_list,
56  GdkEventKey *event);
57 
59 
60 
61 GType gnc_item_list_get_type (void);
62 
63 GnomeCanvasItem *gnc_item_list_new (GnomeCanvasGroup *parent, GtkListStore *shared_store);
64 
65 gint gnc_item_list_num_entries (GncItemList *item_list);
66 
67 void gnc_item_list_clear (GncItemList *item_list);
68 
69 void gnc_item_list_append (GncItemList *item_list, const char *string);
70 
71 void gnc_item_list_set_sort_enabled(GncItemList *item_list, gboolean enabled);
72 
73 gboolean gnc_item_in_list (GncItemList *item_list, const char *string);
74 
75 void gnc_item_list_select (GncItemList *item_list, const char *string);
76 
77 void gnc_item_list_show_selected (GncItemList *item_list);
78 
79 int gnc_item_list_autosize (GncItemList *item_list);
80 
81 
82 
83 #endif /* GNUCASH_ITEM_LIST_H */
84 
85