2009-03-30 Alberto Garcia <agarcia@igalia.com>
[hildon] / src / hildon-time-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_TIME_SELECTOR_H__
22 #define                                         __HILDON_TIME_SELECTOR_H__
23
24 #include                                        "hildon-touch-selector.h"
25
26 G_BEGIN_DECLS
27
28 #define                                         HILDON_TYPE_TIME_SELECTOR \
29                                                 (hildon_time_selector_get_type ())
30
31 #define                                         HILDON_TIME_SELECTOR(obj) \
32                                                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
33                                                 HILDON_TYPE_TIME_SELECTOR, HildonTimeSelector))
34
35 #define                                         HILDON_TIME_SELECTOR_CLASS(vtable) \
36                                                 (G_TYPE_CHECK_CLASS_CAST ((vtable), \
37                                                 HILDON_TYPE_TIME_SELECTOR, HildonTimeSelectorClass))
38
39 #define                                         HILDON_IS_TIME_SELECTOR(obj) \
40                                                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_TIME_SELECTOR))
41
42 #define                                         HILDON_IS_TIME_SELECTOR_CLASS(vtable) \
43                                                 (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_TIME_SELECTOR))
44
45 #define                                         HILDON_TIME_SELECTOR_GET_CLASS(inst) \
46                                                 (G_TYPE_INSTANCE_GET_CLASS ((inst), \
47                                                 HILDON_TYPE_TIME_SELECTOR, HildonTimeSelectorClass))
48
49 typedef struct                                  _HildonTimeSelector HildonTimeSelector;
50 typedef struct                                  _HildonTimeSelectorClass HildonTimeSelectorClass;
51 typedef struct                                  _HildonTimeSelectorPrivate HildonTimeSelectorPrivate;
52
53 struct                                          _HildonTimeSelector
54 {
55   HildonTouchSelector parent_instance;
56
57   /*< private > */
58   HildonTimeSelectorPrivate *priv;
59 };
60
61 struct                                          _HildonTimeSelectorClass
62 {
63   HildonTouchSelectorClass parent_class;
64
65   /* signals */
66 };
67
68
69 /* construction */
70 GType
71 hildon_time_selector_get_type                   (void) G_GNUC_CONST;
72
73 GtkWidget*
74 hildon_time_selector_new                        (void);
75
76 GtkWidget*
77 hildon_time_selector_new_step                   (guint minutes_step);
78
79 /* time management */
80 gboolean
81 hildon_time_selector_set_time                   (HildonTimeSelector *selector,
82                                                  guint               hours,
83                                                  guint               minutes);
84
85 void
86 hildon_time_selector_get_time                   (HildonTimeSelector *selector,
87                                                  guint              *hours,
88                                                  guint              *minutes);
89
90 G_END_DECLS
91
92 #endif /* __HILDON_TIME_SELECTOR_H__ */