1 /* 2 * Copyright 2015 Lars Uebernickel 3 * Copyright 2015 Ryan Lortie 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General 16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>. 17 * 18 * Authors: 19 * Lars Uebernickel <lars@uebernic.de> 20 * Ryan Lortie <desrt@desrt.ca> 21 */ 22 23 #ifndef __G_LIST_STORE_H__ 24 #define __G_LIST_STORE_H__ 25 26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) 27 #error "Only <gio/gio.h> can be included directly." 28 #endif 29 30 #include <gio/giotypes.h> 31 32 G_BEGIN_DECLS 33 34 #define G_TYPE_LIST_STORE (g_list_store_get_type ()) 35 GLIB_AVAILABLE_IN_2_44 36 G_DECLARE_FINAL_TYPE(GListStore, g_list_store, G, LIST_STORE, GObject) 37 38 GLIB_AVAILABLE_IN_2_44 39 GListStore * g_list_store_new (GType item_type); 40 41 GLIB_AVAILABLE_IN_2_44 42 void g_list_store_insert (GListStore *store, 43 guint position, 44 gpointer item); 45 46 GLIB_AVAILABLE_IN_2_44 47 guint g_list_store_insert_sorted (GListStore *store, 48 gpointer item, 49 GCompareDataFunc compare_func, 50 gpointer user_data); 51 52 GLIB_AVAILABLE_IN_2_46 53 void g_list_store_sort (GListStore *store, 54 GCompareDataFunc compare_func, 55 gpointer user_data); 56 57 GLIB_AVAILABLE_IN_2_44 58 void g_list_store_append (GListStore *store, 59 gpointer item); 60 61 GLIB_AVAILABLE_IN_2_44 62 void g_list_store_remove (GListStore *store, 63 guint position); 64 65 GLIB_AVAILABLE_IN_2_44 66 void g_list_store_remove_all (GListStore *store); 67 68 GLIB_AVAILABLE_IN_2_44 69 void g_list_store_splice (GListStore *store, 70 guint position, 71 guint n_removals, 72 gpointer *additions, 73 guint n_additions); 74 75 GLIB_AVAILABLE_IN_2_64 76 gboolean g_list_store_find (GListStore *store, 77 gpointer item, 78 guint *position); 79 80 GLIB_AVAILABLE_IN_2_64 81 gboolean g_list_store_find_with_equal_func (GListStore *store, 82 gpointer item, 83 GEqualFunc equal_func, 84 guint *position); 85 86 G_END_DECLS 87 88 #endif /* __G_LIST_STORE_H__ */ 89