2 * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GTK_TREE_MODEL_SORT_H__
21 #define __GTK_TREE_MODEL_SORT_H__
23 #include <gtk/gtktreemodel.h>
24 #include <gtk/gtktreesortable.h>
28 #endif /* __cplusplus */
30 #define GTK_TYPE_TREE_MODEL_SORT (gtk_tree_model_sort_get_type ())
31 #define GTK_TREE_MODEL_SORT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSort))
32 #define GTK_TREE_MODEL_SORT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSortClass))
33 #define GTK_IS_TREE_MODEL_SORT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_MODEL_SORT))
34 #define GTK_IS_TREE_MODEL_SORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_MODEL_SORT))
35 #define GTK_TREE_MODEL_SORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSortClass))
37 typedef struct _GtkTreeModelSort GtkTreeModelSort;
38 typedef struct _GtkTreeModelSortClass GtkTreeModelSortClass;
40 struct _GtkTreeModelSort
48 GtkTreeModel *child_model;
49 gboolean cache_child_iters;
51 /* sort information */
59 guint has_child_toggled_id;
64 GtkTreeIterCompareFunc default_sort_func;
65 gpointer default_sort_data;
66 GtkDestroyNotify default_sort_destroy;
69 struct _GtkTreeModelSortClass
71 GObjectClass parent_class;
75 GtkType gtk_tree_model_sort_get_type (void);
76 GtkTreeModel *gtk_tree_model_sort_new (void);
77 GtkTreeModel *gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model);
78 void gtk_tree_model_sort_set_model (GtkTreeModelSort *tree_model_sort,
79 GtkTreeModel *child_model);
80 GtkTreeModel *gtk_tree_model_sort_get_model (GtkTreeModelSort *tree_model);
81 GtkTreePath *gtk_tree_model_sort_convert_path (GtkTreeModelSort *tree_model_sort,
82 GtkTreePath *child_path);
83 void gtk_tree_model_sort_convert_iter (GtkTreeModelSort *tree_model_sort,
84 GtkTreeIter *sort_iter,
85 GtkTreeIter *child_iter);
89 #endif /* __cplusplus */
92 #endif /* __GTK_TREE_MODEL_SORT_H__ */