]> Pileus Git - ~andy/gtk/blob - gtk/gtktreestore.h
new "model" construct property for language bindings.
[~andy/gtk] / gtk / gtktreestore.h
1 /* gtktreestore.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_STORE_H__
21 #define __GTK_TREE_STORE_H__
22
23 #include <gtk/gtktreemodel.h>
24 #include <gtk/gtktreesortable.h>
25 #include <stdarg.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 #define GTK_TYPE_TREE_STORE                     (gtk_tree_store_get_type ())
32 #define GTK_TREE_STORE(obj)                     (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_STORE, GtkTreeStore))
33 #define GTK_TREE_STORE_CLASS(klass)             (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
34 #define GTK_IS_TREE_STORE(obj)                  (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_STORE))
35 #define GTK_IS_TREE_STORE_CLASS(klass)          (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_STORE))
36 #define GTK_TREE_STORE_GET_CLASS(obj)           (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
37
38 typedef struct _GtkTreeStore       GtkTreeStore;
39 typedef struct _GtkTreeStoreClass  GtkTreeStoreClass;
40
41 struct _GtkTreeStore
42 {
43   GObject parent;
44
45   gint stamp;
46   gpointer root;
47   gpointer last;
48   gint n_columns;
49   gint sort_column_id;
50   GList *sort_list;
51   GtkSortType order;
52   GType *column_headers;
53   GtkTreeIterCompareFunc default_sort_func;
54   gpointer default_sort_data;
55   GtkDestroyNotify default_sort_destroy;
56   guint columns_dirty : 1;
57 };
58
59 struct _GtkTreeStoreClass
60 {
61   GObjectClass parent_class;
62 };
63
64
65 GtkType       gtk_tree_store_get_type         (void);
66 GtkTreeStore *gtk_tree_store_new              (gint          n_columns,
67                                                ...);
68 GtkTreeStore *gtk_tree_store_newv             (gint          n_columns,
69                                                GType        *types);
70 void          gtk_tree_store_set_column_types (GtkTreeStore *tree_store,
71                                                gint          n_columns,
72                                                GType        *types);
73 void          gtk_tree_store_set_value        (GtkTreeStore *tree_store,
74                                                GtkTreeIter  *iter,
75                                                gint          column,
76                                                GValue       *value);
77 void          gtk_tree_store_set              (GtkTreeStore *tree_store,
78                                                GtkTreeIter  *iter,
79                                                ...);
80 void          gtk_tree_store_set_valist       (GtkTreeStore *tree_store,
81                                                GtkTreeIter  *iter,
82                                                va_list       var_args);
83 void          gtk_tree_store_remove           (GtkTreeStore *tree_store,
84                                                GtkTreeIter  *iter);
85 void          gtk_tree_store_insert           (GtkTreeStore *tree_store,
86                                                GtkTreeIter  *iter,
87                                                GtkTreeIter  *parent,
88                                                gint          position);
89 void          gtk_tree_store_insert_before    (GtkTreeStore *tree_store,
90                                                GtkTreeIter  *iter,
91                                                GtkTreeIter  *parent,
92                                                GtkTreeIter  *sibling);
93 void          gtk_tree_store_insert_after     (GtkTreeStore *tree_store,
94                                                GtkTreeIter  *iter,
95                                                GtkTreeIter  *parent,
96                                                GtkTreeIter  *sibling);
97 void          gtk_tree_store_prepend          (GtkTreeStore *tree_store,
98                                                GtkTreeIter  *iter,
99                                                GtkTreeIter  *parent);
100 void          gtk_tree_store_append           (GtkTreeStore *tree_store,
101                                                GtkTreeIter  *iter,
102                                                GtkTreeIter  *parent);
103 gboolean      gtk_tree_store_is_ancestor      (GtkTreeStore *tree_store,
104                                                GtkTreeIter  *iter,
105                                                GtkTreeIter  *descendant);
106 gint          gtk_tree_store_iter_depth       (GtkTreeStore *tree_store,
107                                                GtkTreeIter  *iter);
108 void          gtk_tree_store_clear            (GtkTreeStore *tree_store);
109
110
111 #ifdef __cplusplus
112 }
113 #endif /* __cplusplus */
114
115
116 #endif /* __GTK_TREE_STORE_H__ */