]> Pileus Git - ~andy/gtk/blob - gtk/gtkliststore.h
Merge libgdk and libgtk
[~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 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtk.h> can be included directly."
22 #endif
23
24 #ifndef __GTK_LIST_STORE_H__
25 #define __GTK_LIST_STORE_H__
26
27 #include <gtk/gtktreemodel.h>
28 #include <gtk/gtktreesortable.h>
29
30
31 G_BEGIN_DECLS
32
33
34 #define GTK_TYPE_LIST_STORE            (gtk_list_store_get_type ())
35 #define GTK_LIST_STORE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
36 #define GTK_LIST_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_STORE, GtkListStoreClass))
37 #define GTK_IS_LIST_STORE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_STORE))
38 #define GTK_IS_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_STORE))
39 #define GTK_LIST_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_STORE, GtkListStoreClass))
40
41 typedef struct _GtkListStore              GtkListStore;
42 typedef struct _GtkListStorePrivate       GtkListStorePrivate;
43 typedef struct _GtkListStoreClass         GtkListStoreClass;
44
45 struct _GtkListStore
46 {
47   GObject parent;
48
49   /*< private >*/
50   GtkListStorePrivate *priv;
51 };
52
53 struct _GtkListStoreClass
54 {
55   GObjectClass parent_class;
56
57   /* Padding for future expansion */
58   void (*_gtk_reserved1) (void);
59   void (*_gtk_reserved2) (void);
60   void (*_gtk_reserved3) (void);
61   void (*_gtk_reserved4) (void);
62 };
63
64
65 GType         gtk_list_store_get_type         (void) G_GNUC_CONST;
66 GtkListStore *gtk_list_store_new              (gint          n_columns,
67                                                ...);
68 GtkListStore *gtk_list_store_newv             (gint          n_columns,
69                                                GType        *types);
70 void          gtk_list_store_set_column_types (GtkListStore *list_store,
71                                                gint          n_columns,
72                                                GType        *types);
73
74 /* NOTE: use gtk_tree_model_get to get values from a GtkListStore */
75
76 void          gtk_list_store_set_value        (GtkListStore *list_store,
77                                                GtkTreeIter  *iter,
78                                                gint          column,
79                                                GValue       *value);
80 void          gtk_list_store_set              (GtkListStore *list_store,
81                                                GtkTreeIter  *iter,
82                                                ...);
83 void          gtk_list_store_set_valuesv      (GtkListStore *list_store,
84                                                GtkTreeIter  *iter,
85                                                gint         *columns,
86                                                GValue       *values,
87                                                gint          n_values);
88 void          gtk_list_store_set_valist       (GtkListStore *list_store,
89                                                GtkTreeIter  *iter,
90                                                va_list       var_args);
91 gboolean      gtk_list_store_remove           (GtkListStore *list_store,
92                                                GtkTreeIter  *iter);
93 void          gtk_list_store_insert           (GtkListStore *list_store,
94                                                GtkTreeIter  *iter,
95                                                gint          position);
96 void          gtk_list_store_insert_before    (GtkListStore *list_store,
97                                                GtkTreeIter  *iter,
98                                                GtkTreeIter  *sibling);
99 void          gtk_list_store_insert_after     (GtkListStore *list_store,
100                                                GtkTreeIter  *iter,
101                                                GtkTreeIter  *sibling);
102 void          gtk_list_store_insert_with_values  (GtkListStore *list_store,
103                                                   GtkTreeIter  *iter,
104                                                   gint          position,
105                                                   ...);
106 void          gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
107                                                   GtkTreeIter  *iter,
108                                                   gint          position,
109                                                   gint         *columns,
110                                                   GValue       *values,
111                                                   gint          n_values);
112 void          gtk_list_store_prepend          (GtkListStore *list_store,
113                                                GtkTreeIter  *iter);
114 void          gtk_list_store_append           (GtkListStore *list_store,
115                                                GtkTreeIter  *iter);
116 void          gtk_list_store_clear            (GtkListStore *list_store);
117 gboolean      gtk_list_store_iter_is_valid    (GtkListStore *list_store,
118                                                GtkTreeIter  *iter);
119 void          gtk_list_store_reorder          (GtkListStore *store,
120                                                gint         *new_order);
121 void          gtk_list_store_swap             (GtkListStore *store,
122                                                GtkTreeIter  *a,
123                                                GtkTreeIter  *b);
124 void          gtk_list_store_move_after       (GtkListStore *store,
125                                                GtkTreeIter  *iter,
126                                                GtkTreeIter  *position);
127 void          gtk_list_store_move_before      (GtkListStore *store,
128                                                GtkTreeIter  *iter,
129                                                GtkTreeIter  *position);
130
131
132 G_END_DECLS
133
134
135 #endif /* __GTK_LIST_STORE_H__ */