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, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_TREE_STORE_H__
19#define __GTK_TREE_STORE_H__
20
21#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22#error "Only <gtk/gtk.h> can be included directly."
23#endif
24
25#include <gdk/gdk.h>
26#include <gtk/gtktreemodel.h>
27#include <gtk/gtktreesortable.h>
28#include <stdarg.h>
29
30
31G_BEGIN_DECLS
32
33
34#define GTK_TYPE_TREE_STORE (gtk_tree_store_get_type ())
35#define GTK_TREE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_STORE, GtkTreeStore))
36#define GTK_TREE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
37#define GTK_IS_TREE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_STORE))
38#define GTK_IS_TREE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_STORE))
39#define GTK_TREE_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
40
41typedef struct _GtkTreeStore GtkTreeStore;
42typedef struct _GtkTreeStoreClass GtkTreeStoreClass;
43typedef struct _GtkTreeStorePrivate GtkTreeStorePrivate;
44
45struct _GtkTreeStore
46{
47 GObject parent;
48
49 GtkTreeStorePrivate *priv;
50};
51
52struct _GtkTreeStoreClass
53{
54 GObjectClass parent_class;
55
56 /* Padding for future expansion */
57 void (*_gtk_reserved1) (void);
58 void (*_gtk_reserved2) (void);
59 void (*_gtk_reserved3) (void);
60 void (*_gtk_reserved4) (void);
61};
62
63
64GDK_AVAILABLE_IN_ALL
65GType gtk_tree_store_get_type (void) G_GNUC_CONST;
66GDK_AVAILABLE_IN_ALL
67GtkTreeStore *gtk_tree_store_new (gint n_columns,
68 ...);
69GDK_AVAILABLE_IN_ALL
70GtkTreeStore *gtk_tree_store_newv (gint n_columns,
71 GType *types);
72GDK_AVAILABLE_IN_ALL
73void gtk_tree_store_set_column_types (GtkTreeStore *tree_store,
74 gint n_columns,
75 GType *types);
76
77/* NOTE: use gtk_tree_model_get to get values from a GtkTreeStore */
78
79GDK_AVAILABLE_IN_ALL
80void gtk_tree_store_set_value (GtkTreeStore *tree_store,
81 GtkTreeIter *iter,
82 gint column,
83 GValue *value);
84GDK_AVAILABLE_IN_ALL
85void gtk_tree_store_set (GtkTreeStore *tree_store,
86 GtkTreeIter *iter,
87 ...);
88GDK_AVAILABLE_IN_ALL
89void gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,
90 GtkTreeIter *iter,
91 gint *columns,
92 GValue *values,
93 gint n_values);
94GDK_AVAILABLE_IN_ALL
95void gtk_tree_store_set_valist (GtkTreeStore *tree_store,
96 GtkTreeIter *iter,
97 va_list var_args);
98GDK_AVAILABLE_IN_ALL
99gboolean gtk_tree_store_remove (GtkTreeStore *tree_store,
100 GtkTreeIter *iter);
101GDK_AVAILABLE_IN_ALL
102void gtk_tree_store_insert (GtkTreeStore *tree_store,
103 GtkTreeIter *iter,
104 GtkTreeIter *parent,
105 gint position);
106GDK_AVAILABLE_IN_ALL
107void gtk_tree_store_insert_before (GtkTreeStore *tree_store,
108 GtkTreeIter *iter,
109 GtkTreeIter *parent,
110 GtkTreeIter *sibling);
111GDK_AVAILABLE_IN_ALL
112void gtk_tree_store_insert_after (GtkTreeStore *tree_store,
113 GtkTreeIter *iter,
114 GtkTreeIter *parent,
115 GtkTreeIter *sibling);
116GDK_AVAILABLE_IN_ALL
117void gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
118 GtkTreeIter *iter,
119 GtkTreeIter *parent,
120 gint position,
121 ...);
122GDK_AVAILABLE_IN_ALL
123void gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
124 GtkTreeIter *iter,
125 GtkTreeIter *parent,
126 gint position,
127 gint *columns,
128 GValue *values,
129 gint n_values);
130GDK_AVAILABLE_IN_ALL
131void gtk_tree_store_prepend (GtkTreeStore *tree_store,
132 GtkTreeIter *iter,
133 GtkTreeIter *parent);
134GDK_AVAILABLE_IN_ALL
135void gtk_tree_store_append (GtkTreeStore *tree_store,
136 GtkTreeIter *iter,
137 GtkTreeIter *parent);
138GDK_AVAILABLE_IN_ALL
139gboolean gtk_tree_store_is_ancestor (GtkTreeStore *tree_store,
140 GtkTreeIter *iter,
141 GtkTreeIter *descendant);
142GDK_AVAILABLE_IN_ALL
143gint gtk_tree_store_iter_depth (GtkTreeStore *tree_store,
144 GtkTreeIter *iter);
145GDK_AVAILABLE_IN_ALL
146void gtk_tree_store_clear (GtkTreeStore *tree_store);
147GDK_AVAILABLE_IN_ALL
148gboolean gtk_tree_store_iter_is_valid (GtkTreeStore *tree_store,
149 GtkTreeIter *iter);
150GDK_AVAILABLE_IN_ALL
151void gtk_tree_store_reorder (GtkTreeStore *tree_store,
152 GtkTreeIter *parent,
153 gint *new_order);
154GDK_AVAILABLE_IN_ALL
155void gtk_tree_store_swap (GtkTreeStore *tree_store,
156 GtkTreeIter *a,
157 GtkTreeIter *b);
158GDK_AVAILABLE_IN_ALL
159void gtk_tree_store_move_before (GtkTreeStore *tree_store,
160 GtkTreeIter *iter,
161 GtkTreeIter *position);
162GDK_AVAILABLE_IN_ALL
163void gtk_tree_store_move_after (GtkTreeStore *tree_store,
164 GtkTreeIter *iter,
165 GtkTreeIter *position);
166
167
168G_END_DECLS
169
170
171#endif /* __GTK_TREE_STORE_H__ */
172