]> Pileus Git - ~andy/gtk/blob - gtk/gtktreestore.h
ba4265289bcd936495627d46b3b68b683714d005
[~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
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #define GTK_TYPE_TREE_STORE                     (gtk_tree_store_get_type ())
30 #define GTK_TREE_STORE(obj)                     (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_STORE, GtkTreeStore))
31 #define GTK_TREE_STORE_CLASS(klass)             (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
32 #define GTK_IS_TREE_STORE(obj)                  (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_STORE))
33 #define GTK_IS_TREE_STORE_CLASS(klass)          (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_STORE))
34
35 typedef struct _GtkTreeStore       GtkTreeStore;
36 typedef struct _GtkTreeStoreClass  GtkTreeStoreClass;
37
38 struct _GtkTreeStore
39 {
40   GtkObject parent;
41   GtkTreeNode root;
42   gint n_columns;
43   GType *column_headers;
44 };
45
46 struct _GtkTreeStoreClass
47 {
48   GtkObjectClass parent_class;
49
50   /* signals */
51   /* Will be moved into the GtkTreeModelIface eventually */
52   void       (* node_changed)         (GtkTreeModel *tree_model,
53                                        GtkTreePath  *path,
54                                        GtkTreeNode   node);
55   void       (* node_inserted)        (GtkTreeModel *tree_model,
56                                        GtkTreePath  *path,
57                                        GtkTreeNode   node);
58   void       (* node_child_toggled)   (GtkTreeModel *tree_model,
59                                        GtkTreePath  *path,
60                                        GtkTreeNode   node);
61   void       (* node_deleted)         (GtkTreeModel *tree_model,
62                                        GtkTreePath  *path);
63 };
64
65
66 GtkType      gtk_tree_store_get_type           (void);
67 GtkObject   *gtk_tree_store_new                (void);
68 GtkObject   *gtk_tree_store_new_with_values    (gint          n_columns,
69                                                 ...);
70 void         gtk_tree_store_set_n_columns      (GtkTreeStore *tree_store,
71                                                 gint          n_columns);
72 void         gtk_tree_store_set_column_type    (GtkTreeStore *store,
73                                                 gint          column,
74                                                 GType         type);
75
76 GtkTreeNode  gtk_tree_store_node_new           (void);
77 void         gtk_tree_store_node_set_cell      (GtkTreeStore *tree_store,
78                                                 GtkTreeNode   node,
79                                                 gint          column,
80                                                 GValue       *value);
81 void         gtk_tree_store_node_remove        (GtkTreeStore *tree_store,
82                                                 GtkTreeNode   node);
83 GtkTreeNode  gtk_tree_store_node_insert        (GtkTreeStore *tree_store,
84                                                 GtkTreeNode   parent,
85                                                 gint          position,
86                                                 GtkTreeNode   node);
87 GtkTreeNode  gtk_tree_store_node_insert_before (GtkTreeStore *tree_store,
88                                                 GtkTreeNode   parent,
89                                                 GtkTreeNode   sibling,
90                                                 GtkTreeNode   node);
91 GtkTreeNode  gtk_tree_store_node_insert_after  (GtkTreeStore *tree_store,
92                                                 GtkTreeNode   parent,
93                                                 GtkTreeNode   sibling,
94                                                 GtkTreeNode   node);
95 GtkTreeNode  gtk_tree_store_node_prepend       (GtkTreeStore *tree_store,
96                                                 GtkTreeNode   parent,
97                                                 GtkTreeNode   node);
98 GtkTreeNode  gtk_tree_store_node_append        (GtkTreeStore *tree_store,
99                                                 GtkTreeNode   parent,
100                                                 GtkTreeNode   node);
101 GtkTreeNode  gtk_tree_store_node_get_root      (GtkTreeStore *tree_store);
102 gboolean     gtk_tree_store_node_is_ancestor   (GtkTreeStore *tree_store,
103                                                 GtkTreeNode   node,
104                                                 GtkTreeNode   descendant);
105 gint         gtk_tree_store_node_depth         (GtkTreeStore *tree_store,
106                                                 GtkTreeNode   node);
107
108
109
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113
114
115 #endif /* __GTK_TREE_STORE_H__ */