]> Pileus Git - ~andy/gtk/blob - gtk/gtkliststore.h
New functions to clear a model.
[~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 #include <gtk/gtktreesortable.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 #define GTK_TYPE_LIST_STORE            (gtk_list_store_get_type ())
31 #define GTK_LIST_STORE(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
32 #define GTK_LIST_STORE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LISTSTORE, GtkListStoreClass))
33 #define GTK_IS_LIST_STORE(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST_STORE))
34 #define GTK_IS_LIST_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_LIST_STORE))
35 #define GTK_LIST_STORE_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LIST_STORE, GtkListStoreClass))
36
37 typedef struct _GtkListStore       GtkListStore;
38 typedef struct _GtkListStoreClass  GtkListStoreClass;
39
40 struct _GtkListStore
41 {
42   GObject parent;
43
44   /*< private >*/
45   gint stamp;
46   gpointer root;
47   gpointer tail;
48   GList *sort_list;
49   gint n_columns;
50   gint sort_column_id;
51   GtkTreeSortOrder order;
52   GType *column_headers;
53   gint length;
54 };
55
56 struct _GtkListStoreClass
57 {
58   GObjectClass parent_class;
59 };
60
61
62 GtkType       gtk_list_store_get_type        (void);
63 GtkListStore *gtk_list_store_new             (void);
64 GtkListStore *gtk_list_store_new_with_types  (gint          n_columns,
65                                               ...);
66 void          gtk_list_store_set_n_columns   (GtkListStore *store,
67                                               gint          n_columns);
68 void          gtk_list_store_set_column_type (GtkListStore *store,
69                                               gint          column,
70                                               GType         type);
71 void          gtk_list_store_set_value       (GtkListStore *store,
72                                               GtkTreeIter  *iter,
73                                               gint          column,
74                                               GValue       *value);
75 void          gtk_list_store_set             (GtkListStore *list_store,
76                                               GtkTreeIter  *iter,
77                                               ...);
78 void          gtk_list_store_set_valist      (GtkListStore *list_store,
79                                               GtkTreeIter  *iter,
80                                               va_list       var_args);
81 void          gtk_list_store_remove          (GtkListStore *store,
82                                               GtkTreeIter  *iter);
83 void          gtk_list_store_insert          (GtkListStore *store,
84                                               GtkTreeIter  *iter,
85                                               gint          position);
86 void          gtk_list_store_insert_before   (GtkListStore *store,
87                                               GtkTreeIter  *iter,
88                                               GtkTreeIter  *sibling);
89 void          gtk_list_store_insert_after    (GtkListStore *store,
90                                               GtkTreeIter  *iter,
91                                               GtkTreeIter  *sibling);
92 void          gtk_list_store_prepend         (GtkListStore *store,
93                                               GtkTreeIter  *iter);
94 void          gtk_list_store_append          (GtkListStore *store,
95                                               GtkTreeIter  *iter);
96 void          gtk_list_store_clear           (GtkListStore *store);
97
98
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102
103
104 #endif /* __GTK_LIST_STORE_H__ */