2 * This file is part of hildon-libs
4 * Copyright (C) 2005, 2006 Nokia Corporation.
6 * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; version 2.1 of
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28 * This file is a header file for hildon-grid.c, the implementation of
29 * #HildonGrid. #HildonGrid is used in views like Home and Control Panel
30 * which have single-tap activated items.
33 #ifndef __HILDON_GRID_H__
34 #define __HILDON_GRID_H__
36 #include <gtk/gtkcontainer.h>
37 #include <hildon-widgets/hildon-grid-item.h>
40 #define HILDON_TYPE_GRID (hildon_grid_get_type ())
41 #define HILDON_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
44 #define HILDON_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
47 #define HILDON_IS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
49 #define HILDON_IS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
51 #define HILDON_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
54 typedef struct _HildonGrid HildonGrid;
55 typedef struct _HildonGridClass HildonGridClass;
63 struct _HildonGridClass {
64 GtkContainerClass parent_class;
66 void (*activate_child) (HildonGrid * grid, HildonGridItem * item);
67 void (*popup_context_menu) (HildonGrid * grid, HildonGridItem * item);
70 GType hildon_grid_get_type(void);
71 GtkWidget *hildon_grid_new(void);
74 * Use GtkContainer API:
76 * void gtk_container_set_focus_child (GtkContainer *container,
79 * GTK_CONTAINER (grid)->focus_child can be used to get focused child.
82 void hildon_grid_set_style(HildonGrid * grid, const gchar * style_name);
83 const gchar *hildon_grid_get_style(HildonGrid * grid);
85 void hildon_grid_set_scrollbar_pos(HildonGrid * grid, gint scrollbar_pos);
86 gint hildon_grid_get_scrollbar_pos(HildonGrid * grid);
90 * We are going to use gtk_container_add/remove, so these are internal.
91 * If GridView is not visible, it won't update the view, so it should be
92 * hidden when doing massive modifications.
95 * Use GtkContainer API:
97 * void gtk_container_add (GtkContainer *container,
100 * void gtk_container_remove (GtkContainer *container,
101 * GtkWidget *widget);
104 void hildon_grid_activate_child(HildonGrid * grid, HildonGridItem * item);
107 #endif /* __HILDON_GRID_H__ */