]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
cfccd635ed4e2e86ede51c0d183a7390b939bbe8
[~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 #include <gtk/gtkcellrenderer.h>
25
26 G_BEGIN_DECLS
27
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))
34
35 typedef struct _GtkIconView           GtkIconView;
36 typedef struct _GtkIconViewClass      GtkIconViewClass;
37 typedef struct _GtkIconViewPrivate    GtkIconViewPrivate;
38
39 typedef void (* GtkIconViewForeachFunc)     (GtkIconView      *icon_view,
40                                              GtkTreePath      *path,
41                                              gpointer          data);
42
43 struct _GtkIconView
44 {
45   GtkContainer parent;
46
47   GtkIconViewPrivate *priv;
48 };
49
50 struct _GtkIconViewClass
51 {
52   GtkContainerClass parent_class;
53
54   void    (* set_scroll_adjustments) (GtkIconView      *icon_view,
55                                       GtkAdjustment    *hadjustment,
56                                       GtkAdjustment    *vadjustment);
57   
58   void    (* item_activated)         (GtkIconView      *icon_view,
59                                       GtkTreePath      *path);
60   void    (* selection_changed)      (GtkIconView      *icon_view);
61
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,
68                                       GtkMovementStep   step,
69                                       gint              count);
70   gboolean (* activate_cursor_item)  (GtkIconView      *icon_view);
71 };
72
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);
76
77 void           gtk_icon_view_set_model         (GtkIconView    *icon_view,
78                                                 GtkTreeModel   *model);
79 GtkTreeModel * gtk_icon_view_get_model         (GtkIconView    *icon_view);
80 void           gtk_icon_view_set_text_column   (GtkIconView    *icon_view,
81                                                 gint            column);
82 gint           gtk_icon_view_get_text_column   (GtkIconView    *icon_view);
83 void           gtk_icon_view_set_markup_column (GtkIconView    *icon_view,
84                                                 gint            column);
85 gint           gtk_icon_view_get_markup_column (GtkIconView    *icon_view);
86 void           gtk_icon_view_set_pixbuf_column (GtkIconView    *icon_view,
87                                                 gint            column);
88 gint           gtk_icon_view_get_pixbuf_column (GtkIconView    *icon_view);
89
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,
94                                                 gint            columns);
95 gint           gtk_icon_view_get_columns       (GtkIconView    *icon_view);
96 void           gtk_icon_view_set_item_width    (GtkIconView    *icon_view,
97                                                 gint            item_width);
98 gint           gtk_icon_view_get_item_width    (GtkIconView    *icon_view);
99 void           gtk_icon_view_set_spacing       (GtkIconView    *icon_view, 
100                                                 gint            spacing);
101 gint           gtk_icon_view_get_spacing       (GtkIconView    *icon_view);
102 void           gtk_icon_view_set_row_spacing   (GtkIconView    *icon_view, 
103                                                 gint            row_spacing);
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, 
109                                                 gint            margin);
110 gint           gtk_icon_view_get_margin        (GtkIconView    *icon_view);
111
112
113 GtkTreePath *  gtk_icon_view_get_path_at_pos   (GtkIconView     *icon_view,
114                                                 gint             x,
115                                                 gint             y);
116 gboolean       gtk_icon_view_get_item_at_pos   (GtkIconView     *icon_view,
117                                                 gint              x,
118                                                 gint              y,
119                                                 GtkTreePath     **path,
120                                                 GtkCellRenderer **cell);
121
122 void           gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
123                                                  GtkIconViewForeachFunc  func,
124                                                  gpointer                data);
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,
129                                                    GtkTreePath            *path);
130 void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
131                                                    GtkTreePath            *path);
132 gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
133                                                    GtkTreePath            *path);
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,
138                                                    GtkTreePath            *path);
139 void             gtk_icon_view_set_cursor         (GtkIconView            *icon_view,
140                                                    GtkTreePath            *path,
141                                                    GtkCellRenderer        *cell,
142                                                    gboolean                start_editing);
143 gboolean         gtk_icon_view_get_cursor         (GtkIconView            *icon_view,
144                                                    GtkTreePath           **path,
145                                                    GtkCellRenderer       **cell);
146
147 G_END_DECLS
148
149 #endif /* __GTK_ICON_VIEW_H__ */