2008-03-03 Sven Herzberg <sven@imendio.com>
[hildon] / src / hildon-date-editor.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
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, or (at your option) any later version.
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_DATE_EDITOR_H__
26 #define                                         __HILDON_DATE_EDITOR_H__
27
28 #include                                        <gtk/gtkcontainer.h>
29 #include                                        "hildon-time-editor.h"
30
31 G_BEGIN_DECLS
32
33 #define                                         HILDON_TYPE_DATE_EDITOR \
34                                                 (hildon_date_editor_get_type())
35
36 #define                                         HILDON_DATE_EDITOR(obj) \
37                                                 (GTK_CHECK_CAST (obj,\
38                                                 HILDON_TYPE_DATE_EDITOR, HildonDateEditor))
39
40 #define                                         HILDON_DATE_EDITOR_CLASS(klass) \
41                                                 (GTK_CHECK_CLASS_CAST ((klass),\
42                                                 HILDON_TYPE_DATE_EDITOR, HildonDateEditorClass))
43
44 #define                                         HILDON_IS_DATE_EDITOR(obj) \
45                                                 (GTK_CHECK_TYPE (obj,\
46                                                 HILDON_TYPE_DATE_EDITOR))
47
48 #define                                         HILDON_IS_DATE_EDITOR_CLASS(klass) \
49                                                 (GTK_CHECK_CLASS_TYPE ((klass),\
50                                                 HILDON_TYPE_DATE_EDITOR))
51
52 typedef struct                                  _HildonDateEditor HildonDateEditor;
53
54 typedef struct                                  _HildonDateEditorClass HildonDateEditorClass;
55
56
57 struct                                          _HildonDateEditor 
58 {
59     GtkContainer parent;
60 };
61
62 struct                                          _HildonDateEditorClass 
63 {
64     GtkContainerClass parent_class;
65
66     gboolean (*date_error) (HildonDateEditor *editor, HildonDateTimeError type);
67 };
68
69 GType G_GNUC_CONST
70 hildon_date_editor_get_type                     (void);
71
72 GtkWidget*
73 hildon_date_editor_new                          (void);
74
75 void 
76 hildon_date_editor_set_date                     (HildonDateEditor *date,
77                                                  guint year, 
78                                                  guint month, 
79                                                  guint day);
80
81 void 
82 hildon_date_editor_get_date                     (HildonDateEditor *date,
83                                                  guint *year, 
84                                                  guint *month, 
85                                                  guint *day);
86
87 gboolean 
88 hildon_date_editor_set_year                     (HildonDateEditor *editor, 
89                                                  guint year);
90
91 gboolean 
92 hildon_date_editor_set_month                    (HildonDateEditor *editor, 
93                                                  guint month);
94
95 gboolean hildon_date_editor_set_day             (HildonDateEditor *editor, 
96                                                  guint day);
97
98 guint
99 hildon_date_editor_get_year                     (HildonDateEditor *editor);
100
101 guint
102 hildon_date_editor_get_month                    (HildonDateEditor *editor);
103
104 guint
105 hildon_date_editor_get_day                      (HildonDateEditor *editor);
106
107 G_END_DECLS
108
109 #endif                                          /* __HILDON_DATE_EDITOR_H__ */