2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / hildon-widgets / hildon-telephone-editor.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; version 2.1 of
11  * the License.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24
25 #ifndef __HILDON_TELEPHONE_EDITOR_H__
26 #define __HILDON_TELEPHONE_EDITOR_H__
27
28 #include <gtk/gtkcontainer.h>
29
30 G_BEGIN_DECLS
31 /**
32  * HILDON_TELEPHONE_EDITOR_TYPE:
33  *
34  * Macro for getting type of telephone editor.
35  */
36 #define HILDON_TELEPHONE_EDITOR_TYPE \
37   ( hildon_telephone_editor_get_type() )
38 #define HILDON_TELEPHONE_EDITOR(obj) \
39   (GTK_CHECK_CAST (obj, HILDON_TELEPHONE_EDITOR_TYPE, \
40   HildonTelephoneEditor))
41 #define HILDON_TELEPHONE_EDITOR_CLASS(klass) \
42   (GTK_CHECK_CLASS_CAST ((klass), HILDON_TELEPHONE_EDITOR_TYPE, \
43   HildonTelephoneEditorClass))
44 #define HILDON_IS_TELEPHONE_EDITOR(obj) \
45   (GTK_CHECK_TYPE (obj, HILDON_TELEPHONE_EDITOR_TYPE))
46 #define HILDON_IS_TELEPHONE_EDITOR_CLASS(klass) \
47   (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TELEPHONE_EDITOR_TYPE))
48 /**
49  * HildonTelephoneEditorFormat:
50  * @HILDON_TELEPHONE_EDITOR_FORMAT_FREE: Free format.
51  * @HILDON_TELEPHONE_EDITOR_FORMAT_COERCE: Coerce format, three fields.
52  * @HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY: Coerce format, only
53  * country field.
54  * @HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA: Coerce format, country
55  * and area fields.
56  * 
57  * Define all possible format modes for the HildonTelephoneEditor.
58  *
59  */
60     typedef enum {
61     HILDON_TELEPHONE_EDITOR_FORMAT_FREE = 0,
62     HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
63     HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
64     HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA
65 } HildonTelephoneEditorFormat;
66
67
68 /**
69  * HildonTelephoneEditor:
70  *
71  * Internal struct for telephone editor.
72  */
73 typedef struct _HildonTelephoneEditor HildonTelephoneEditor;
74 typedef struct _HildonTelephoneEditorClass HildonTelephoneEditorClass;
75
76 /*< private >*/
77 struct _HildonTelephoneEditor {
78     GtkContainer parent;
79 };
80
81 struct _HildonTelephoneEditorClass {
82     GtkContainerClass parent_class;
83 };
84
85 GType hildon_telephone_editor_get_type(void);
86
87 GtkWidget *hildon_telephone_editor_new(HildonTelephoneEditorFormat format);
88 GtkWidget
89     *hildon_telephone_editor_new_with_strings(HildonTelephoneEditorFormat
90                                               format,
91                                               const gchar * country,
92                                               const gchar * area,
93                                               const gchar * number);
94 void hildon_telephone_editor_set_editable(HildonTelephoneEditor * hte,
95                                           gboolean country, gboolean area,
96                                           gboolean number);
97
98 void hildon_telephone_editor_set_show_plus(HildonTelephoneEditor * hte,
99                                            gboolean show);
100
101 gboolean hildon_telephone_editor_get_show_plus(HildonTelephoneEditor *
102                                                hte);
103
104 void hildon_telephone_editor_set_show_border(HildonTelephoneEditor * hte,
105                                              gboolean show);
106
107 gboolean hildon_telephone_editor_get_show_border(HildonTelephoneEditor *
108                                                  hte);
109
110
111 void hildon_telephone_editor_set_widths(HildonTelephoneEditor * hte,
112                                         guint country,
113                                         guint area, guint number);
114
115 const gchar *hildon_telephone_editor_get_country(HildonTelephoneEditor *
116                                                  hte);
117
118 void hildon_telephone_editor_set_country(HildonTelephoneEditor * hte,
119                                          const gchar * country);
120
121 const gchar *hildon_telephone_editor_get_area(HildonTelephoneEditor * hte);
122
123 void hildon_telephone_editor_set_area(HildonTelephoneEditor * hte,
124                                       const gchar * area);
125
126 const gchar *hildon_telephone_editor_get_number(HildonTelephoneEditor *
127                                                 hte);
128
129 void hildon_telephone_editor_set_number(HildonTelephoneEditor * hte,
130                                         const gchar * number);
131
132 G_END_DECLS
133 #endif /* __HILDON_TELEPHONE_EDITOR_H__ */