]> Pileus Git - ~andy/gtk/blob - gtk/gtktreemodelsort.h
preparation for surgery ditto
[~andy/gtk] / gtk / gtktreemodelsort.h
1 /* gtktreemodelsort.h
2  * Copyright (C) 2000  Red Hat, Inc.,  Jonathan Blandford <jrb@redhat.com>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #ifndef __GTK_TREE_MODEL_SORT_H__
21 #define __GTK_TREE_MODEL_SORT_H__
22
23 #include <gtk/gtktreemodel.h>
24 #include <gtk/gtktreesortable.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
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))
36
37 typedef struct _GtkTreeModelSort       GtkTreeModelSort;
38 typedef struct _GtkTreeModelSortClass  GtkTreeModelSortClass;
39
40 struct _GtkTreeModelSort
41 {
42   GObject parent;
43
44   /* < private > */
45   gpointer root;
46   gint stamp;
47   guint flags;
48   GtkTreeModel *child_model;
49   gboolean cache_child_iters;
50
51   /* sort information */
52   GList *sort_list;
53   gint sort_column_id;
54   GtkSortType order;
55
56   /* signal ids */
57   guint changed_id;
58   guint inserted_id;
59   guint has_child_toggled_id;
60   guint deleted_id;
61   guint reordered_id;
62
63   /* default sort */
64   GtkTreeIterCompareFunc default_sort_func;
65   gpointer default_sort_data;
66   GtkDestroyNotify default_sort_destroy;
67 };
68
69 struct _GtkTreeModelSortClass
70 {
71   GObjectClass parent_class;
72 };
73
74
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);
86
87 #ifdef __cplusplus
88 }
89 #endif /* __cplusplus */
90
91
92 #endif /* __GTK_TREE_MODEL_SORT_H__ */