gtkliststore.h 5.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* gtkliststore.h
 * Copyright (C) 2000  Red Hat, Inc.,  Jonathan Blandford <jrb@redhat.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 17
 */

18
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
19 20 21
#error "Only <gtk/gtk.h> can be included directly."
#endif

22 23 24 25
#ifndef __GTK_LIST_STORE_H__
#define __GTK_LIST_STORE_H__

#include <gtk/gtktreemodel.h>
26
#include <gtk/gtktreesortable.h>
27

28 29 30

G_BEGIN_DECLS

31 32

#define GTK_TYPE_LIST_STORE	       (gtk_list_store_get_type ())
Manish Singh's avatar
Manish Singh committed
33 34 35 36 37
#define GTK_LIST_STORE(obj)	       (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
#define GTK_LIST_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_STORE, GtkListStoreClass))
#define GTK_IS_LIST_STORE(obj)	       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_STORE))
#define GTK_IS_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_STORE))
#define GTK_LIST_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_STORE, GtkListStoreClass))
38

39 40 41
typedef struct _GtkListStore              GtkListStore;
typedef struct _GtkListStorePrivate       GtkListStorePrivate;
typedef struct _GtkListStoreClass         GtkListStoreClass;
42 43 44

struct _GtkListStore
{
45
  GObject parent;
46 47

  /*< private >*/
48
  GtkListStorePrivate *priv;
49 50 51 52
};

struct _GtkListStoreClass
{
53
  GObjectClass parent_class;
54 55 56 57 58 59

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
60 61
};

62

Matthias Clasen's avatar
Matthias Clasen committed
63
GType         gtk_list_store_get_type         (void) G_GNUC_CONST;
64 65 66 67 68 69 70
GtkListStore *gtk_list_store_new              (gint          n_columns,
					       ...);
GtkListStore *gtk_list_store_newv             (gint          n_columns,
					       GType        *types);
void          gtk_list_store_set_column_types (GtkListStore *list_store,
					       gint          n_columns,
					       GType        *types);
71 72 73

/* NOTE: use gtk_tree_model_get to get values from a GtkListStore */

74 75 76 77 78 79 80
void          gtk_list_store_set_value        (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       gint          column,
					       GValue       *value);
void          gtk_list_store_set              (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       ...);
81 82
void          gtk_list_store_set_valuesv      (GtkListStore *list_store,
					       GtkTreeIter  *iter,
83
					       gint         *columns,
84 85
					       GValue       *values,
					       gint          n_values);
86 87 88
void          gtk_list_store_set_valist       (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       va_list       var_args);
Kristian Rietveld's avatar
Kristian Rietveld committed
89
gboolean      gtk_list_store_remove           (GtkListStore *list_store,
90 91 92 93 94 95 96 97 98 99
					       GtkTreeIter  *iter);
void          gtk_list_store_insert           (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       gint          position);
void          gtk_list_store_insert_before    (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       GtkTreeIter  *sibling);
void          gtk_list_store_insert_after     (GtkListStore *list_store,
					       GtkTreeIter  *iter,
					       GtkTreeIter  *sibling);
100 101 102 103 104 105 106
void          gtk_list_store_insert_with_values  (GtkListStore *list_store,
						  GtkTreeIter  *iter,
						  gint          position,
						  ...);
void          gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
						  GtkTreeIter  *iter,
						  gint          position,
107
						  gint         *columns,
108 109
						  GValue       *values,
						  gint          n_values);
110 111 112 113 114
void          gtk_list_store_prepend          (GtkListStore *list_store,
					       GtkTreeIter  *iter);
void          gtk_list_store_append           (GtkListStore *list_store,
					       GtkTreeIter  *iter);
void          gtk_list_store_clear            (GtkListStore *list_store);
Kristian Rietveld's avatar
Kristian Rietveld committed
115 116
gboolean      gtk_list_store_iter_is_valid    (GtkListStore *list_store,
                                               GtkTreeIter  *iter);
117 118 119 120 121
void          gtk_list_store_reorder          (GtkListStore *store,
                                               gint         *new_order);
void          gtk_list_store_swap             (GtkListStore *store,
                                               GtkTreeIter  *a,
                                               GtkTreeIter  *b);
122
void          gtk_list_store_move_after       (GtkListStore *store,
123
                                               GtkTreeIter  *iter,
124 125 126 127
                                               GtkTreeIter  *position);
void          gtk_list_store_move_before      (GtkListStore *store,
                                               GtkTreeIter  *iter,
                                               GtkTreeIter  *position);
128 129


130
G_END_DECLS
131 132 133


#endif /* __GTK_LIST_STORE_H__ */