]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
07e3e8a55f844a7e88fc7831b923c742e36a4b41
[~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   gboolean (* activate_cursor_item)  (GtkIconView      *icon_view);
70 };
71
72 GType      gtk_icon_view_get_type       (void);
73 GtkWidget *gtk_icon_view_new            (void);
74 GtkWidget *gtk_icon_view_new_with_model (GtkTreeModel *model);
75
76 void          gtk_icon_view_set_model         (GtkIconView  *icon_view,
77                                                GtkTreeModel *model);
78 GtkTreeModel *gtk_icon_view_get_model         (GtkIconView  *icon_view);
79 void          gtk_icon_view_set_text_column   (GtkIconView  *icon_view,
80                                                gint          column);
81 gint          gtk_icon_view_get_text_column   (GtkIconView  *icon_view);
82 void          gtk_icon_view_set_markup_column (GtkIconView  *icon_view,
83                                                gint          column);
84 gint          gtk_icon_view_get_markup_column (GtkIconView  *icon_view);
85 void          gtk_icon_view_set_pixbuf_column (GtkIconView  *icon_view,
86                                                gint          column);
87 gint          gtk_icon_view_get_pixbuf_column (GtkIconView  *icon_view);
88
89 void           gtk_icon_view_set_orientation (GtkIconView    *icon_view,
90                                               GtkOrientation  orientation);
91 GtkOrientation gtk_icon_view_get_orientation (GtkIconView    *icon_view);
92
93
94 GtkTreePath *    gtk_icon_view_get_path_at_pos    (GtkIconView            *icon_view,
95                                                    gint                    x,
96                                                    gint                    y);
97 void             gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
98                                                    GtkIconViewForeachFunc  func,
99                                                    gpointer                data);
100 void             gtk_icon_view_set_selection_mode (GtkIconView            *icon_view,
101                                                    GtkSelectionMode        mode);
102 GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView            *icon_view);
103 void             gtk_icon_view_select_path        (GtkIconView            *icon_view,
104                                                    GtkTreePath            *path);
105 void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
106                                                    GtkTreePath            *path);
107 gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
108                                                    GtkTreePath            *path);
109 GList           *gtk_icon_view_get_selected_items (GtkIconView            *icon_view);
110 void             gtk_icon_view_select_all         (GtkIconView            *icon_view);
111 void             gtk_icon_view_unselect_all       (GtkIconView            *icon_view);
112 void             gtk_icon_view_item_activated     (GtkIconView            *icon_view,
113                                                    GtkTreePath            *path);
114 G_END_DECLS
115
116 #endif /* __GTK_ICON_VIEW_H__ */