]> Pileus Git - ~andy/gtk/blob - gtk/gtktreemodelsort.h
removed set_sort_column, as it was moved to the GtkTreeSortable interface.
[~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
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #define GTK_TYPE_TREE_MODEL_SORT                        (gtk_tree_model_sort_get_type ())
30 #define GTK_TREE_MODEL_SORT(obj)                        (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSort))
31 #define GTK_TREE_MODEL_SORT_CLASS(klass)                (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSortClass))
32 #define GTK_IS_TREE_MODEL_SORT(obj)                     (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_MODEL_SORT))
33 #define GTK_IS_TREE_MODEL_SORT_CLASS(klass)             (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_MODEL_SORT))
34
35 typedef struct _GtkTreeModelSort       GtkTreeModelSort;
36 typedef struct _GtkTreeModelSortClass  GtkTreeModelSortClass;
37
38 typedef gint (* GValueCompareFunc) (const GValue *a,
39                                     const GValue *b);
40
41 struct _GtkTreeModelSort
42 {
43   GObject parent;
44
45   /* < private > */
46   gpointer root;
47   gint stamp;
48   guint flags;
49   GtkTreeModel *child_model;
50   gint sort_col;
51   GValueCompareFunc func;
52
53   guint changed_id;
54   guint inserted_id;
55   guint has_child_toggled_id;
56   guint deleted_id;
57 };
58
59 struct _GtkTreeModelSortClass
60 {
61   GObjectClass parent_class;
62 };
63
64
65 GtkType       gtk_tree_model_sort_get_type       (void);
66 GtkTreeModel *gtk_tree_model_sort_new            (void);
67 GtkTreeModel *gtk_tree_model_sort_new_with_model (GtkTreeModel      *child_model,
68                                                   GValueCompareFunc  func,
69                                                   gint               sort_col);
70 void          gtk_tree_model_sort_set_model      (GtkTreeModelSort  *tree_model_sort,
71                                                   GtkTreeModel      *child_model);
72 GtkTreeModel *gtk_tree_model_sort_get_model      (GtkTreeModelSort  *tree_model);
73 GtkTreePath  *gtk_tree_model_sort_convert_path   (GtkTreeModelSort  *tree_model_sort,
74                                                   GtkTreePath       *child_path);
75
76 /* not implemented */
77 void          gtk_tree_model_sort_convert_iter    (GtkTreeModelSort  *tree_model_sort,
78                                                    GtkTreeIter       *sort_iter,
79                                                    GtkTreeIter       *child_iter);
80
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84
85
86 #endif /* __GTK_TREE_MODEL_SORT_H__ */