proper fix to #19468
[hildon] / hildon-widgets / hildon-date-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_DATE_EDITOR_H__
26 #define __HILDON_DATE_EDITOR_H__
27
28 #include <gtk/gtkcontainer.h>
29
30 G_BEGIN_DECLS
31 /**
32  * HILDON_DATE_EDITOR_TYPE:
33  *
34  * Macro for getting type of date editor.
35  */
36 #define HILDON_DATE_EDITOR_TYPE ( hildon_date_editor_get_type() )
37 #define HILDON_DATE_EDITOR(obj) (GTK_CHECK_CAST (obj,\
38   HILDON_DATE_EDITOR_TYPE, HildonDateEditor))
39 #define HILDON_DATE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass),\
40   HILDON_DATE_EDITOR_TYPE, HildonDateEditorClass))
41 #define HILDON_IS_DATE_EDITOR(obj) (GTK_CHECK_TYPE (obj,\
42   HILDON_DATE_EDITOR_TYPE))
43 #define HILDON_IS_DATE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass),\
44   HILDON_DATE_EDITOR_TYPE))
45
46 /**
47  * HildonDateEditor:
48  *
49  * Internal struct for date editor.
50  */
51 typedef struct _HildonDateEditor HildonDateEditor;
52 typedef struct _HildonDateEditorClass HildonDateEditorClass;
53
54 typedef enum
55 {
56   MAX_DAY,
57   MAX_MONTH,
58   MAX_YEAR,
59   MIN_DAY,
60   MIN_MONTH,
61   MIN_YEAR,
62   EMPTY_DAY,
63   EMPTY_MONTH,
64   EMPTY_YEAR,
65   INVALID_DATE
66     
67 }HildonDateEditorErrorType;
68
69 struct _HildonDateEditor {
70     GtkContainer par;
71 };
72
73 struct _HildonDateEditorClass {
74     GtkContainerClass parent_class;
75
76     gboolean (*date_error) (HildonDateEditor *editor, 
77                             HildonDateEditorErrorType type);
78 };
79
80 GType hildon_date_editor_get_type(void);
81
82 GtkWidget *hildon_date_editor_new(void);
83
84 void hildon_date_editor_set_date(HildonDateEditor * date,
85                                  guint year, guint month, guint day);
86
87 void hildon_date_editor_get_date(HildonDateEditor * date,
88                                  guint * year, guint * month, guint * day);
89
90 gboolean hildon_date_editor_set_year(HildonDateEditor *editor, guint year);
91 gboolean hildon_date_editor_set_month(HildonDateEditor *editor, guint month);
92 gboolean hildon_date_editor_set_day(HildonDateEditor *editor, guint day);
93
94 guint hildon_date_editor_get_year(HildonDateEditor *editor);
95 guint hildon_date_editor_get_month(HildonDateEditor *editor);
96 guint hildon_date_editor_get_day(HildonDateEditor *editor);
97
98 G_END_DECLS
99 #endif