2009-01-13 Claudio Saavedra <csaavedra@igalia.com>
[hildon] / src / hildon-date-selector.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2005, 2008 Nokia Corporation.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version. or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef                                         __HILDON_DATE_SELECTOR_H__
22 #define                                         __HILDON_DATE_SELECTOR_H__
23
24 #include                                        "hildon-touch-selector.h"
25
26 G_BEGIN_DECLS
27 #define                                         HILDON_TYPE_DATE_SELECTOR \
28                                                 (hildon_date_selector_get_type ())
29
30 #define                                         HILDON_DATE_SELECTOR(obj) \
31                                                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
32                                                 HILDON_TYPE_DATE_SELECTOR, HildonDateSelector))
33
34 #define                                         HILDON_DATE_SELECTOR_CLASS(vtable) \
35                                                 (G_TYPE_CHECK_CLASS_CAST ((vtable), \
36                                                 HILDON_TYPE_DATE_SELECTOR, HildonDateSelectorClass))
37
38 #define                                         HILDON_IS_DATE_SELECTOR(obj) \
39                                                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_DATE_SELECTOR))
40
41 #define                                         HILDON_IS_DATE_SELECTOR_CLASS(vtable) \
42                                                 (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_DATE_SELECTOR))
43
44 #define                                         HILDON_DATE_SELECTOR_GET_CLASS(inst) \
45                                                 (G_TYPE_INSTANCE_GET_CLASS ((inst), \
46                                                 HILDON_TYPE_DATE_SELECTOR, HildonDateSelectorClass))
47
48 typedef struct                                  _HildonDateSelector HildonDateSelector;
49 typedef struct                                  _HildonDateSelectorClass HildonDateSelectorClass;
50 typedef struct                                  _HildonDateSelectorPrivate HildonDateSelectorPrivate;
51
52 struct                                          _HildonDateSelector
53 {
54   HildonTouchSelector parent_instance;
55
56   /*< private > */
57   HildonDateSelectorPrivate *priv;
58 };
59
60 struct                                          _HildonDateSelectorClass
61 {
62   HildonTouchSelectorClass parent_class;
63
64   /* signals */
65 };
66
67
68 /* construction */
69 GType
70 hildon_date_selector_get_type                   (void) G_GNUC_CONST;
71
72 GtkWidget*
73 hildon_date_selector_new                        (void);
74
75 /* date management */
76 gboolean
77 hildon_date_selector_select_month               (HildonDateSelector *selector,
78                                                  guint               month,
79                                                  guint               year);
80
81 void
82 hildon_date_selector_select_day                 (HildonDateSelector *selector,
83                                                  guint               day);
84
85 gboolean
86 hildon_date_selector_select_current_date        (HildonDateSelector *selector,
87                                                  guint               year,
88                                                  guint               month,
89                                                  guint               day);
90
91 void
92 hildon_date_selector_get_date                   (HildonDateSelector *selector,
93                                                  guint              *year,
94                                                  guint              *month,
95                                                  guint              *day);
96
97 G_END_DECLS
98
99 #endif /* __HILDON_DATE_SELECTOR_H__ */