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