]> Pileus Git - ~andy/gtk/blob - gtk/gtktreestore.h
Added patch from Jeff Franks <jcf@tpg.com.au> to add GET_CLASS macros to
[~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   GtkTreeSortOrder order;
52   GType *column_headers;
53 };
54
55 struct _GtkTreeStoreClass
56 {
57   GObjectClass parent_class;
58 };
59
60
61 GtkType       gtk_tree_store_get_type        (void);
62 GtkTreeStore *gtk_tree_store_new             (void);
63
64 GtkTreeStore *gtk_tree_store_new_with_types  (gint          n_columns,
65                                               ...);
66 void          gtk_tree_store_set_n_columns   (GtkTreeStore *tree_store,
67                                               gint          n_columns);
68 void          gtk_tree_store_set_column_type (GtkTreeStore *tree_store,
69                                               gint          column,
70                                               GType         type);
71 void          gtk_tree_store_set_value       (GtkTreeStore *tree_store,
72                                               GtkTreeIter  *iter,
73                                               gint          column,
74                                               GValue       *value);
75 void          gtk_tree_store_set             (GtkTreeStore *tree_store,
76                                               GtkTreeIter  *iter,
77                                               ...);
78 void          gtk_tree_store_set_valist      (GtkTreeStore *tree_store,
79                                               GtkTreeIter  *iter,
80                                               va_list       var_args);
81 void          gtk_tree_store_remove          (GtkTreeStore *tree_store,
82                                               GtkTreeIter  *iter);
83 void          gtk_tree_store_insert          (GtkTreeStore *tree_store,
84                                               GtkTreeIter  *iter,
85                                               GtkTreeIter  *parent,
86                                               gint          position);
87 void          gtk_tree_store_insert_before   (GtkTreeStore *tree_store,
88                                               GtkTreeIter  *iter,
89                                               GtkTreeIter  *parent,
90                                               GtkTreeIter  *sibling);
91 void          gtk_tree_store_insert_after    (GtkTreeStore *tree_store,
92                                               GtkTreeIter  *iter,
93                                               GtkTreeIter  *parent,
94                                               GtkTreeIter  *sibling);
95 void          gtk_tree_store_prepend         (GtkTreeStore *tree_store,
96                                               GtkTreeIter  *iter,
97                                               GtkTreeIter  *parent);
98 void          gtk_tree_store_append          (GtkTreeStore *tree_store,
99                                               GtkTreeIter  *iter,
100                                               GtkTreeIter  *parent);
101 gboolean      gtk_tree_store_is_ancestor     (GtkTreeStore *tree_store,
102                                               GtkTreeIter  *iter,
103                                               GtkTreeIter  *descendant);
104 gint          gtk_tree_store_iter_depth      (GtkTreeStore *tree_store,
105                                               GtkTreeIter  *iter);
106
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112
113 #endif /* __GTK_TREE_STORE_H__ */