GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-tree-view-commodity.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-tree-view-commodity.h -- GtkTreeView implementation to *
3  * display commodities in a GtkTreeView. *
4  * Copyright (C) 2003,2005 David Hampton <[email protected]> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA [email protected] *
22  * *
23 \********************************************************************/
24 
34 #ifndef __GNC_TREE_VIEW_COMMODITY_H
35 #define __GNC_TREE_VIEW_COMMODITY_H
36 
37 #include <gtk/gtk.h>
38 #include "gnc-tree-view.h"
39 
40 #include "gnc-commodity.h"
41 #include "gnc-ui-util.h"
42 
43 G_BEGIN_DECLS
44 
45 /* type macros */
46 #define GNC_TYPE_TREE_VIEW_COMMODITY (gnc_tree_view_commodity_get_type ())
47 #define GNC_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodity))
48 #define GNC_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass))
49 #define GNC_IS_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_COMMODITY))
50 #define GNC_IS_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_COMMODITY))
51 #define GNC_TREE_VIEW_COMMODITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass))
52 
53 /* typedefs & structures */
54 typedef struct
55 {
56  GncTreeView gnc_tree_view;
57  int stamp;
59 
60 typedef struct
61 {
62  GncTreeViewClass gnc_tree_view;
64 
65 
66 
67 /* Get the GType for an GncTreeViewCommodity object. */
68 GType gnc_tree_view_commodity_get_type (void);
69 
70 
88 GtkTreeView *gnc_tree_view_commodity_new (QofBook *book,
89  const gchar *first_property_name,
90  ...);
107  GSList *column_names);
108 
109 #ifdef OLD
110 
121 void gnc_tree_view_commodity_add_kvp_column (GncTreeViewCommodity *view,
122  const gchar *column_title,
123  const gchar *kvp_key);
124 #endif
125 
131 typedef gboolean (*gnc_tree_view_commodity_ns_filter_func)(gnc_commodity_namespace*, gpointer data);
132 typedef gboolean (*gnc_tree_view_commodity_cm_filter_func)(gnc_commodity*, gpointer data);
133 
159  gnc_tree_view_commodity_ns_filter_func ns_func,
160  gnc_tree_view_commodity_cm_filter_func cm_func,
161  gpointer data,
162  GDestroyNotify destroy);
163 
164 
191 
192 
205 
219  gnc_commodity *commodity);
220 
223 G_END_DECLS
224 
225 #endif /* __GNC_TREE_VIEW_COMMODITY_H */
226 
GtkTreeView * gnc_tree_view_commodity_new(QofBook *book, const gchar *first_property_name,...)
void gnc_tree_view_commodity_set_filter(GncTreeViewCommodity *view, gnc_tree_view_commodity_ns_filter_func ns_func, gnc_tree_view_commodity_cm_filter_func cm_func, gpointer data, GDestroyNotify destroy)
utility functions for the GnuCash UI
common utilities for manipulating a GtkTreeView within gnucash
void gnc_tree_view_commodity_configure_columns(GncTreeViewCommodity *view, GSList *column_names)
void gnc_tree_view_commodity_select_subcommodities(GncTreeViewCommodity *view, gnc_commodity *commodity)
gnc_commodity * gnc_tree_view_commodity_get_selected_commodity(GncTreeViewCommodity *view)
void gnc_tree_view_commodity_refilter(GncTreeViewCommodity *view)
gnc_commodity * gnc_tree_view_commodity_get_cursor_commodity(GncTreeViewCommodity *view)
Commodity handling public routines.