2 * Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
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.
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.
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.
19 #ifndef __EGG_ICON_LIST_H__
20 #define __EGG_ICON_LIST_H__
22 #include <gtk/gtkcontainer.h>
26 #define EGG_TYPE_ICON_LIST (egg_icon_list_get_type ())
27 #define EGG_ICON_LIST(obj) (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST, EggIconList))
28 #define EGG_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_ICON_LIST, EggIconListClass))
29 #define GTK_IS_ICON_LIST(obj) (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST))
30 #define GTK_IS_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST))
31 #define EGG_ICON_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass))
33 #define EGG_TYPE_ICON_LIST_ITEM (egg_icon_list_item_get_type ())
34 #define EGG_ICON_LIST_ITEM(obj) (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST_ITEM, EggIconListItem))
35 #define GTK_IS_ICON_LIST_ITEM(obj) (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST_ITEM))
37 typedef struct _EggIconList EggIconList;
38 typedef struct _EggIconListClass EggIconListClass;
39 typedef struct _EggIconListPrivate EggIconListPrivate;
40 typedef struct _EggIconListItem EggIconListItem;
42 typedef void (* EggIconListForeachFunc) (EggIconList *icon_list,
43 EggIconListItem *item,
45 typedef gint (* EggIconListItemCompareFunc) (EggIconList *icon_list,
54 EggIconListPrivate *priv;
57 struct _EggIconListClass
59 GtkContainerClass parent_class;
61 void (* set_scroll_adjustments) (EggIconList *icon_list,
62 GtkAdjustment *hadjustment,
63 GtkAdjustment *vadjustment);
65 void (* item_activated) (EggIconList *icon_list,
66 EggIconListItem *item);
67 void (* selection_changed) (EggIconList *icon_list);
68 void (* item_added) (EggIconList *icon_list,
69 EggIconListItem *item);
70 void (* item_removed) (EggIconList *icon_list,
71 EggIconListItem *item);
72 void (* item_changed) (EggIconList *icon_list,
73 EggIconListItem *item);
74 /* Key binding signals */
75 void (* select_all) (EggIconList *icon_list);
76 void (* unselect_all) (EggIconList *icon_list);
77 void (* select_cursor_item) (EggIconList *icon_list);
78 void (* toggle_cursor_item) (EggIconList *icon_list);
81 GType egg_icon_list_get_type (void);
82 GType egg_icon_list_item_get_type (void);
83 GtkWidget *egg_icon_list_new (void);
85 EggIconListItem * egg_icon_list_item_new (GdkPixbuf *icon,
87 void egg_icon_list_item_set_data (EggIconListItem *item,
89 void egg_icon_list_item_set_data_full (EggIconListItem *item,
91 GDestroyNotify destroy_notify);
92 gpointer egg_icon_list_item_get_data (EggIconListItem *item);
93 void egg_icon_list_item_set_label (EggIconListItem *item,
95 G_CONST_RETURN gchar *egg_icon_list_item_get_label (EggIconListItem *item);
96 void egg_icon_list_item_set_icon (EggIconListItem *item,
98 GdkPixbuf * egg_icon_list_item_get_icon (EggIconListItem *item);
99 void egg_icon_list_append_item (EggIconList *icon_list,
100 EggIconListItem *item);
101 void egg_icon_list_prepend_item (EggIconList *icon_list,
102 EggIconListItem *item);
103 void egg_icon_list_insert_item_before (EggIconList *icon_list,
104 EggIconListItem *sibling,
105 EggIconListItem *item);
106 void egg_icon_list_insert_item_after (EggIconList *icon_list,
107 EggIconListItem *sibling,
108 EggIconListItem *item);
109 void egg_icon_list_remove_item (EggIconList *icon_list,
110 EggIconListItem *item);
111 EggIconListItem * egg_icon_list_get_item_at_pos (EggIconList *icon_list,
114 gint egg_icon_list_get_item_count (EggIconList *icon_list);
115 void egg_icon_list_foreach (EggIconList *icon_list,
116 EggIconListForeachFunc func,
118 GList * egg_icon_list_get_selected (EggIconList *icon_list);
119 void egg_icon_list_selected_foreach (EggIconList *icon_list,
120 EggIconListForeachFunc func,
122 void egg_icon_list_set_selection_mode (EggIconList *icon_list,
123 GtkSelectionMode mode);
124 GtkSelectionMode egg_icon_list_get_selection_mode (EggIconList *icon_list);
125 void egg_icon_list_select_item (EggIconList *icon_list,
126 EggIconListItem *item);
127 void egg_icon_list_unselect_item (EggIconList *icon_list,
128 EggIconListItem *item);
129 gboolean egg_icon_list_item_is_selected (EggIconListItem *item);
130 void egg_icon_list_select_all (EggIconList *icon_list);
131 void egg_icon_list_unselect_all (EggIconList *icon_list);
132 void egg_icon_list_set_sorted (EggIconList *icon_list,
134 gboolean egg_icon_list_get_sorted (EggIconList *icon_list);
135 void egg_icon_list_set_sort_func (EggIconList *icon_list,
136 EggIconListItemCompareFunc func,
138 GDestroyNotify destroy_notify);
139 void egg_icon_list_set_sort_order (EggIconList *icon_list,
141 GtkSortType egg_icon_list_get_sort_order (EggIconList *icon_list);
142 void egg_icon_list_item_activated (EggIconList *icon_list,
143 EggIconListItem *item);
145 /* For accessibility */
146 GList *egg_icon_list_get_items (EggIconList *icon_list);
150 #endif /* __EGG_ICON_LIST_H__ */