2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-grid-item.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  *
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
11  * the License.
12  *
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.
17  *
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
21  * 02110-1301 USA
22  *
23  */
24
25 /*
26  * @file hildon-grid-item.h
27  *
28  * This file is a header file for he implementation of HildonGridItem.
29  * HildonGridItem is an item mainly used in HildonGrid. It has an icon,
30  * emblem and a label.
31  */
32
33 #ifndef __HILDON_GRID_ITEM_H__
34 #define __HILDON_GRID_ITEM_H__
35
36 #include <gtk/gtkcontainer.h>
37 #include <gtk/gtkitem.h>
38
39 G_BEGIN_DECLS
40 #define HILDON_TYPE_GRID_ITEM       (hildon_grid_item_get_type ())
41 #define HILDON_GRID_ITEM(obj)       (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
42                                             HILDON_TYPE_GRID_ITEM, \
43                                             HildonGridItem))
44 #define HILDON_GRID_ITEM_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass),\
45                                                 HILDON_TYPE_GRID_ITEM, \
46                                                 HildonGridItemClass))
47 #define HILDON_IS_GRID_ITEM(obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
48                                             HILDON_TYPE_GRID_ITEM))
49 #define HILDON_IS_GRID_ITEM_CLASS(klass) \
50         (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_GRID_ITEM))
51 #define HILDON_GRID_ITEM_GET_CLASS(obj) \
52         (G_TYPE_INSTANCE_GET_CLASS ((obj), \
53          HILDON_TYPE_GRID_ITEM, HildonGridItemClass))
54
55 typedef enum {
56     HILDON_GRID_ITEM_LABEL_POS_BOTTOM = 1,
57     HILDON_GRID_ITEM_LABEL_POS_RIGHT
58 } HildonGridPositionType;
59
60 typedef enum {
61     HILDON_GRID_ITEM_ICON_27x27 = 1,
62     HILDON_GRID_ITEM_ICON_128x128
63 } HildonGridItemIconSizeType;
64
65
66 typedef struct _HildonGridItem HildonGridItem;
67 typedef struct _HildonGridItemClass HildonGridItemClass;
68
69
70 struct _HildonGridItem {
71     GtkContainer parent;
72 };
73
74 struct _HildonGridItemClass {
75     GtkContainerClass parent_class;
76 };
77
78
79
80 GType hildon_grid_item_get_type(void);
81 GtkWidget *hildon_grid_item_new(const gchar * icon_basename);
82 GtkWidget *hildon_grid_item_new_with_label(const gchar * icon_basename,
83                                            const gchar * label);
84
85 void hildon_grid_item_set_emblem_type(HildonGridItem * item,
86                                       const gchar * emblem_basename);
87 const gchar *hildon_grid_item_get_emblem_type(HildonGridItem * item);
88 void hildon_grid_item_set_label(HildonGridItem *item, const gchar *label);
89
90
91 G_END_DECLS
92 #endif /* __HILDON_GRID_ITEM_H__ */