36c8ea5e47554e4c571bf75b2df8fb87f2aa7e01
[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                                        <gtk/gtk.h>
23 #include                                        "hildon-helper.h"
24
25 G_BEGIN_DECLS
26
27 #define                                         HILDON_TYPE_BUTTON \
28                                                 (hildon_button_get_type())
29
30 #define                                         HILDON_BUTTON(obj) \
31                                                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
32                                                 HILDON_TYPE_BUTTON, HildonButton))
33
34 #define                                         HILDON_BUTTON_CLASS(klass) \
35                                                 (G_TYPE_CHECK_CLASS_CAST ((klass), \
36                                                 HILDON_TYPE_BUTTON, HildonButtonClass))
37
38 #define                                         HILDON_IS_BUTTON(obj) \
39                                                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_BUTTON))
40
41 #define                                         HILDON_IS_BUTTON_CLASS(klass) \
42                                                 (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_BUTTON))
43
44 #define                                         HILDON_BUTTON_GET_CLASS(obj) \
45                                                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
46                                                 HILDON_TYPE_BUTTON, HildonButtonClass))
47
48 typedef struct                                  _HildonButton HildonButton;
49
50 typedef struct                                  _HildonButtonClass HildonButtonClass;
51
52 struct                                          _HildonButtonClass
53 {
54     GtkButtonClass parent_class;
55 };
56
57 struct                                          _HildonButton
58 {
59     GtkButton parent;
60 };
61
62 typedef enum {
63    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
64    HILDON_BUTTON_ARRANGEMENT_VERTICAL
65 }                                               HildonButtonArrangement;
66
67 GType
68 hildon_button_get_type                          (void) G_GNUC_CONST;
69
70 GtkWidget *
71 hildon_button_new                               (HildonSizeType          size,
72                                                  HildonButtonArrangement arrangement);
73
74 GtkWidget *
75 hildon_button_new_with_text                     (HildonSizeType           size,
76                                                  HildonButtonArrangement  arrangement,
77                                                  const gchar             *title,
78                                                  const gchar             *value);
79
80 GtkWidget *
81 hildon_button_new_full                          (HildonSizeType           size,
82                                                  HildonButtonArrangement  arrangement,
83                                                  const gchar             *title,
84                                                  const gchar             *value,
85                                                  GtkSizeGroup            *title_size_group,
86                                                  GtkSizeGroup            *value_size_group);
87
88 void
89 hildon_button_set_title                         (HildonButton *button,
90                                                  const gchar  *title);
91
92 void
93 hildon_button_set_value                         (HildonButton *button,
94                                                  const gchar  *value);
95
96 const gchar *
97 hildon_button_get_title                         (HildonButton *button);
98
99 const gchar *
100 hildon_button_get_value                         (HildonButton *button);
101
102 void
103 hildon_button_set_text                          (HildonButton *button,
104                                                  const gchar  *title,
105                                                  const gchar  *value);
106
107 void
108 hildon_button_set_size_groups                   (HildonButton *button,
109                                                  GtkSizeGroup *title_size_group,
110                                                  GtkSizeGroup *value_size_group);
111
112 G_END_DECLS
113
114 #endif /* __HILDON_BUTTON_H__ */