import SDK release
[hildon] / hildon-widgets / hildon-time-editor.h
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Luc Pionchon <luc.pionchon@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; either 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/gtkcontainer.h>
29
30 G_BEGIN_DECLS
31 #define HILDON_TYPE_TIME_EDITOR ( hildon_time_editor_get_type() )
32 #define HILDON_TIME_EDITOR(obj) (GTK_CHECK_CAST (obj,\
33         HILDON_TYPE_TIME_EDITOR, HildonTimeEditor))
34 #define HILDON_TIME_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass),\
35         HILDON_TYPE_TIME_EDITOR, HildonTimeEditorClass))
36 #define HILDON_IS_TIME_EDITOR(obj) (GTK_CHECK_TYPE (obj,\
37         HILDON_TYPE_TIME_EDITOR))
38 #define HILDON_IS_TIME_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass),\
39         HILDON_TYPE_TIME_EDITOR))
40 typedef struct _HildonTimeEditor HildonTimeEditor;
41 typedef struct _HildonTimeEditorClass HildonTimeEditorClass;
42
43 struct _HildonTimeEditor {
44     GtkContainer parent;
45 };
46
47 struct _HildonTimeEditorClass {
48     GtkContainerClass parent_class;
49 };
50
51 /**
52  * HildonTimeEditorField:
53  * @HILDON_TIME_EDITOR_HOUR_FIELD: select and highlight hour field.
54  * @HILDON_TIME_EDITOR_MINUTE_FIELD: select and highlight minute field.
55  * @HILDON_TIME_EDITOR_SECOND_FIELD: select and highlight second field.
56  *
57  * These values are used to indicate which editor field should be highlighted.
58  */
59 typedef enum {
60     HILDON_TIME_EDITOR_HOUR_FIELD,
61     HILDON_TIME_EDITOR_MINUTE_FIELD,
62     HILDON_TIME_EDITOR_SECOND_FIELD
63 } HildonTimeEditorField;
64
65 GType hildon_time_editor_get_type(void);
66 GtkWidget *hildon_time_editor_new(void);
67
68 void hildon_time_editor_set_time(HildonTimeEditor * editor, guint hours,
69                                  guint minutes, guint seconds);
70 void hildon_time_editor_get_time(HildonTimeEditor * editor, guint * hours,
71                                  guint * minutes, guint * seconds);
72
73 void hildon_time_editor_show_seconds(HildonTimeEditor * editor,
74                                      gboolean enable);
75 void hildon_time_editor_enable_duration_mode(HildonTimeEditor * editor,
76                                              gboolean enable);
77
78 void hildon_time_editor_set_duration_range(HildonTimeEditor * editor,
79                                            guint min_seconds,
80                                            guint max_seconds);
81 void hildon_time_editor_get_duration_range(HildonTimeEditor * editor,
82                                            guint * min_seconds,
83                                            guint * max_seconds);
84
85
86 G_END_DECLS
87 #endif