aboutsummaryrefslogtreecommitdiff
path: root/hildon/hildon-button.h
blob: d3b703cfe07b8bce216bb4c9f1b66ea25e2fe024 (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
170
171
172
173
174
175
176
177
/*
 * This file is a part of hildon
 *
 * Copyright (C) 2008 Nokia Corporation, all rights reserved.
 *
 * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Free Software Foundation; version 2 of the license.
 *
 * This program 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 Public License for more details.
 *
 */

#ifndef                                         __HILDON_BUTTON_H__
#define                                         __HILDON_BUTTON_H__

#include                                        "hildon-gtk.h"

G_BEGIN_DECLS

#define                                         HILDON_TYPE_BUTTON \
                                                (hildon_button_get_type())

#define                                         HILDON_BUTTON(obj) \
                                                (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
                                                HILDON_TYPE_BUTTON, HildonButton))

#define                                         HILDON_BUTTON_CLASS(klass) \
                                                (G_TYPE_CHECK_CLASS_CAST ((klass), \
                                                HILDON_TYPE_BUTTON, HildonButtonClass))

#define                                         HILDON_IS_BUTTON(obj) \
                                                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_BUTTON))

#define                                         HILDON_IS_BUTTON_CLASS(klass) \
                                                (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_BUTTON))

#define                                         HILDON_BUTTON_GET_CLASS(obj) \
                                                (G_TYPE_INSTANCE_GET_CLASS ((obj), \
                                                HILDON_TYPE_BUTTON, HildonButtonClass))

typedef struct                                  _HildonButton HildonButton;

typedef struct                                  _HildonButtonClass HildonButtonClass;

struct                                          _HildonButtonClass
{
    GtkButtonClass parent_class;
};

struct                                          _HildonButton
{
    GtkButton parent;
};


/**
 * HildonButtonArrangement:
 * @HILDON_BUTTON_ARRANGEMENT_HORIZONTAL: Labels are arranged from left to right
 * @HILDON_BUTTON_ARRANGEMENT_VERTICAL: Labels are arranged from top to bottom
 *
 * Describes the arrangement of labels inside a #HildonButton
 *
 **/
typedef enum {
   HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
   HILDON_BUTTON_ARRANGEMENT_VERTICAL
}                                               HildonButtonArrangement;

/**
 * HildonButtonStyle:
 * @HILDON_BUTTON_STYLE_NORMAL: The button will look like a normal #HildonButton
 * @HILDON_BUTTON_STYLE_PICKER: The button will look like a #HildonPickerButton
 *
 * Describes the visual style of a #HildonButton
 **/
typedef enum {
   HILDON_BUTTON_STYLE_NORMAL,
   HILDON_BUTTON_STYLE_PICKER
}                                               HildonButtonStyle;

GType
hildon_button_get_type                          (void) G_GNUC_CONST;

GtkWidget *
hildon_button_new                               (HildonSizeType          size,
                                                 HildonButtonArrangement arrangement);

GtkWidget *
hildon_button_new_with_text                     (HildonSizeType           size,
                                                 HildonButtonArrangement  arrangement,
                                                 const gchar             *title,
                                                 const gchar             *value);

void
hildon_button_set_title                         (HildonButton *button,
                                                 const gchar  *title);

void
hildon_button_set_value                         (HildonButton *button,
                                                 const gchar  *value);

const gchar *
hildon_button_get_title                         (HildonButton *button);

const gchar *
hildon_button_get_value                         (HildonButton *button);

void
hildon_button_set_text                          (HildonButton *button,
                                                 const gchar  *title,
                                                 const gchar  *value);

void
hildon_button_set_image                         (HildonButton *button,
                                                 GtkWidget    *image);

GtkWidget *
hildon_button_get_image                         (HildonButton *button);

void
hildon_button_set_image_position                (HildonButton    *button,
                                                 GtkPositionType  position);

void
hildon_button_set_alignment                     (HildonButton *button,
                                                 gfloat        xalign,
                                                 gfloat        yalign,
                                                 gfloat        xscale,
                                                 gfloat        yscale);
void
hildon_button_set_title_alignment               (HildonButton *button,
                                                 gfloat        xalign,
                                                 gfloat        yalign);

void
hildon_button_set_value_alignment               (HildonButton *button,
                                                 gfloat        xalign,
                                                 gfloat        yalign);

void
hildon_button_set_image_alignment               (HildonButton *button,
                                                 gfloat        xalign,
                                                 gfloat        yalign);

void
hildon_button_add_title_size_group              (HildonButton *button,
                                                 GtkSizeGroup *size_group);
void
hildon_button_add_value_size_group              (HildonButton *button,
                                                 GtkSizeGroup *size_group);

void
hildon_button_add_image_size_group              (HildonButton *button,
                                                 GtkSizeGroup *size_group);

void
hildon_button_add_size_groups                   (HildonButton *button,
                                                 GtkSizeGroup *title_size_group,
                                                 GtkSizeGroup *value_size_group,
                                                 GtkSizeGroup *image_size_group);

void
hildon_button_set_style                         (HildonButton      *button,
                                                 HildonButtonStyle  style);

HildonButtonStyle
hildon_button_get_style                         (HildonButton *button);

G_END_DECLS

#endif /* __HILDON_BUTTON_H__ */