Make sure that all timeouts in HildonBanner are removed
[hildon] / hildon / 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 /**
70  * HildonTimeSelectorFormatPolicy:
71  * @HILDON_TIME_SELECTOR_FORMAT_POLICY_AMPM: The time selector will use a AMPM time format
72  * @HILDON_TIME_SELECTOR_FORMAT_POLICY_24H: The time selector will use a 24H time format
73  * @HILDON_TIME_SELECTOR_FORMAT_POLICY_AUTOMATIC: The time selector will use AMPM or 24H depending
74  *  on the current environment
75  *
76  * Describes the time format used at #HildonTimeSelector
77  **/
78 typedef enum {
79   HILDON_TIME_SELECTOR_FORMAT_POLICY_AMPM,
80   HILDON_TIME_SELECTOR_FORMAT_POLICY_24H,
81   HILDON_TIME_SELECTOR_FORMAT_POLICY_AUTOMATIC
82 }                                               HildonTimeSelectorFormatPolicy;
83
84 /* construction */
85 GType
86 hildon_time_selector_get_type                   (void) G_GNUC_CONST;
87
88 GtkWidget*
89 hildon_time_selector_new                        (void);
90
91 GtkWidget*
92 hildon_time_selector_new_step                   (guint minutes_step);
93
94 /* time management */
95 gboolean
96 hildon_time_selector_set_time                   (HildonTimeSelector *selector,
97                                                  guint               hours,
98                                                  guint               minutes);
99
100 void
101 hildon_time_selector_get_time                   (HildonTimeSelector *selector,
102                                                  guint              *hours,
103                                                  guint              *minutes);
104
105 G_END_DECLS
106
107 #endif /* __HILDON_TIME_SELECTOR_H__ */