1 /*
2  * Copyright (c) 2011 Red Hat, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * Author: Cosimo Cecchi <cosimoc@redhat.com>
19  *
20  */
21 
22 #ifndef __GD_MAIN_VIEW_H__
23 #define __GD_MAIN_VIEW_H__
24 
25 #include <glib-object.h>
26 
27 #include <gtk/gtk.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GD_TYPE_MAIN_VIEW gd_main_view_get_type()
32 G_DECLARE_DERIVABLE_TYPE (GdMainView, gd_main_view, GD, MAIN_VIEW, GtkScrolledWindow)
33 
34 typedef enum {
35   GD_MAIN_VIEW_ICON,
36   GD_MAIN_VIEW_LIST
37 } GdMainViewType;
38 
39 struct _GdMainViewClass {
40   GtkScrolledWindowClass parent_class;
41 };
42 
43 GdMainView * gd_main_view_new (GdMainViewType type);
44 void         gd_main_view_set_view_type (GdMainView *self,
45                                          GdMainViewType type);
46 GdMainViewType gd_main_view_get_view_type (GdMainView *self);
47 
48 void gd_main_view_set_selection_mode (GdMainView *self,
49                                       gboolean selection_mode);
50 gboolean gd_main_view_get_selection_mode (GdMainView *self);
51 
52 GList * gd_main_view_get_selection (GdMainView *self);
53 
54 void gd_main_view_select_all (GdMainView *self);
55 void gd_main_view_unselect_all (GdMainView *self);
56 
57 GtkTreeModel * gd_main_view_get_model (GdMainView *self);
58 void gd_main_view_set_model (GdMainView *self,
59                              GtkTreeModel *model);
60 
61 GtkWidget * gd_main_view_get_generic_view (GdMainView *self);
62 
63 G_END_DECLS
64 
65 #endif /* __GD_MAIN_VIEW_H__ */
66