2008-08-08 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 struct                                          _HildonButtonClass
52 {
53     GtkButtonClass parent_class;
54 };
55
56 struct                                          _HildonButton
57 {
58     GtkButton parent;
59 };
60
61 typedef enum {
62    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
63    HILDON_BUTTON_ARRANGEMENT_VERTICAL
64 }                                               HildonButtonArrangement;
65
66 GType
67 hildon_button_get_type                          (void) G_GNUC_CONST;
68
69 GtkWidget *
70 hildon_button_new                               (HildonSizeType          size,
71                                                  HildonButtonArrangement arrangement);
72
73 GtkWidget *
74 hildon_button_new_with_text                     (HildonSizeType           size,
75                                                  HildonButtonArrangement  arrangement,
76                                                  const gchar             *title,
77                                                  const gchar             *value);
78
79 GtkWidget *
80 hildon_button_new_full                          (HildonSizeType           size,
81                                                  HildonButtonArrangement  arrangement,
82                                                  const gchar             *title,
83                                                  const gchar             *value,
84                                                  GtkSizeGroup            *title_size_group,
85                                                  GtkSizeGroup            *value_size_group);
86
87 void
88 hildon_button_set_title                         (HildonButton *button,
89                                                  const gchar  *title);
90
91 void
92 hildon_button_set_value                         (HildonButton *button,
93                                                  const gchar  *value);
94
95 const gchar *
96 hildon_button_get_title                         (HildonButton *button);
97
98 const gchar *
99 hildon_button_get_value                         (HildonButton *button);
100
101 void
102 hildon_button_set_text                          (HildonButton *button,
103                                                  const gchar  *title,
104                                                  const gchar  *value);
105
106 void
107 hildon_button_set_image                         (HildonButton *button,
108                                                  GtkWidget    *image);
109
110 void
111 hildon_button_set_image_position                (HildonButton    *button,
112                                                  GtkPositionType  position);
113
114 void
115 hildon_button_set_size_groups                   (HildonButton *button,
116                                                  GtkSizeGroup *title_size_group,
117                                                  GtkSizeGroup *value_size_group);
118
119 G_END_DECLS
120
121 #endif /* __HILDON_BUTTON_H__ */