]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
gtk/gtkiconview.c Add GtkIconView to the build, remove debugging output.
[~andy/gtk] / gtk / gtkiconview.h
1 /* gtkiconview.h
2  * Copyright (C) 2002, 2004  Anders Carlsson <andersca@gnome.org>
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GTK_ICON_VIEW_H__
20 #define __GTK_ICON_VIEW_H__
21
22 #include <gtk/gtkcontainer.h>
23 #include <gtk/gtktreemodel.h>
24
25 G_BEGIN_DECLS
26
27 #define GTK_TYPE_ICON_VIEW              (gtk_icon_view_get_type ())
28 #define GTK_ICON_VIEW(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
29 #define GTK_ICON_VIEW_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
30 #define GTK_IS_ICON_VIEW(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_ICON_VIEW))
31 #define GTK_IS_ICON_VIEW_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
32 #define GTK_ICON_VIEW_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
33
34 typedef struct _GtkIconView           GtkIconView;
35 typedef struct _GtkIconViewClass      GtkIconViewClass;
36 typedef struct _GtkIconViewPrivate    GtkIconViewPrivate;
37
38 typedef void (* GtkIconViewForeachFunc)     (GtkIconView      *icon_view,
39                                              GtkTreePath      *path,
40                                              gpointer          data);
41
42 struct _GtkIconView
43 {
44   GtkContainer parent;
45
46   GtkIconViewPrivate *priv;
47 };
48
49 struct _GtkIconViewClass
50 {
51   GtkContainerClass parent_class;
52
53   void    (* set_scroll_adjustments) (GtkIconView      *icon_view,
54                                       GtkAdjustment    *hadjustment,
55                                       GtkAdjustment    *vadjustment);
56   
57   void    (* item_activated)         (GtkIconView      *icon_view,
58                                       GtkTreePath      *path);
59   void    (* selection_changed)      (GtkIconView      *icon_view);
60
61   /* Key binding signals */
62   void    (* select_all)             (GtkIconView      *icon_view);
63   void    (* unselect_all)           (GtkIconView      *icon_view);
64   void    (* select_cursor_item)     (GtkIconView      *icon_view);
65   void    (* toggle_cursor_item)     (GtkIconView      *icon_view);
66   gboolean (* move_cursor)           (GtkIconView      *icon_view,
67                                       GtkMovementStep   step,
68                                       gint              count);
69 };
70
71 GType      gtk_icon_view_get_type       (void);
72 GtkWidget *gtk_icon_view_new            (void);
73 GtkWidget *gtk_icon_view_new_with_model (GtkTreeModel *model);
74
75 void          gtk_icon_view_set_model         (GtkIconView  *icon_view,
76                                                GtkTreeModel *model);
77 GtkTreeModel *gtk_icon_view_get_model         (GtkIconView  *icon_view);
78 void          gtk_icon_view_set_text_column   (GtkIconView  *icon_view,
79                                                gint          column);
80 gint          gtk_icon_view_get_text_column   (GtkIconView  *icon_view);
81 void          gtk_icon_view_set_markup_column (GtkIconView  *icon_view,
82                                                int           column);
83 gint          gtk_icon_view_get_markup_column (GtkIconView  *icon_view);
84 void          gtk_icon_view_set_pixbuf_column (GtkIconView  *icon_view,
85                                                gint          column);
86 gint          gtk_icon_view_get_pixbuf_column (GtkIconView  *icon_view);
87
88
89 GtkTreePath *    gtk_icon_view_get_path_at_pos    (GtkIconView            *icon_view,
90                                                    gint                    x,
91                                                    gint                    y);
92 void             gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
93                                                    GtkIconViewForeachFunc  func,
94                                                    gpointer                data);
95 void             gtk_icon_view_set_selection_mode (GtkIconView            *icon_view,
96                                                    GtkSelectionMode        mode);
97 GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView            *icon_view);
98 void             gtk_icon_view_select_path        (GtkIconView            *icon_view,
99                                                    GtkTreePath            *path);
100 void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
101                                                    GtkTreePath            *path);
102 gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
103                                                    GtkTreePath            *path);
104 GList           *gtk_icon_view_get_selected_items (GtkIconView            *icon_view);
105 void             gtk_icon_view_select_all         (GtkIconView            *icon_view);
106 void             gtk_icon_view_unselect_all       (GtkIconView            *icon_view);
107 void             gtk_icon_view_item_activated     (GtkIconView            *icon_view,
108                                                    GtkTreePath            *path);
109 G_END_DECLS
110
111 #endif /* __GTK_ICON_VIEW_H__ */