2008-07-30 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             (hildon_date_selector_get_type ())
28 #define HILDON_DATE_SELECTOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_DATE_SELECTOR, HildonDateSelector))
29 #define HILDON_DATE_SELECTOR_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), HILDON_TYPE_DATE_SELECTOR, HildonDateSelectorClass))
30 #define HILDON_IS_DATE_SELECTOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_DATE_SELECTOR))
31 #define HILDON_IS_DATE_SELECTOR_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_DATE_SELECTOR))
32 #define HILDON_DATE_SELECTOR_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), HILDON_TYPE_DATE_SELECTOR, HildonDateSelectorClass))
33
34 typedef struct _HildonDateSelector HildonDateSelector;
35 typedef struct _HildonDateSelectorClass HildonDateSelectorClass;
36 typedef struct _HildonDateSelectorPrivate HildonDateSelectorPrivate;
37
38 struct _HildonDateSelector
39 {
40   HildonTouchSelector parent_instance;
41
42   /*< private > */
43   HildonDateSelectorPrivate *priv;
44 };
45
46 struct _HildonDateSelectorClass
47 {
48   HildonTouchSelectorClass parent_class;
49
50   /* signals */
51 };
52
53
54 /* construction */
55 GType       hildon_date_selector_get_type         (void) G_GNUC_CONST;
56 GtkWidget * hildon_date_selector_new              (void);
57
58 /* date management */
59 gboolean hildon_date_selector_select_month        (HildonDateSelector * selector,
60                                                    guint month, guint year);
61 void     hildon_date_selector_select_day          (HildonDateSelector * selector, guint day);
62
63 /*
64  * This is an addition to the current hildon-calendar API,
65  * probably we'll require to set the whole date, and not the
66  * current two-step (year,month)+(day)
67  *
68  */
69
70 gboolean hildon_date_selector_select_current_date (HildonDateSelector * selector,
71                                                    guint year, guint month, guint day);
72 void     hildon_date_selector_get_date            (HildonDateSelector * selector,
73                                                    guint * year, guint * month, guint * day);
74
75 G_END_DECLS
76
77 #endif /* __HILDON_DATE_SELECTOR_H__ */