GnuCash  5.6-150-g038405b370+
gnc-tree-view-price.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-tree-view-price.h -- GtkTreeView implementation to display *
3  * prices in a GtkTreeView. *
4  * Copyright (C) 2003,2005 David Hampton <hampton@employees.org> *
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 gnu@gnu.org *
22  * *
23 \********************************************************************/
24 
34 #ifndef __GNC_TREE_VIEW_PRICE_H
35 #define __GNC_TREE_VIEW_PRICE_H
36 
37 #include <gtk/gtk.h>
38 #include "gnc-tree-view.h"
39 
40 #include "gnc-pricedb.h"
41 #include "gnc-ui-util.h"
42 
43 G_BEGIN_DECLS
44 
45 /* type macros */
46 #define GNC_TYPE_TREE_VIEW_PRICE (gnc_tree_view_price_get_type ())
47 G_DECLARE_FINAL_TYPE (GncTreeViewPrice, gnc_tree_view_price, GNC, TREE_VIEW_PRICE, GncTreeView)
48 
49 
66 GtkTreeView *gnc_tree_view_price_new (QofBook *book,
67  const gchar *first_property_name,
68  ...);
75 #ifdef OLD
76 
87 void gnc_tree_view_price_add_kvp_column (GncTreeViewPrice *view,
88  const gchar *column_title,
89  const gchar *kvp_key);
90 #endif
91 
116 typedef gboolean (*gnc_tree_view_price_ns_filter_func)(gnc_commodity_namespace*, gpointer data);
117 typedef gboolean (*gnc_tree_view_price_cm_filter_func)(gnc_commodity *, gpointer data);
118 typedef gboolean (*gnc_tree_view_price_pc_filter_func)(GNCPrice *, gpointer data);
119 void gnc_tree_view_price_set_filter (GncTreeViewPrice *view,
121  gnc_tree_view_price_cm_filter_func cm_func,
122  gnc_tree_view_price_pc_filter_func pc_func,
123  gpointer data,
124  GDestroyNotify destroy);
139 GNCPrice * gnc_tree_view_price_get_cursor_price (GncTreeViewPrice *view);
140 
141 
153 GNCPrice * gnc_tree_view_price_get_selected_price (GncTreeViewPrice *view);
154 
155 
171 void gnc_tree_view_price_set_selected_price (GncTreeViewPrice *view,
172  GNCPrice *price);
173 
174 
186 GList * gnc_tree_view_price_get_selected_prices (GncTreeViewPrice *view);
187 
188 
200 GList * gnc_tree_view_price_get_selected_commodities (GncTreeViewPrice *view);
201 
204 G_END_DECLS
205 
206 #endif /* __GNC_TREE_VIEW_PRICE_H */
207 
a simple price database for gnucash
utility functions for the GnuCash UI
gboolean(* gnc_tree_view_price_ns_filter_func)(gnc_commodity_namespace *, gpointer data)
This function attaches a filter function to the given price tree.
common utilities for manipulating a GtkTreeView within gnucash
GNCPrice * gnc_tree_view_price_get_selected_price(GncTreeViewPrice *view)
This function returns the price associated with the selected item in the price tree view...
GList * gnc_tree_view_price_get_selected_commodities(GncTreeViewPrice *view)
This function returns a list of commodities associated with the selected rows that are not prices but...
GList * gnc_tree_view_price_get_selected_prices(GncTreeViewPrice *view)
This function returns a list of the prices associated with the selected items in the price tree view...
void gnc_tree_view_price_set_selected_price(GncTreeViewPrice *view, GNCPrice *price)
This function selects an price in the price tree view.
GNCPrice * gnc_tree_view_price_get_cursor_price(GncTreeViewPrice *view)
This function returns the price in the price tree view at the current location of the cursor...
GtkTreeView * gnc_tree_view_price_new(QofBook *book, const gchar *first_property_name,...)
Create a new price tree view.