GnuCash c935c2f+
Loading...
Searching...
No Matches
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 <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_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
43G_BEGIN_DECLS
44
45/* type macros */
46#define GNC_TYPE_TREE_VIEW_COMMODITY (gnc_tree_view_commodity_get_type ())
47G_DECLARE_FINAL_TYPE (GncTreeViewCommodity, gnc_tree_view_commodity, GNC, TREE_VIEW_COMMODITY, GncTreeView)
48
49
66GtkTreeView *gnc_tree_view_commodity_new (QofBook *book,
67 const gchar *first_property_name,
68 ...);
84void gnc_tree_view_commodity_configure_columns (GncTreeViewCommodity *view,
85 GSList *column_names);
86
87#ifdef OLD
99void gnc_tree_view_commodity_add_kvp_column (GncTreeViewCommodity *view,
100 const gchar *column_title,
101 const gchar *kvp_key);
102#endif
109typedef gboolean (*gnc_tree_view_commodity_ns_filter_func)(gnc_commodity_namespace*, gpointer data);
110typedef gboolean (*gnc_tree_view_commodity_cm_filter_func)(gnc_commodity*, gpointer data);
111
136void gnc_tree_view_commodity_set_filter (GncTreeViewCommodity *view,
137 gnc_tree_view_commodity_ns_filter_func ns_func,
138 gnc_tree_view_commodity_cm_filter_func cm_func,
139 gpointer data,
140 GDestroyNotify destroy);
141
142
153void gnc_tree_view_commodity_refilter (GncTreeViewCommodity *view);
168gnc_commodity * gnc_tree_view_commodity_get_cursor_commodity (GncTreeViewCommodity *view);
169
170
182gnc_commodity * gnc_tree_view_commodity_get_selected_commodity (GncTreeViewCommodity *view);
183
184
195gnc_commodity_namespace * gnc_tree_view_commodity_get_selected_namespace (GncTreeViewCommodity *view);
196
197
204void gnc_tree_view_commodity_select_commodity (GncTreeViewCommodity *view, gnc_commodity *commodity);
205
206
219void gnc_tree_view_commodity_select_subcommodities (GncTreeViewCommodity *view,
220 gnc_commodity *commodity);
221
224G_END_DECLS
225
226#endif /* __GNC_TREE_VIEW_COMMODITY_H */
227
Commodity handling public routines.
common utilities for manipulating a GtkTreeView within gnucash
utility functions for the GnuCash UI
void gnc_tree_view_commodity_configure_columns(GncTreeViewCommodity *view, GSList *column_names)
Configure (by name) the set of visible columns in an commodity tree view.
gnc_commodity * gnc_tree_view_commodity_get_selected_commodity(GncTreeViewCommodity *view)
This function returns the commodity associated with the selected item in the commodity tree view.
void gnc_tree_view_commodity_refilter(GncTreeViewCommodity *view)
This function forces the commodity tree filter to be evaluated.
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)
This function attaches a filter function to the given commodity tree.
GtkTreeView * gnc_tree_view_commodity_new(QofBook *book, const gchar *first_property_name,...)
Create a new commodity tree view.
gnc_commodity * gnc_tree_view_commodity_get_cursor_commodity(GncTreeViewCommodity *view)
This function returns the commodity in the commodity tree view at the current location of the cursor.
void gnc_tree_view_commodity_select_subcommodities(GncTreeViewCommodity *view, gnc_commodity *commodity)
This function selects all sub-commodities of an commodity in the commodity tree view.
void gnc_tree_view_commodity_select_commodity(GncTreeViewCommodity *view, gnc_commodity *commodity)
Select the commodity in the associated commodity tree view.
gnc_commodity_namespace * gnc_tree_view_commodity_get_selected_namespace(GncTreeViewCommodity *view)
This function returns the namespace associated with the selected item in the commodity tree view.
QofBook reference.
Definition qofbook-p.hpp:47