2006-11-16 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / src / hildon-weekday-picker.h
1 /*
2  * This file is part of hildon-libs
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.
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_WEEKDAY_PICKER_H__
26 #define __HILDON_WEEKDAY_PICKER_H__
27
28 #include <gtk/gtkcontainer.h>
29
30 G_BEGIN_DECLS
31 /**
32  * HILDON_TYPE_WEEKDAY_PICKER:
33  *
34  * Macro for getting type of weekday picker.
35  * Since: 0.12.10
36  */
37 #define HILDON_TYPE_WEEKDAY_PICKER ( hildon_weekday_picker_get_type() )
38
39 #define HILDON_WEEKDAY_PICKER(obj) \
40         (GTK_CHECK_CAST (obj, HILDON_TYPE_WEEKDAY_PICKER, \
41          HildonWeekdayPicker))
42 #define HILDON_WEEKDAY_PICKER_CLASS(klass) \
43         (GTK_CHECK_CLASS_CAST ((klass), \
44          HILDON_TYPE_WEEKDAY_PICKER, HildonWeekdayPickerClass))
45 #define HILDON_IS_WEEKDAY_PICKER(obj) \
46         (GTK_CHECK_TYPE (obj, HILDON_TYPE_WEEKDAY_PICKER))
47 #define HILDON_IS_WEEKDAY_PICKER_CLASS(klass) \
48         (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_WEEKDAY_PICKER))
49 /**
50  * HildonWeekdayPicker:
51  *
52  * Internal struct for weekday picker.
53  */
54 typedef struct _HildonWeekdayPicker HildonWeekdayPicker;
55 typedef struct _HildonWeekdayPickerClass HildonWeekdayPickerClass;
56
57 struct _HildonWeekdayPicker {
58     GtkContainer parent;
59 };
60
61 struct _HildonWeekdayPickerClass {
62     GtkContainerClass parent_class;
63
64     void (*selection_changed) (HildonWeekdayPicker * self);
65 };
66   
67 GType hildon_weekday_picker_get_type(void) G_GNUC_CONST;
68
69 /**
70  * hildon_weekday_picker_new:
71  *
72  * Creates a new #HildonWeekdayPicker.
73  * 
74  * Return value: New #HildonWeekdayPicker.
75  **/
76 GtkWidget *hildon_weekday_picker_new(void);
77
78 /**
79  * hildon_weekday_picker_set_day:
80  * @picker: #HildonWeekdayPicker.
81  * @day: #GDateWeekday.
82  *
83  * Select specified weekday.
84  *
85  **/
86 void hildon_weekday_picker_set_day(HildonWeekdayPicker * picker,
87                                    GDateWeekday day);
88
89 /**
90  * hildon_weekday_picker_unset_day:
91  * @picker: #HildonWeekdayPicker.
92  * @day: #GDateWeekday.
93  *
94  * Unselect specified weekday.
95  *
96  **/
97 void hildon_weekday_picker_unset_day(HildonWeekdayPicker * picker,
98                                      GDateWeekday day);
99
100 /**
101  * hildon_weekday_picker_toggle_day:
102  * @picker: #HildonWeekdayPicker.
103  * @day: #GDateWeekday.
104  *
105  * Toggle current status of the specified weekday.
106  *
107  **/
108 void hildon_weekday_picker_toggle_day(HildonWeekdayPicker * picker,
109                                       GDateWeekday day);
110
111 /**
112  * hildon_weekday_picker_set_all:
113  * @picker: #HildonWeekdayPicker.
114  *
115  * Select all weekdays. 
116  *
117  **/
118 void hildon_weekday_picker_set_all(HildonWeekdayPicker * picker);
119
120 /**
121  * hildon_weekday_picker_unset_all:
122  * @picker: #HildonWeekdayPicker.
123  *
124  * Unselect all weekdays. 
125  *
126  **/
127 void hildon_weekday_picker_unset_all(HildonWeekdayPicker * picker);
128
129 /**
130  * hildon_weekday_picker_isset_day:
131  * @picker: #HildonWeekdayPicker.
132  * @day: #GDateWeekday.
133  *
134  * Check if the specified weekday is set. 
135  *
136  * Return value: Set/not set.
137  **/
138 gboolean hildon_weekday_picker_isset_day(HildonWeekdayPicker * picker,
139                                          GDateWeekday day);
140
141 G_END_DECLS
142 #endif /* __HILDON_WEEKDAY_PICKER_H__ */