2008-03-03 Sven Herzberg <sven@imendio.com>
[hildon] / src / hildon-caption.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
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, or (at your option) any later version.
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 #ifndef                                         __HILDON_CAPTION_H__
26 #define                                         __HILDON_CAPTION_H__
27
28 #include                                        <glib.h>
29 #include                                        <glib-object.h>
30 #include                                        <gtk/gtkeventbox.h>
31 #include                                        <gtk/gtksizegroup.h>
32 #include                                        "hildon-enum-types.h"
33
34 G_BEGIN_DECLS
35
36 typedef struct                                  _HildonCaption HildonCaption;
37
38 typedef struct                                  _HildonCaptionClass HildonCaptionClass;
39
40 #define                                         HILDON_TYPE_CAPTION (hildon_caption_get_type())
41
42 #define                                         HILDON_CAPTION(obj) \
43                                                 (GTK_CHECK_CAST (obj, HILDON_TYPE_CAPTION, HildonCaption))
44
45 #define                                         HILDON_CAPTION_CLASS(klass) \
46                                                 (GTK_CHECK_CLASS_CAST ((klass),\
47                                                 HILDON_TYPE_CAPTION, HildonCaptionClass))
48
49 #define                                         HILDON_IS_CAPTION(obj) \
50                                                 (GTK_CHECK_TYPE (obj, HILDON_TYPE_CAPTION))
51
52 #define                                         HILDON_IS_CAPTION_CLASS(klass) \
53                                                 (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_CAPTION))
54     
55 /**
56  * HildonCaptionStatus:
57  * @HILDON_CAPTION_OPTIONAL: Optional.
58  * @HILDON_CAPTION_MANDATORY: Mandatory.
59  *
60  * Keys to set the #HildonCaption to be optional or mandatory.
61  */
62 typedef enum
63 {
64     HILDON_CAPTION_OPTIONAL = 0,
65     HILDON_CAPTION_MANDATORY
66 }                                               HildonCaptionStatus;
67
68 /**
69  * HildonCaptionIconPosition:
70  * @HILDON_CAPTION_POSITION_LEFT: Show the icon on the left side.
71  * @HILDON_CAPTION_POSITION_RIGHT: Show the icon on the right side.
72  *
73  * Keys to set the icon placement in #HildonCaption.
74  *
75  */
76 typedef enum
77 {
78     HILDON_CAPTION_POSITION_LEFT = 0,
79     HILDON_CAPTION_POSITION_RIGHT
80 }                                               HildonCaptionIconPosition;
81
82
83 struct                                          _HildonCaption
84 {
85     GtkEventBox parent;
86 };
87
88
89 struct                                          _HildonCaptionClass
90 {
91     GtkEventBoxClass parent_class;
92     void (*activate) (HildonCaption *widget);
93 };
94
95 GType G_GNUC_CONST
96 hildon_caption_get_type                         (void);
97
98 GtkWidget* 
99 hildon_caption_new                              (GtkSizeGroup *group, 
100                                                  const gchar *value,
101                                                  GtkWidget *control, 
102                                                  GtkWidget *icon,
103                                                  HildonCaptionStatus flag);
104
105 GtkSizeGroup*
106 hildon_caption_get_size_group                   (const HildonCaption *caption);
107
108 void 
109 hildon_caption_set_size_group                   (const HildonCaption *caption,
110                                                  GtkSizeGroup *new_group );
111
112 gboolean 
113 hildon_caption_is_mandatory                     (const HildonCaption *caption);
114
115 void 
116 hildon_caption_set_status                       (HildonCaption *caption,
117                                                  HildonCaptionStatus flag);
118
119 HildonCaptionStatus
120 hildon_caption_get_status                       (const HildonCaption *caption);
121
122 void 
123 hildon_caption_set_icon_position                (HildonCaption *caption,
124                                                  HildonCaptionIconPosition pos );
125
126 HildonCaptionIconPosition
127 hildon_caption_get_icon_position                (const HildonCaption *caption);
128
129 void
130 hildon_caption_set_icon_image                   (HildonCaption *caption, 
131                                                  GtkWidget *icon);
132
133 GtkWidget*
134 hildon_caption_get_icon_image                   (const HildonCaption *caption);
135
136 void
137 hildon_caption_set_label                        (HildonCaption *caption, 
138                                                  const gchar *label );
139
140 gchar*
141 hildon_caption_get_label                        (const HildonCaption *caption);
142
143 void 
144 hildon_caption_set_separator                    (HildonCaption *caption, 
145                                                  const gchar *separator);
146
147 gchar*
148 hildon_caption_get_separator                    (const HildonCaption *caption);
149
150 void 
151 hildon_caption_set_label_alignment              (HildonCaption *caption, 
152                                                  gfloat alignment);
153
154 gfloat 
155 hildon_caption_get_label_alignment              (HildonCaption *caption);
156
157 void 
158 hildon_caption_set_child_expand                 (HildonCaption *caption, 
159                                                  gboolean expand);
160
161 gboolean 
162 hildon_caption_get_child_expand                 (const HildonCaption *caption);
163
164 void
165 hildon_caption_set_label_markup                 (HildonCaption *caption,
166                                                  const gchar *markup);
167
168 G_END_DECLS
169
170 #endif                                          /* __HILDON_CAPTION_H__ */