Main Page | File List | File Members

cp-grid.h

00001 /*
00002  * This file is part of hildon-control-panel
00003  *
00004  * Copyright (C) 2005 Nokia Corporation.
00005  *
00006  * Contact: Karoliina Salminen <karoliina.t.salminen@nokia.com>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * version 2.1 as published by the Free Software Foundation.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00020  * 02110-1301 USA
00021  *
00022  */
00023 
00024 /*
00025  * @file cp-grid.h
00026  *
00027  * This file is a header file for cp-grid.c, the implementation of
00028  * #CPGrid. #CPGrid is used in views like Home and Control Panel
00029  * which have single-tap activated items.
00030  */
00031 
00032 #ifndef CP_GRID_H_
00033 #define CP_GRID_H_
00034 
00035 #include <gtk/gtkcontainer.h>
00036 #include "cp-grid-item.h"
00037 
00038 G_BEGIN_DECLS
00039 
00040 #define GRID_MAXIMUM_NUMBER_OF_GRIDS 10
00041 
00042 #define CP_GRID_FOCUS_FROM_ABOVE 0
00043 #define CP_GRID_FOCUS_FIRST      1
00044 #define CP_GRID_FOCUS_FROM_BELOW 2
00045 #define CP_GRID_FOCUS_LAST       3
00046 
00047 #define CP_TYPE_GRID            (cp_grid_get_type ())
00048 #define CP_GRID(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
00049                                             CP_TYPE_GRID, \
00050                                             CPGrid))
00051 #define CP_GRID_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
00052                                             CP_TYPE_GRID, \
00053                                             CPGridClass))
00054 #define CP_OBJECT_IS_GRID(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
00055                                             CP_TYPE_GRID))
00056 #define CP_OBJECT_IS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
00057                                             CP_TYPE_GRID))
00058 #define CP_GRID_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
00059                                             CP_TYPE_GRID, \
00060                                             CPGridClass))
00061 typedef struct _CPGrid CPGrid;
00062 typedef struct _CPGridClass CPGridClass;
00063 
00064 
00065 struct _CPGrid {
00066     GtkContainer parent;
00067 };
00068 
00069 struct _CPGridClass {
00070     GtkContainerClass parent_class;
00071 
00072     void (*activate_child) (CPGrid * grid, CPGridItem * item);
00073     void (*popup_context_menu) (CPGrid * grid, CPGridItem * item);
00074 };
00075 
00076 GType cp_grid_get_type(void) G_GNUC_CONST;
00077 GtkWidget *cp_grid_new(void);
00078 
00079 /*
00080  * Use GtkContainer API:
00081  *
00082  * void gtk_container_set_focus_child(GtkContainer *container,
00083  *                                    GtkWidget *child);
00084  *
00085  * GTK_CONTAINER (grid)->focus_child can be used to get focused child.
00086  */
00087 
00088 void cp_grid_set_style(CPGrid * grid, const gchar * style_name);
00089 const gchar *cp_grid_get_style(CPGrid * grid);
00090 
00091 void cp_grid_set_scrollbar_pos(CPGrid * grid, gint scrollbar_pos);
00092 gint cp_grid_get_scrollbar_pos(CPGrid * grid);
00093 
00094 
00095 /*
00096  * We are going to use gtk_container_add/remove, so these are internal.
00097  * If GridView is not visible, it won't update the view, so it should be
00098  * hidden when doing massive modifications.
00099  *
00100  * 
00101  * Use GtkContainer API:
00102  *
00103  * void gtk_container_add(GtkContainer *container,
00104  *                        GtkWidget *widget);
00105  *
00106  * void gtk_container_remove(GtkContainer *container,
00107  *                           GtkWidget *widget);
00108  */
00109 
00110 void cp_grid_activate_child(CPGrid * grid, CPGridItem * item);
00111 
00112 gboolean cp_grid_has_focus(CPGrid *grid);
00113 
00114 void cp_grid_focus_first_item(CPGrid *grid);
00115 
00116 
00117 G_END_DECLS
00118 #endif /* ifndef CP_GRID_H_ */

Generated on Thu Dec 21 18:18:50 2006 by  doxygen 1.4.2