Remove HILDON_ENABLE_UNSTABLE_API.
[hildon] / src / hildon-time-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_TIME_EDITOR_H__
26 #define                                         __HILDON_TIME_EDITOR_H__
27
28 #include                                        <gtk/gtk.h>
29
30 G_BEGIN_DECLS
31
32 #define                                         HILDON_TYPE_TIME_EDITOR \
33                                                 (hildon_time_editor_get_type())
34
35 #define                                         HILDON_TIME_EDITOR(obj) \
36                                                 (GTK_CHECK_CAST (obj, HILDON_TYPE_TIME_EDITOR, HildonTimeEditor))
37
38 #define                                         HILDON_TIME_EDITOR_CLASS(klass) \
39                                                 (GTK_CHECK_CLASS_CAST ((klass), HILDON_TYPE_TIME_EDITOR, \
40                                                 HildonTimeEditorClass))
41
42 #define                                         HILDON_IS_TIME_EDITOR(obj) \
43                                                 (GTK_CHECK_TYPE (obj, HILDON_TYPE_TIME_EDITOR))
44
45 #define                                         HILDON_IS_TIME_EDITOR_CLASS(klass) \
46                                                 (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_TIME_EDITOR))
47
48 typedef enum 
49 {
50     HILDON_DATE_TIME_ERROR_NO_ERROR = -1,
51     HILDON_DATE_TIME_ERROR_MAX_HOURS,
52     HILDON_DATE_TIME_ERROR_MAX_MINS,
53     HILDON_DATE_TIME_ERROR_MAX_SECS,
54     HILDON_DATE_TIME_ERROR_MAX_DAY,
55     HILDON_DATE_TIME_ERROR_MAX_MONTH,
56     HILDON_DATE_TIME_ERROR_MAX_YEAR,
57     HILDON_DATE_TIME_ERROR_MIN_HOURS,
58     HILDON_DATE_TIME_ERROR_MIN_MINS,
59     HILDON_DATE_TIME_ERROR_MIN_SECS,
60     HILDON_DATE_TIME_ERROR_MIN_DAY,
61     HILDON_DATE_TIME_ERROR_MIN_MONTH,
62     HILDON_DATE_TIME_ERROR_MIN_YEAR,
63     HILDON_DATE_TIME_ERROR_EMPTY_HOURS,
64     HILDON_DATE_TIME_ERROR_EMPTY_MINS,
65     HILDON_DATE_TIME_ERROR_EMPTY_SECS,
66     HILDON_DATE_TIME_ERROR_EMPTY_DAY,
67     HILDON_DATE_TIME_ERROR_EMPTY_MONTH,
68     HILDON_DATE_TIME_ERROR_EMPTY_YEAR,
69     HILDON_DATE_TIME_ERROR_MIN_DURATION,
70     HILDON_DATE_TIME_ERROR_MAX_DURATION,
71     HILDON_DATE_TIME_ERROR_INVALID_CHAR,
72     HILDON_DATE_TIME_ERROR_INVALID_DATE,
73     HILDON_DATE_TIME_ERROR_INVALID_TIME
74 }                                               HildonDateTimeError;
75
76 typedef struct                                  _HildonTimeEditor HildonTimeEditor;
77
78 typedef struct                                  _HildonTimeEditorClass HildonTimeEditorClass;
79
80 struct                                          _HildonTimeEditor 
81 {
82     GtkContainer parent;
83 };
84
85 struct                                          _HildonTimeEditorClass 
86 {
87     GtkContainerClass parent_class;
88
89     gboolean (*time_error) (HildonTimeEditor *editor,
90                             HildonDateTimeError type);
91 };
92
93 GType G_GNUC_CONST
94 hildon_time_editor_get_type                     (void);
95
96 GtkWidget*
97 hildon_time_editor_new                          (void);
98
99 void      
100 hildon_time_editor_set_time                     (HildonTimeEditor *editor,
101                                                  guint hours,
102                                                  guint minutes,
103                                                  guint seconds);
104
105 void       
106 hildon_time_editor_get_time                     (HildonTimeEditor *editor,
107                                                  guint *hours,
108                                                  guint *minutes,
109                                                  guint *seconds);
110
111 void       
112 hildon_time_editor_set_duration_range           (HildonTimeEditor *editor,
113                                                  guint min_seconds,
114                                                  guint max_seconds);
115
116 void       
117 hildon_time_editor_get_duration_range           (HildonTimeEditor *editor,
118                                                  guint *min_seconds,
119                                                  guint *max_seconds);
120
121 void       
122 hildon_time_editor_set_ticks                    (HildonTimeEditor *editor, 
123                                                  guint ticks);
124
125 guint    
126 hildon_time_editor_get_ticks                    (HildonTimeEditor *editor);
127
128 void       
129 hildon_time_editor_set_show_seconds             (HildonTimeEditor *editor, 
130                                                  gboolean show_seconds);
131
132 gboolean
133 hildon_time_editor_get_show_seconds             (HildonTimeEditor *editor);
134
135 void       
136 hildon_time_editor_set_show_hours               (HildonTimeEditor *editor, 
137                                                  gboolean show_hours);
138
139 gboolean  
140 hildon_time_editor_get_show_hours               (HildonTimeEditor *editor);
141
142 void     
143 hildon_time_editor_set_duration_mode            (HildonTimeEditor *editor, 
144                                                  gboolean duration_mode);
145
146 gboolean   
147 hildon_time_editor_get_duration_mode            (HildonTimeEditor *editor);
148
149 void    
150 hildon_time_editor_set_duration_min             (HildonTimeEditor *editor, 
151                                                  guint duration_min);
152
153 guint     
154 hildon_time_editor_get_duration_min             (HildonTimeEditor *editor);
155
156 void    
157 hildon_time_editor_set_duration_max             (HildonTimeEditor *editor, 
158                                                  guint duration_max);
159
160 guint 
161 hildon_time_editor_get_duration_max             (HildonTimeEditor *editor);
162
163 void 
164 hildon_time_editor_get_time_separators          (GtkLabel *hm_sep_label,
165                                                  GtkLabel *ms_sep_label);
166
167 G_END_DECLS
168
169 #endif                                          /* __HILDON_TIME_EDITOR_H__ */