|
GnuCash 2.4.99
|
00001 /********************************************************************\ 00002 * gnc-tree-view-commodity.h -- GtkTreeView implementation to * 00003 * display commodities in a GtkTreeView. * 00004 * Copyright (C) 2003,2005 David Hampton <hampton@employees.org> * 00005 * * 00006 * This program is free software; you can redistribute it and/or * 00007 * modify it under the terms of the GNU General Public License as * 00008 * published by the Free Software Foundation; either version 2 of * 00009 * the License, or (at your option) any later version. * 00010 * * 00011 * This program is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License* 00017 * along with this program; if not, contact: * 00018 * * 00019 * Free Software Foundation Voice: +1-617-542-5942 * 00020 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00021 * Boston, MA 02110-1301, USA gnu@gnu.org * 00022 * * 00023 \********************************************************************/ 00024 00034 #ifndef __GNC_TREE_VIEW_COMMODITY_H 00035 #define __GNC_TREE_VIEW_COMMODITY_H 00036 00037 #include <gtk/gtk.h> 00038 #include "gnc-tree-view.h" 00039 00040 #include "gnc-commodity.h" 00041 #include "gnc-ui-util.h" 00042 00043 G_BEGIN_DECLS 00044 00045 /* type macros */ 00046 #define GNC_TYPE_TREE_VIEW_COMMODITY (gnc_tree_view_commodity_get_type ()) 00047 #define GNC_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodity)) 00048 #define GNC_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass)) 00049 #define GNC_IS_TREE_VIEW_COMMODITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_COMMODITY)) 00050 #define GNC_IS_TREE_VIEW_COMMODITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_COMMODITY)) 00051 #define GNC_TREE_VIEW_COMMODITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityClass)) 00052 00053 /* typedefs & structures */ 00054 typedef struct 00055 { 00056 GncTreeView gnc_tree_view; 00057 int stamp; 00058 } GncTreeViewCommodity; 00059 00060 typedef struct 00061 { 00062 GncTreeViewClass gnc_tree_view; 00063 } GncTreeViewCommodityClass; 00064 00065 00066 00067 /* Get the GType for an GncTreeViewCommodity object. */ 00068 GType gnc_tree_view_commodity_get_type (void); 00069 00070 00088 GtkTreeView *gnc_tree_view_commodity_new (QofBook *book, 00089 const gchar *first_property_name, 00090 ...); 00106 void gnc_tree_view_commodity_configure_columns (GncTreeViewCommodity *view, 00107 GSList *column_names); 00108 00109 #ifdef OLD 00110 00121 void gnc_tree_view_commodity_add_kvp_column (GncTreeViewCommodity *view, 00122 const gchar *column_title, 00123 const gchar *kvp_key); 00124 #endif 00125 00131 typedef gboolean (*gnc_tree_view_commodity_ns_filter_func)(gnc_commodity_namespace*, gpointer data); 00132 typedef gboolean (*gnc_tree_view_commodity_cm_filter_func)(gnc_commodity*, gpointer data); 00133 00158 void gnc_tree_view_commodity_set_filter (GncTreeViewCommodity *view, 00159 gnc_tree_view_commodity_ns_filter_func ns_func, 00160 gnc_tree_view_commodity_cm_filter_func cm_func, 00161 gpointer data, 00162 GtkDestroyNotify destroy); 00163 00164 00175 void gnc_tree_view_commodity_refilter (GncTreeViewCommodity *view); 00190 gnc_commodity * gnc_tree_view_commodity_get_cursor_commodity (GncTreeViewCommodity *view); 00191 00192 00204 gnc_commodity * gnc_tree_view_commodity_get_selected_commodity (GncTreeViewCommodity *view); 00205 00218 void gnc_tree_view_commodity_select_subcommodities (GncTreeViewCommodity *view, 00219 gnc_commodity *commodity); 00220 00223 G_END_DECLS 00224 00225 #endif /* __GNC_TREE_VIEW_COMMODITY_H */ 00226
1.7.4