Make sure that all timeouts in HildonBanner are removed
[hildon] / hildon / hildon-button.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2008 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser Public License as published by
10  * the Free Software Foundation; version 2 of the license.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser Public License for more details.
16  *
17  */
18
19 #ifndef                                         __HILDON_BUTTON_H__
20 #define                                         __HILDON_BUTTON_H__
21
22 #include                                        "hildon-gtk.h"
23
24 G_BEGIN_DECLS
25
26 #define                                         HILDON_TYPE_BUTTON \
27                                                 (hildon_button_get_type())
28
29 #define                                         HILDON_BUTTON(obj) \
30                                                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
31                                                 HILDON_TYPE_BUTTON, HildonButton))
32
33 #define                                         HILDON_BUTTON_CLASS(klass) \
34                                                 (G_TYPE_CHECK_CLASS_CAST ((klass), \
35                                                 HILDON_TYPE_BUTTON, HildonButtonClass))
36
37 #define                                         HILDON_IS_BUTTON(obj) \
38                                                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_BUTTON))
39
40 #define                                         HILDON_IS_BUTTON_CLASS(klass) \
41                                                 (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_BUTTON))
42
43 #define                                         HILDON_BUTTON_GET_CLASS(obj) \
44                                                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
45                                                 HILDON_TYPE_BUTTON, HildonButtonClass))
46
47 typedef struct                                  _HildonButton HildonButton;
48
49 typedef struct                                  _HildonButtonClass HildonButtonClass;
50
51 struct                                          _HildonButtonClass
52 {
53     GtkButtonClass parent_class;
54 };
55
56 struct                                          _HildonButton
57 {
58     GtkButton parent;
59 };
60
61
62 /**
63  * HildonButtonArrangement:
64  * @HILDON_BUTTON_ARRANGEMENT_HORIZONTAL: Labels are arranged from left to right
65  * @HILDON_BUTTON_ARRANGEMENT_VERTICAL: Labels are arranged from top to bottom
66  *
67  * Describes the arrangement of labels inside a #HildonButton
68  *
69  **/
70 typedef enum {
71    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
72    HILDON_BUTTON_ARRANGEMENT_VERTICAL
73 }                                               HildonButtonArrangement;
74
75 /**
76  * HildonButtonStyle:
77  * @HILDON_BUTTON_STYLE_NORMAL: The button will look like a normal #HildonButton
78  * @HILDON_BUTTON_STYLE_PICKER: The button will look like a #HildonPickerButton
79  *
80  * Describes the visual style of a #HildonButton
81  **/
82 typedef enum {
83    HILDON_BUTTON_STYLE_NORMAL,
84    HILDON_BUTTON_STYLE_PICKER
85 }                                               HildonButtonStyle;
86
87 GType
88 hildon_button_get_type                          (void) G_GNUC_CONST;
89
90 GtkWidget *
91 hildon_button_new                               (HildonSizeType          size,
92                                                  HildonButtonArrangement arrangement);
93
94 GtkWidget *
95 hildon_button_new_with_text                     (HildonSizeType           size,
96                                                  HildonButtonArrangement  arrangement,
97                                                  const gchar             *title,
98                                                  const gchar             *value);
99
100 void
101 hildon_button_set_title                         (HildonButton *button,
102                                                  const gchar  *title);
103
104 void
105 hildon_button_set_value                         (HildonButton *button,
106                                                  const gchar  *value);
107
108 const gchar *
109 hildon_button_get_title                         (HildonButton *button);
110
111 const gchar *
112 hildon_button_get_value                         (HildonButton *button);
113
114 void
115 hildon_button_set_text                          (HildonButton *button,
116                                                  const gchar  *title,
117                                                  const gchar  *value);
118
119 void
120 hildon_button_set_image                         (HildonButton *button,
121                                                  GtkWidget    *image);
122
123 GtkWidget *
124 hildon_button_get_image                         (HildonButton *button);
125
126 void
127 hildon_button_set_image_position                (HildonButton    *button,
128                                                  GtkPositionType  position);
129
130 void
131 hildon_button_set_alignment                     (HildonButton *button,
132                                                  gfloat        xalign,
133                                                  gfloat        yalign,
134                                                  gfloat        xscale,
135                                                  gfloat        yscale);
136 void
137 hildon_button_set_title_alignment               (HildonButton *button,
138                                                  gfloat        xalign,
139                                                  gfloat        yalign);
140
141 void
142 hildon_button_set_value_alignment               (HildonButton *button,
143                                                  gfloat        xalign,
144                                                  gfloat        yalign);
145
146 void
147 hildon_button_set_image_alignment               (HildonButton *button,
148                                                  gfloat        xalign,
149                                                  gfloat        yalign);
150
151 void
152 hildon_button_add_title_size_group              (HildonButton *button,
153                                                  GtkSizeGroup *size_group);
154 void
155 hildon_button_add_value_size_group              (HildonButton *button,
156                                                  GtkSizeGroup *size_group);
157
158 void
159 hildon_button_add_image_size_group              (HildonButton *button,
160                                                  GtkSizeGroup *size_group);
161
162 void
163 hildon_button_add_size_groups                   (HildonButton *button,
164                                                  GtkSizeGroup *title_size_group,
165                                                  GtkSizeGroup *value_size_group,
166                                                  GtkSizeGroup *image_size_group);
167
168 void
169 hildon_button_set_style                         (HildonButton      *button,
170                                                  HildonButtonStyle  style);
171
172 HildonButtonStyle
173 hildon_button_get_style                         (HildonButton *button);
174
175 G_END_DECLS
176
177 #endif /* __HILDON_BUTTON_H__ */