]> Pileus Git - ~andy/gtk/blob - gtk/gtkliststore.h
removed gtk_*_store_get, and moved to GtkTreeModel.
[~andy/gtk] / gtk / gtkliststore.h
1 /* gtkliststore.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_LIST_STORE_H__
21 #define __GTK_LIST_STORE_H__
22
23 #include <gtk/gtktreemodel.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #define GTK_TYPE_LIST_STORE            (gtk_list_store_get_type ())
30 #define GTK_LIST_STORE(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
31 #define GTK_LIST_STORE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LISTSTORE, GtkListStoreClass))
32 #define GTK_IS_LIST_STORE(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST_STORE))
33 #define GTK_IS_LIST_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_LIST_STORE))
34
35 typedef struct _GtkListStore       GtkListStore;
36 typedef struct _GtkListStoreClass  GtkListStoreClass;
37
38 struct _GtkListStore
39 {
40   GtkObject parent;
41
42   /*< private >*/
43   gint stamp;
44   gpointer root;
45   GSList *tail;
46   gint n_columns;
47   GType *column_headers;
48   gint length;
49 };
50
51 struct _GtkListStoreClass
52 {
53   GtkObjectClass parent_class;
54
55   /* signals */
56   /* Will be moved into the GtkTreeModelIface eventually */
57   void (* changed)       (GtkTreeModel *tree_model,
58                           GtkTreePath  *path,
59                           GtkTreeIter  *iter);
60   void (* inserted)      (GtkTreeModel *tree_model,
61                           GtkTreePath  *path,
62                           GtkTreeIter  *iter);
63   void (* child_toggled) (GtkTreeModel *tree_model,
64                           GtkTreePath  *path,
65                           GtkTreeIter  *iter);
66   void (* deleted)       (GtkTreeModel *tree_model,
67                           GtkTreePath  *path);
68 };
69
70
71 GtkType       gtk_list_store_get_type        (void);
72 GtkListStore *gtk_list_store_new             (void);
73 GtkListStore *gtk_list_store_new_with_types  (gint          n_columns,
74                                               ...);
75 void          gtk_list_store_set_n_columns   (GtkListStore *store,
76                                               gint          n_columns);
77 void          gtk_list_store_set_column_type (GtkListStore *store,
78                                               gint          column,
79                                               GType         type);
80 void          gtk_list_store_set_cell        (GtkListStore *store,
81                                               GtkTreeIter  *iter,
82                                               gint          column,
83                                               GValue       *value);
84 void          gtk_list_store_set             (GtkListStore *list_store,
85                                               GtkTreeIter  *iter,
86                                               ...);
87 void          gtk_list_store_set_valist      (GtkListStore *list_store,
88                                               GtkTreeIter  *iter,
89                                               va_list       var_args);
90 void          gtk_list_store_remove          (GtkListStore *store,
91                                               GtkTreeIter  *iter);
92 void          gtk_list_store_insert          (GtkListStore *store,
93                                               GtkTreeIter  *iter,
94                                               gint          position);
95 void          gtk_list_store_insert_before   (GtkListStore *store,
96                                               GtkTreeIter  *iter,
97                                               GtkTreeIter  *sibling);
98 void          gtk_list_store_insert_after    (GtkListStore *store,
99                                               GtkTreeIter  *iter,
100                                               GtkTreeIter  *sibling);
101 void          gtk_list_store_prepend         (GtkListStore *store,
102                                               GtkTreeIter  *iter);
103 void          gtk_list_store_append          (GtkListStore *store,
104                                               GtkTreeIter  *iter);
105
106
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112
113 #endif /* __GTK_LIST_STORE_H__ */