2 * This file is part of hildon-libs
4 * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
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
11 * the License or any later version.
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
25 #ifndef __HILDON_CAPTION_H__
26 #define __HILDON_CAPTION_H__
29 #include <glib-object.h>
30 #include <gtk/gtkeventbox.h>
31 #include <gtk/gtksizegroup.h>
36 #define HILDON_TYPE_CAPTION ( hildon_caption_get_type() )
37 #define HILDON_CAPTION(obj) \
38 (GTK_CHECK_CAST (obj, HILDON_TYPE_CAPTION, HildonCaption))
39 #define HILDON_CAPTION_CLASS(klass) \
40 (GTK_CHECK_CLASS_CAST ((klass),\
41 HILDON_TYPE_CAPTION, HildonCaptionClass))
42 #define HILDON_IS_CAPTION(obj) (GTK_CHECK_TYPE (obj, HILDON_TYPE_CAPTION))
43 #define HILDON_IS_CAPTION_CLASS(klass) \
44 (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_CAPTION))
48 * HildonCaptionStatus:
49 * @HILDON_CAPTION_OPTIONAL: Optional.
50 * @HILDON_CAPTION_MANDATORY: Mandatory.
52 * Keys to set the #HildonCaption to be optional or mandatory.
54 typedef enum /*< skip >*/
56 HILDON_CAPTION_OPTIONAL = 0,
57 HILDON_CAPTION_MANDATORY
58 } HildonCaptionStatus;
61 * HildonCaptionIconPosition:
62 * @HILDON_CAPTION_POSITION_LEFT: Show the icon on the left side.
63 * @HILDON_CAPTION_POSITION_RIGHT: Show the icon on the right side.
65 * Keys to set the icon placement in #HildonCaption.
69 typedef enum /*< skip >*/
71 HILDON_CAPTION_POSITION_LEFT = 0,
72 HILDON_CAPTION_POSITION_RIGHT
73 } HildonCaptionIconPosition;
75 #define HILDON_TYPE_CAPTION_STATUS (hildon_caption_status_get_type ())
77 #define HILDON_TYPE_CAPTION_ICON_POSITION (hildon_caption_icon_position_get_type ())
79 GType hildon_caption_status_get_type (void) G_GNUC_CONST;
81 GType hildon_caption_icon_position_get_type (void) G_GNUC_CONST;
86 * Contains only private data.
88 typedef struct _HildonCaption HildonCaption;
89 typedef struct _HildonCaptionClass HildonCaptionClass;
94 GtkEventBox event_box;
98 struct _HildonCaptionClass
100 GtkEventBoxClass parent_class;
101 void (*activate) (HildonCaption *widget);
105 GType hildon_caption_get_type (void) G_GNUC_CONST;
107 GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
108 GtkWidget *control, GtkWidget *icon,
109 HildonCaptionStatus flag );
110 #ifndef HILDON_DISABLE_DEPRECATED
111 GtkSizeGroup *hildon_caption_get_sizegroup( const HildonCaption *caption );
113 void hildon_caption_set_sizegroup( const HildonCaption *caption,
114 GtkSizeGroup *new_group );
117 gboolean hildon_caption_is_mandatory( const HildonCaption *caption );
119 void hildon_caption_set_status( HildonCaption *caption,
120 HildonCaptionStatus flag );
122 HildonCaptionStatus hildon_caption_get_status( const HildonCaption *caption );
124 void hildon_caption_set_icon_position( HildonCaption *caption,
125 HildonCaptionIconPosition pos );
127 HildonCaptionIconPosition hildon_caption_get_icon_position( const HildonCaption *caption );
129 void hildon_caption_set_icon_image( HildonCaption *caption, GtkWidget *icon );
131 GtkWidget *hildon_caption_get_icon_image(const HildonCaption *caption);
133 void hildon_caption_set_label( HildonCaption *caption, const gchar *label );
135 gchar *hildon_caption_get_label( const HildonCaption *caption );
137 void hildon_caption_set_separator( HildonCaption *caption,
138 const gchar *separator );
140 gchar *hildon_caption_get_separator( const HildonCaption *caption );
142 void hildon_caption_set_label_alignment(HildonCaption *caption,
144 gfloat hildon_caption_get_label_alignment(HildonCaption *caption);
146 #ifndef HILDON_DISABLE_DEPRECATED
147 GtkWidget *hildon_caption_get_control( const HildonCaption *caption );
149 void hildon_caption_set_control( HildonCaption *caption, GtkWidget *control );
152 void hildon_caption_set_child_expand( HildonCaption *caption, gboolean expand );
153 gboolean hildon_caption_get_child_expand( const HildonCaption *caption );
156 #endif /* __HILDON_CAPTION_H__ */