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