aboutsummaryrefslogtreecommitdiff
path: root/hildon/hildon-caption.h
blob: 2336a9c06bd718b9dfe078c6cad10e5f41c22fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
 * This file is a part of hildon
 *
 * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
 *
 * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */
 
#ifndef                                         __HILDON_CAPTION_H__
#define                                         __HILDON_CAPTION_H__

#include                                        <gtk/gtk.h>

#include                                        "hildon-enum-types.h"

G_BEGIN_DECLS

typedef struct                                  _HildonCaption HildonCaption;

typedef struct                                  _HildonCaptionClass HildonCaptionClass;

#define                                         HILDON_TYPE_CAPTION (hildon_caption_get_type())

#define                                         HILDON_CAPTION(obj) \
                                                (G_TYPE_CHECK_INSTANCE_CAST (obj, \
                                                HILDON_TYPE_CAPTION, HildonCaption))

#define                                         HILDON_CAPTION_CLASS(klass) \
                                                (G_TYPE_CHECK_CLASS_CAST ((klass),\
                                                HILDON_TYPE_CAPTION, HildonCaptionClass))

#define                                         HILDON_IS_CAPTION(obj) \
                                                (G_TYPE_CHECK_INSTANCE_TYPE (obj, HILDON_TYPE_CAPTION))

#define                                         HILDON_IS_CAPTION_CLASS(klass) \
                                                (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_CAPTION))
    
/**
 * HildonCaptionStatus:
 * @HILDON_CAPTION_OPTIONAL: Optional.
 * @HILDON_CAPTION_MANDATORY: Mandatory.
 *
 * Keys to set the #HildonCaption to be optional or mandatory.
 */
typedef enum
{
    HILDON_CAPTION_OPTIONAL = 0,
    HILDON_CAPTION_MANDATORY
}                                               HildonCaptionStatus;

/**
 * HildonCaptionIconPosition:
 * @HILDON_CAPTION_POSITION_LEFT: Show the icon on the left side.
 * @HILDON_CAPTION_POSITION_RIGHT: Show the icon on the right side.
 *
 * Keys to set the icon placement in #HildonCaption.
 *
 */
typedef enum
{
    HILDON_CAPTION_POSITION_LEFT = 0,
    HILDON_CAPTION_POSITION_RIGHT
}                                               HildonCaptionIconPosition;


struct                                          _HildonCaption
{
    GtkEventBox parent;
};


struct                                          _HildonCaptionClass
{
    GtkEventBoxClass parent_class;
    void (*activate) (HildonCaption *widget);
};

GType G_GNUC_CONST
hildon_caption_get_type                         (void);

GtkWidget* 
hildon_caption_new                              (GtkSizeGroup *group, 
                                                 const gchar *value,
                                                 GtkWidget *control, 
                                                 GtkWidget *icon,
                                                 HildonCaptionStatus flag);

GtkSizeGroup*
hildon_caption_get_size_group                   (const HildonCaption *caption);

void 
hildon_caption_set_size_group                   (const HildonCaption *caption,
                                                 GtkSizeGroup *new_group );

gboolean 
hildon_caption_is_mandatory                     (const HildonCaption *caption);

void 
hildon_caption_set_status                       (HildonCaption *caption,
                                                 HildonCaptionStatus flag);

HildonCaptionStatus
hildon_caption_get_status                       (const HildonCaption *caption);

void 
hildon_caption_set_icon_position                (HildonCaption *caption,
                                                 HildonCaptionIconPosition pos );

HildonCaptionIconPosition
hildon_caption_get_icon_position                (const HildonCaption *caption);

void
hildon_caption_set_icon_image                   (HildonCaption *caption, 
                                                 GtkWidget *icon);

GtkWidget*
hildon_caption_get_icon_image                   (const HildonCaption *caption);

void
hildon_caption_set_label                        (HildonCaption *caption, 
                                                 const gchar *label );

gchar*
hildon_caption_get_label                        (const HildonCaption *caption);

void 
hildon_caption_set_separator                    (HildonCaption *caption, 
                                                 const gchar *separator);

gchar*
hildon_caption_get_separator                    (const HildonCaption *caption);

void 
hildon_caption_set_label_alignment              (HildonCaption *caption, 
                                                 gfloat alignment);

gfloat 
hildon_caption_get_label_alignment              (HildonCaption *caption);

void 
hildon_caption_set_child_expand                 (HildonCaption *caption, 
                                                 gboolean expand);

gboolean 
hildon_caption_get_child_expand                 (const HildonCaption *caption);

void
hildon_caption_set_label_markup                 (HildonCaption *caption,
                                                 const gchar *markup);

G_END_DECLS

#endif                                          /* __HILDON_CAPTION_H__ */