/usr/include/gnucash/gnc-tree-view-owner.h is in gnucash-common 1:2.6.15-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | /********************************************************************\
* gnc-tree-view-owner.h -- GtkTreeView implementation to display *
* owners in a GtkTreeView. *
* Copyright (C) 2011 Geert Janssens <geert@kobaltwit.be> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
* *
\********************************************************************/
/** @addtogroup GUI
@{ */
/** @addtogroup GuiTreeModel
* @{ */
/** @file gnc-tree-view-owner.h
@brief GtkTreeView implementation for gnucash owner tree.
@author Copyright (C) 2003,2005,2006 David Hampton <hampton@employees.org>
*/
#ifndef __GNC_TREE_VIEW_OWNER_H
#define __GNC_TREE_VIEW_OWNER_H
#include <gtk/gtk.h>
#include "gncOwner.h"
#include "gnc-tree-view.h"
#include "gnc-ui-util.h"
#include "gnc-plugin-page.h"
G_BEGIN_DECLS
/* type macros */
#define GNC_TYPE_TREE_VIEW_OWNER (gnc_tree_view_owner_get_type ())
#define GNC_TREE_VIEW_OWNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_OWNER, GncTreeViewOwner))
#define GNC_TREE_VIEW_OWNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_OWNER, GncTreeViewOwnerClass))
#define GNC_IS_TREE_VIEW_OWNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_OWNER))
#define GNC_IS_TREE_VIEW_OWNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_OWNER))
#define GNC_TREE_VIEW_OWNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_OWNER, GncTreeViewOwnerClass))
#define GNC_TREE_VIEW_OWNER_NAME "GncTreeViewOwner"
/* typedefs & structures */
typedef struct OwnerViewInfo_s OwnerViewInfo;
struct OwnerViewInfo_s
{
gboolean show_inactive;
};
typedef struct
{
GncTreeView gnc_tree_view;
int stamp;
} GncTreeViewOwner;
typedef struct
{
GncTreeViewClass gnc_tree_view;
} GncTreeViewOwnerClass;
typedef struct
{
GtkWidget *dialog;
GncTreeViewOwner *tree_view;
gboolean show_inactive;
gboolean original_show_inactive;
gboolean show_zero_total;
gboolean original_show_zero_total;
} OwnerFilterDialog;
#define GNC_OWNER_TREE_NAME_COL "name"
#define GNC_OWNER_TREE_TYPE_COL "type"
#define GNC_OWNER_TREE_ID_COL "owner-id"
#define GNC_OWNER_TREE_CURRENCY_COL "currency"
#define GNC_OWNER_TREE_ADDRESS_NAME_COL "address-name"
#define GNC_OWNER_TREE_ADDRESS_1_COL "address-1"
#define GNC_OWNER_TREE_ADDRESS_2_COL "address-2"
#define GNC_OWNER_TREE_ADDRESS_3_COL "address-3"
#define GNC_OWNER_TREE_ADDRESS_4_COL "address-4"
#define GNC_OWNER_TREE_PHONE_COL "phone"
#define GNC_OWNER_TREE_FAX_COL "fax"
#define GNC_OWNER_TREE_EMAIL_COL "email"
#define GNC_OWNER_TREE_BALANCE_COL "balance"
#define GNC_OWNER_TREE_BALANCE_REPORT_COL "balance-report"
#define GNC_OWNER_TREE_BALANCE_PERIOD_COL "balance-period"
#define GNC_OWNER_TREE_NOTES_COL "notes"
#define GNC_OWNER_TREE_ACTIVE_COL "active"
void owner_filter_dialog_create(OwnerFilterDialog *fd,
GncPluginPage *page);
gboolean gnc_plugin_page_owner_tree_filter_owners (GncOwner *owner,
gpointer user_data);
/* "Filter By" dialog callbacks */
void gppot_filter_show_inactive_toggled_cb (GtkToggleButton *togglebutton,
OwnerFilterDialog *fd);
void gppot_filter_show_zero_toggled_cb (GtkToggleButton *togglebutton,
OwnerFilterDialog *fd);
void gppot_filter_response_cb (GtkWidget *dialog, gint response,
OwnerFilterDialog *fd);
/* Saving/Restoring */
void gnc_tree_view_owner_save(GncTreeViewOwner *tree_view,
OwnerFilterDialog *fd,
GKeyFile *key_file, const gchar *group_name);
void gnc_tree_view_owner_restore(GncTreeViewOwner *view,
OwnerFilterDialog *fd,
GKeyFile *key_file,
const gchar *group_name,
GncOwnerType owner_type);
/* Get the GType for an GncTreeViewOwner object. */
GType gnc_tree_view_owner_get_type (void);
/** @name Owner Tree View Constructor
@{ */
/** Create a new owner tree view for one type of owners.
*
* @param owner_type The type of owners to use in the view.
*
* @return A pointer to a new owner tree view.
*/
GtkTreeView *gnc_tree_view_owner_new (GncOwnerType owner_type);
/** @} */
/** @name Owner Tree View Configuration
@{ */
typedef gchar * (*GncTreeViewOwnerColumnSource) (GncOwner *owner,
GtkTreeViewColumn *col,
GtkCellRenderer *cell);
typedef void (*GncTreeViewOwnerColumnTextEdited) (GncOwner *owner,
GtkTreeViewColumn *col,
const gchar *new_text);
/** @} */
/** @name Owner Tree View Filtering
@{ */
/** This is the description of a filter function used by the owner tree.
*
* @param owner The owner to be tested.
*
* @param data The data provided when the filter function was added.
*
* @return TRUE if the owner should be displayed.
*/
typedef gboolean (*gnc_tree_view_owner_filter_func)(GncOwner *owner, gpointer data);
/** This function attaches a filter function to the given owner
* tree. This function will be called for each owner that the view
* thinks should possibly show. The filter may perform any actions
* necessary on the owner to decide whether it should be shown or
* not. (I.E. Check type, placeholder status, etc.) If the filter
* returns TRUE then the owner will be displayed.
*
* @param owner_view A pointer to an owner tree view.
*
* @param func A filtration function that is called on individual
* elements in the tree. If this function returns TRUE, the owner
* will be displayed.
*
* @param data A data block passed into each instance of the function.
*
* @param destroy A function to destroy the data block. This
* function will be called when the filter is destroyed. may be
* NULL.
*/
void gnc_tree_view_owner_set_filter (GncTreeViewOwner *owner_view,
gnc_tree_view_owner_filter_func func,
gpointer data,
GSourceFunc destroy);
/** This function forces the owner tree filter to be evaluated. It
* may be necessary to call this function if the initial state of the
* view is incorrect. This appears to only be necessary if the
* filter affects one of the top level owners in gnucash.
*
* @note This calls a function in gtk that is annotated in the
* sources as being slow. You have been warned.
*
* @param view A pointer to an owner tree view.
*/
void gnc_tree_view_owner_refilter (GncTreeViewOwner *view);
/** @} */
/** @name Owner Tree View Get/Set Functions
@{ */
/** This function returns the owner associated with the specified
* path. This function is useful in selection callbacks on an
* owner tree widget.
*
* @param view A pointer to an owner tree view.
*
* @param path A path specifying a node in the owner tree.
*
* @return The owner associated with this path.
*/
GncOwner * gnc_tree_view_owner_get_owner_from_path (GncTreeViewOwner *view,
GtkTreePath *path);
/** This function returns the owner associated with the specified
* iter. This function is useful in selection callbacks on an
* owner tree widget.
*
* @param model The model provided to the callback function.
*
* @param iter The iter provided to the callback function.
*
* @return The owner associated with this iter.
*/
GncOwner * gnc_tree_view_owner_get_owner_from_iter (GtkTreeModel *model,
GtkTreeIter *iter);
/** This function returns the owner associated with the selected
* item in the owner tree view.
*
* @note It only makes sense to call this function when the owner
* tree is set to select a single item. There is a different
* function to use when the tree supports multiple selections.
*
* @param view A pointer to an owner tree view.
*
* @return The selected owner, or NULL if no owner was selected.
*/
GncOwner * gnc_tree_view_owner_get_selected_owner (GncTreeViewOwner *view);
/** This function selects an owner in the owner tree view. All
* other owners will be unselected. In addition, this function
* collapses the entitre tree and then expands only the path to the
* selected owner, making the item easy to find. In general, this
* routine only need be called when initially putting up a window
* containing an owner tree view widget.
*
* @note It only makes sense to call this function when the owner
* tree is set to select a single item. There is a different
* function to use when the tree supports multiple selections.
*
* @param view A pointer to an owner tree view.
*
* @param owner A pointer to the owner to select.
*/
void gnc_tree_view_owner_set_selected_owner (GncTreeViewOwner *view,
GncOwner *owner);
G_END_DECLS
#endif /* __GNC_TREE_VIEW_OWNER_H */
|