1 | /* gtktreemodelfilter.h |
2 | * Copyright (C) 2000,2001 Red Hat, Inc., Jonathan Blandford <[email protected]> |
3 | * Copyright (C) 2001-2003 Kristian Rietveld <[email protected]> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Library General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Library General Public |
16 | * License along with this library; if not, write to the |
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | * Boston, MA 02111-1307, USA. |
19 | */ |
20 | |
21 | #ifndef __GTK_TREE_MODEL_FILTER_H__ |
22 | #define __GTK_TREE_MODEL_FILTER_H__ |
23 | |
24 | #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
25 | #error "Only <gtk/gtk.h> can be included directly." |
26 | #endif |
27 | |
28 | #include <gdkconfig.h> |
29 | #include <gtk/gtktreemodel.h> |
30 | |
31 | G_BEGIN_DECLS |
32 | |
33 | #define GTK_TYPE_TREE_MODEL_FILTER (gtk_tree_model_filter_get_type ()) |
34 | #define GTK_TREE_MODEL_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_MODEL_FILTER, GtkTreeModelFilter)) |
35 | #define GTK_TREE_MODEL_FILTER_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_TREE_MODEL_FILTER, GtkTreeModelFilterClass)) |
36 | #define GTK_IS_TREE_MODEL_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_MODEL_FILTER)) |
37 | #define GTK_IS_TREE_MODEL_FILTER_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_TREE_MODEL_FILTER)) |
38 | #define GTK_TREE_MODEL_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_MODEL_FILTER, GtkTreeModelFilterClass)) |
39 | |
40 | typedef gboolean (* GtkTreeModelFilterVisibleFunc) (GtkTreeModel *model, |
41 | GtkTreeIter *iter, |
42 | gpointer data); |
43 | typedef void (* GtkTreeModelFilterModifyFunc) (GtkTreeModel *model, |
44 | GtkTreeIter *iter, |
45 | GValue *value, |
46 | gint column, |
47 | gpointer data); |
48 | |
49 | typedef struct _GtkTreeModelFilter GtkTreeModelFilter; |
50 | typedef struct _GtkTreeModelFilterClass GtkTreeModelFilterClass; |
51 | typedef struct _GtkTreeModelFilterPrivate GtkTreeModelFilterPrivate; |
52 | |
53 | struct _GtkTreeModelFilter |
54 | { |
55 | GObject parent; |
56 | |
57 | /*< private >*/ |
58 | GtkTreeModelFilterPrivate *GSEAL (priv); |
59 | }; |
60 | |
61 | struct _GtkTreeModelFilterClass |
62 | { |
63 | GObjectClass parent_class; |
64 | |
65 | /* Padding for future expansion */ |
66 | void (*_gtk_reserved0) (void); |
67 | void (*_gtk_reserved1) (void); |
68 | void (*_gtk_reserved2) (void); |
69 | void (*_gtk_reserved3) (void); |
70 | }; |
71 | |
72 | /* base */ |
73 | GType gtk_tree_model_filter_get_type (void) G_GNUC_CONST; |
74 | GtkTreeModel *gtk_tree_model_filter_new (GtkTreeModel *child_model, |
75 | GtkTreePath *root); |
76 | void gtk_tree_model_filter_set_visible_func (GtkTreeModelFilter *filter, |
77 | GtkTreeModelFilterVisibleFunc func, |
78 | gpointer data, |
79 | GDestroyNotify destroy); |
80 | void gtk_tree_model_filter_set_modify_func (GtkTreeModelFilter *filter, |
81 | gint n_columns, |
82 | GType *types, |
83 | GtkTreeModelFilterModifyFunc func, |
84 | gpointer data, |
85 | GDestroyNotify destroy); |
86 | void gtk_tree_model_filter_set_visible_column (GtkTreeModelFilter *filter, |
87 | gint column); |
88 | |
89 | GtkTreeModel *gtk_tree_model_filter_get_model (GtkTreeModelFilter *filter); |
90 | |
91 | /* conversion */ |
92 | gboolean gtk_tree_model_filter_convert_child_iter_to_iter (GtkTreeModelFilter *filter, |
93 | GtkTreeIter *filter_iter, |
94 | GtkTreeIter *child_iter); |
95 | void gtk_tree_model_filter_convert_iter_to_child_iter (GtkTreeModelFilter *filter, |
96 | GtkTreeIter *child_iter, |
97 | GtkTreeIter *filter_iter); |
98 | GtkTreePath *gtk_tree_model_filter_convert_child_path_to_path (GtkTreeModelFilter *filter, |
99 | GtkTreePath *child_path); |
100 | GtkTreePath *gtk_tree_model_filter_convert_path_to_child_path (GtkTreeModelFilter *filter, |
101 | GtkTreePath *filter_path); |
102 | |
103 | /* extras */ |
104 | void gtk_tree_model_filter_refilter (GtkTreeModelFilter *filter); |
105 | void gtk_tree_model_filter_clear_cache (GtkTreeModelFilter *filter); |
106 | |
107 | G_END_DECLS |
108 | |
109 | #endif /* __GTK_TREE_MODEL_FILTER_H__ */ |
110 | |