2006-09-12 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-caption.h
1 /*
2  * This file is part of hildon-libs
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 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
33 G_BEGIN_DECLS
34
35
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))
45
46     
47 /**
48  * HildonCaptionStatus:
49  * @HILDON_CAPTION_OPTIONAL: Optional.
50  * @HILDON_CAPTION_MANDATORY: Mandatory.
51  *
52  * Keys to set the #HildonCaption to be optional or mandatory.
53  */
54 typedef enum /*< skip >*/
55 {
56     HILDON_CAPTION_OPTIONAL = 0,
57     HILDON_CAPTION_MANDATORY
58 } HildonCaptionStatus;
59
60 #define HILDON_TYPE_CAPTION_STATUS (hildon_caption_status_get_type ())
61
62 GType hildon_caption_status_get_type (void) G_GNUC_CONST;
63
64 /**
65  * HildonCaption:
66  *
67  * Contains only private data.
68  */
69 typedef struct _HildonCaption HildonCaption;
70 typedef struct _HildonCaptionClass HildonCaptionClass;
71
72
73 struct _HildonCaption
74 {
75   GtkEventBox event_box;
76 };
77
78
79 struct _HildonCaptionClass
80 {
81   GtkEventBoxClass parent_class;
82   void (*activate) (HildonCaption *widget);
83 };
84
85
86 GType hildon_caption_get_type (void) G_GNUC_CONST;
87
88 GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
89                                GtkWidget *control, GtkWidget *icon,
90                                HildonCaptionStatus flag );
91 #ifndef HILDON_DISABLE_DEPRECATED
92 GtkSizeGroup *hildon_caption_get_sizegroup( const HildonCaption *caption );
93
94 void hildon_caption_set_sizegroup( const HildonCaption *caption,
95                                    GtkSizeGroup *new_group );
96 #endif
97
98 gboolean hildon_caption_is_mandatory( const HildonCaption *caption );
99
100 void hildon_caption_set_status( HildonCaption *caption,
101                                HildonCaptionStatus flag );
102
103 HildonCaptionStatus hildon_caption_get_status( const HildonCaption *caption );
104
105 void hildon_caption_set_icon_image( HildonCaption *caption, GtkWidget *icon );
106
107 GtkWidget *hildon_caption_get_icon_image(const HildonCaption *caption);
108
109 void hildon_caption_set_label( HildonCaption *caption, const gchar *label );
110
111 gchar *hildon_caption_get_label( const HildonCaption *caption );
112
113 void hildon_caption_set_separator( HildonCaption *caption, 
114                                     const gchar *separator );
115
116 gchar *hildon_caption_get_separator( const HildonCaption *caption );
117
118 void hildon_caption_set_label_alignment(HildonCaption *caption, 
119                                         gfloat alignment);
120 gfloat hildon_caption_get_label_alignment(HildonCaption *caption);
121
122 #ifndef HILDON_DISABLE_DEPRECATED
123 GtkWidget *hildon_caption_get_control( const HildonCaption *caption );
124
125 void hildon_caption_set_control( HildonCaption *caption, GtkWidget *control );
126 #endif
127
128 void hildon_caption_set_child_expand( HildonCaption *caption, gboolean expand );
129 gboolean hildon_caption_get_child_expand( const HildonCaption *caption );
130
131 G_END_DECLS
132 #endif /* __HILDON_CAPTION_H__ */