2008-10-13 Alberto Garcia <agarcia@igalia.com>
[hildon] / src / 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: Karl Lattimer <karl.lattimer@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 typedef struct                                  _HildonButtonPrivate HildonButtonPrivate;
52
53 struct                                          _HildonButtonClass
54 {
55     GtkButtonClass parent_class;
56 };
57
58 struct                                          _HildonButton
59 {
60     GtkButton parent;
61
62     /* private */
63     HildonButtonPrivate *priv;
64 };
65
66 typedef enum {
67    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
68    HILDON_BUTTON_ARRANGEMENT_VERTICAL
69 }                                               HildonButtonArrangement;
70
71 GType
72 hildon_button_get_type                          (void) G_GNUC_CONST;
73
74 GtkWidget *
75 hildon_button_new                               (HildonSizeType          size,
76                                                  HildonButtonArrangement arrangement);
77
78 GtkWidget *
79 hildon_button_new_with_text                     (HildonSizeType           size,
80                                                  HildonButtonArrangement  arrangement,
81                                                  const gchar             *title,
82                                                  const gchar             *value);
83
84 void
85 hildon_button_set_title                         (HildonButton *button,
86                                                  const gchar  *title);
87
88 void
89 hildon_button_set_value                         (HildonButton *button,
90                                                  const gchar  *value);
91
92 const gchar *
93 hildon_button_get_title                         (HildonButton *button);
94
95 const gchar *
96 hildon_button_get_value                         (HildonButton *button);
97
98 void
99 hildon_button_set_text                          (HildonButton *button,
100                                                  const gchar  *title,
101                                                  const gchar  *value);
102
103 void
104 hildon_button_set_image                         (HildonButton *button,
105                                                  GtkWidget    *image);
106
107 GtkWidget *
108 hildon_button_get_image                         (HildonButton *button);
109
110 void
111 hildon_button_set_image_position                (HildonButton    *button,
112                                                  GtkPositionType  position);
113
114 void
115 hildon_button_set_alignment                     (HildonButton *button,
116                                                  gfloat        xalign,
117                                                  gfloat        yalign,
118                                                  gfloat        xscale,
119                                                  gfloat        yscale);
120 void
121 hildon_button_set_title_alignment               (HildonButton *button,
122                                                  gfloat        xalign,
123                                                  gfloat        yalign);
124
125 void
126 hildon_button_set_value_alignment               (HildonButton *button,
127                                                  gfloat        xalign,
128                                                  gfloat        yalign);
129
130 void
131 hildon_button_set_image_alignment               (HildonButton *button,
132                                                  gfloat        xalign,
133                                                  gfloat        yalign);
134
135 void
136 hildon_button_add_title_size_group              (HildonButton *button,
137                                                  GtkSizeGroup *size_group);
138 void
139 hildon_button_add_value_size_group              (HildonButton *button,
140                                                  GtkSizeGroup *size_group);
141
142 void
143 hildon_button_add_image_size_group              (HildonButton *button,
144                                                  GtkSizeGroup *size_group);
145
146 void
147 hildon_button_add_size_groups                   (HildonButton *button,
148                                                  GtkSizeGroup *title_size_group,
149                                                  GtkSizeGroup *value_size_group,
150                                                  GtkSizeGroup *image_size_group);
151
152 G_END_DECLS
153
154 #endif /* __HILDON_BUTTON_H__ */