2 * Copyright (C) 2002, 2004 Anders Carlsson <andersca@gnome.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 __GTK_ICON_VIEW_H__
20 #define __GTK_ICON_VIEW_H__
22 #include <gtk/gtkcontainer.h>
23 #include <gtk/gtktreemodel.h>
24 #include <gtk/gtkcellrenderer.h>
28 #define GTK_TYPE_ICON_VIEW (gtk_icon_view_get_type ())
29 #define GTK_ICON_VIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
30 #define GTK_ICON_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
31 #define GTK_IS_ICON_VIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_ICON_VIEW))
32 #define GTK_IS_ICON_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
33 #define GTK_ICON_VIEW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
35 typedef struct _GtkIconView GtkIconView;
36 typedef struct _GtkIconViewClass GtkIconViewClass;
37 typedef struct _GtkIconViewPrivate GtkIconViewPrivate;
39 typedef void (* GtkIconViewForeachFunc) (GtkIconView *icon_view,
47 GtkIconViewPrivate *priv;
50 struct _GtkIconViewClass
52 GtkContainerClass parent_class;
54 void (* set_scroll_adjustments) (GtkIconView *icon_view,
55 GtkAdjustment *hadjustment,
56 GtkAdjustment *vadjustment);
58 void (* item_activated) (GtkIconView *icon_view,
60 void (* selection_changed) (GtkIconView *icon_view);
62 /* Key binding signals */
63 void (* select_all) (GtkIconView *icon_view);
64 void (* unselect_all) (GtkIconView *icon_view);
65 void (* select_cursor_item) (GtkIconView *icon_view);
66 void (* toggle_cursor_item) (GtkIconView *icon_view);
67 gboolean (* move_cursor) (GtkIconView *icon_view,
70 gboolean (* activate_cursor_item) (GtkIconView *icon_view);
73 GType gtk_icon_view_get_type (void) G_GNUC_CONST;
74 GtkWidget * gtk_icon_view_new (void);
75 GtkWidget * gtk_icon_view_new_with_model (GtkTreeModel *model);
77 void gtk_icon_view_set_model (GtkIconView *icon_view,
79 GtkTreeModel * gtk_icon_view_get_model (GtkIconView *icon_view);
80 void gtk_icon_view_set_text_column (GtkIconView *icon_view,
82 gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
83 void gtk_icon_view_set_markup_column (GtkIconView *icon_view,
85 gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
86 void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
88 gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
90 void gtk_icon_view_set_orientation (GtkIconView *icon_view,
91 GtkOrientation orientation);
92 GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view);
93 void gtk_icon_view_set_columns (GtkIconView *icon_view,
95 gint gtk_icon_view_get_columns (GtkIconView *icon_view);
96 void gtk_icon_view_set_item_width (GtkIconView *icon_view,
98 gint gtk_icon_view_get_item_width (GtkIconView *icon_view);
99 void gtk_icon_view_set_spacing (GtkIconView *icon_view,
101 gint gtk_icon_view_get_spacing (GtkIconView *icon_view);
102 void gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
104 gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view);
105 void gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
106 gint column_spacing);
107 gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view);
108 void gtk_icon_view_set_margin (GtkIconView *icon_view,
110 gint gtk_icon_view_get_margin (GtkIconView *icon_view);
113 GtkTreePath * gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
116 gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
120 GtkCellRenderer **cell);
122 void gtk_icon_view_selected_foreach (GtkIconView *icon_view,
123 GtkIconViewForeachFunc func,
125 void gtk_icon_view_set_selection_mode (GtkIconView *icon_view,
126 GtkSelectionMode mode);
127 GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
128 void gtk_icon_view_select_path (GtkIconView *icon_view,
130 void gtk_icon_view_unselect_path (GtkIconView *icon_view,
132 gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view,
134 GList *gtk_icon_view_get_selected_items (GtkIconView *icon_view);
135 void gtk_icon_view_select_all (GtkIconView *icon_view);
136 void gtk_icon_view_unselect_all (GtkIconView *icon_view);
137 void gtk_icon_view_item_activated (GtkIconView *icon_view,
139 void gtk_icon_view_set_cursor (GtkIconView *icon_view,
141 GtkCellRenderer *cell,
142 gboolean start_editing);
143 gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view,
145 GtkCellRenderer **cell);
149 #endif /* __GTK_ICON_VIEW_H__ */