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, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_LIST_STORE_H__
19#define __GTK_LIST_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
29
30G_BEGIN_DECLS
31
32
33#define GTK_TYPE_LIST_STORE (gtk_list_store_get_type ())
34#define GTK_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
35#define GTK_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_STORE, GtkListStoreClass))
36#define GTK_IS_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_STORE))
37#define GTK_IS_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_STORE))
38#define GTK_LIST_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_STORE, GtkListStoreClass))
39
40typedef struct _GtkListStore GtkListStore;
41typedef struct _GtkListStorePrivate GtkListStorePrivate;
42typedef struct _GtkListStoreClass GtkListStoreClass;
43
44struct _GtkListStore
45{
46 GObject parent;
47
48 /*< private >*/
49 GtkListStorePrivate *priv;
50};
51
52struct _GtkListStoreClass
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_list_store_get_type (void) G_GNUC_CONST;
66GDK_AVAILABLE_IN_ALL
67GtkListStore *gtk_list_store_new (gint n_columns,
68 ...);
69GDK_AVAILABLE_IN_ALL
70GtkListStore *gtk_list_store_newv (gint n_columns,
71 GType *types);
72GDK_AVAILABLE_IN_ALL
73void gtk_list_store_set_column_types (GtkListStore *list_store,
74 gint n_columns,
75 GType *types);
76
77/* NOTE: use gtk_tree_model_get to get values from a GtkListStore */
78
79GDK_AVAILABLE_IN_ALL
80void gtk_list_store_set_value (GtkListStore *list_store,
81 GtkTreeIter *iter,
82 gint column,
83 GValue *value);
84GDK_AVAILABLE_IN_ALL
85void gtk_list_store_set (GtkListStore *list_store,
86 GtkTreeIter *iter,
87 ...);
88GDK_AVAILABLE_IN_ALL
89void gtk_list_store_set_valuesv (GtkListStore *list_store,
90 GtkTreeIter *iter,
91 gint *columns,
92 GValue *values,
93 gint n_values);
94GDK_AVAILABLE_IN_ALL
95void gtk_list_store_set_valist (GtkListStore *list_store,
96 GtkTreeIter *iter,
97 va_list var_args);
98GDK_AVAILABLE_IN_ALL
99gboolean gtk_list_store_remove (GtkListStore *list_store,
100 GtkTreeIter *iter);
101GDK_AVAILABLE_IN_ALL
102void gtk_list_store_insert (GtkListStore *list_store,
103 GtkTreeIter *iter,
104 gint position);
105GDK_AVAILABLE_IN_ALL
106void gtk_list_store_insert_before (GtkListStore *list_store,
107 GtkTreeIter *iter,
108 GtkTreeIter *sibling);
109GDK_AVAILABLE_IN_ALL
110void gtk_list_store_insert_after (GtkListStore *list_store,
111 GtkTreeIter *iter,
112 GtkTreeIter *sibling);
113GDK_AVAILABLE_IN_ALL
114void gtk_list_store_insert_with_values (GtkListStore *list_store,
115 GtkTreeIter *iter,
116 gint position,
117 ...);
118GDK_AVAILABLE_IN_ALL
119void gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
120 GtkTreeIter *iter,
121 gint position,
122 gint *columns,
123 GValue *values,
124 gint n_values);
125GDK_AVAILABLE_IN_ALL
126void gtk_list_store_prepend (GtkListStore *list_store,
127 GtkTreeIter *iter);
128GDK_AVAILABLE_IN_ALL
129void gtk_list_store_append (GtkListStore *list_store,
130 GtkTreeIter *iter);
131GDK_AVAILABLE_IN_ALL
132void gtk_list_store_clear (GtkListStore *list_store);
133GDK_AVAILABLE_IN_ALL
134gboolean gtk_list_store_iter_is_valid (GtkListStore *list_store,
135 GtkTreeIter *iter);
136GDK_AVAILABLE_IN_ALL
137void gtk_list_store_reorder (GtkListStore *store,
138 gint *new_order);
139GDK_AVAILABLE_IN_ALL
140void gtk_list_store_swap (GtkListStore *store,
141 GtkTreeIter *a,
142 GtkTreeIter *b);
143GDK_AVAILABLE_IN_ALL
144void gtk_list_store_move_after (GtkListStore *store,
145 GtkTreeIter *iter,
146 GtkTreeIter *position);
147GDK_AVAILABLE_IN_ALL
148void gtk_list_store_move_before (GtkListStore *store,
149 GtkTreeIter *iter,
150 GtkTreeIter *position);
151
152
153G_END_DECLS
154
155
156#endif /* __GTK_LIST_STORE_H__ */
157

source code of include/gtk-3.0/gtk/gtkliststore.h