elementary/dayselector - oooops crazy hermet
[framework/uifw/elementary.git] / src / lib / elc_dayselector.h
1 /**
2  * @defgroup Dayselector Dayselector
3  *
4  * @image html img/widget/dayselector/preview-00.png
5  * @image latex img/widget/dayselector/preview-00.eps
6  *
7  * @brief <b>Dayselector widet:</b>
8  *
9  *"elm_dayselector" is a day selection widget. It displays all seven days of
10  * the week and allows the user to select multiple days.
11  *
12  * The selection can be toggle by just clicking on the day.
13  *
14  * Dayselector also provides the functionality to check whether a day is 
15  * selected or not.
16  *
17  * First day of the week is taken from config settings by default. It can be 
18  * altered by using the API elm_dayselector_week_start_set() API.
19  *
20  * APIs are provided for setting the duration of weekend  
21  * elm_dayselector_weekend_start_set() and elm_dayselector_weekend_length_set()
22  * does this job.
23  *
24  * Two styles of weekdays and weekends are supported in Dayselector.
25  * Application can emit signals on individual check objects for setting the 
26  * weekday, weekend styles.
27  *
28  * Once the weekend start day or weekend length changes, all the weekday & 
29  * weekend styles will be reset to default style. It's the application's 
30  * responsibility to set the styles again by sending corresponding signals.
31  *
32  * Supported elm_object_item common APIs.
33  *
34  * @li elm_object_part_text_set,
35  * @li elm_object_part_text_get,
36  * @li elm_object_part_content_set,
37  * @li elm_object_part_content_get,
38  * @li elm_object_part_content_unset
39  *
40  * @li "day0" indicates Sunday, "day1" indicates Monday etc. continues and so,
41  * "day6" indicates the Saturday part name.
42  *
43  * Application can change individual day display string by using the API
44  * elm_object_part_text_set().
45  *
46  * elm_object_part_content_set() API sets the individual day object only if
47  * the passed one is a Check widget.
48  *
49  * Check object representing a day can be set/get by the application by using
50  * the elm_object_part_content_set/get APIs thus providing a way to handle
51  * the different check styles for individual days.
52  *
53  * The widget emits the following signals:
54  *
55  * <b>"dayselector,changed"</b> - This signal is emitted when the user changes 
56  * the state of a day.
57  *
58  * Available styles for dayselector are:
59  * - <b>@c default </b>
60  *
61  * This example shows the usage of the widget.
62  * @li @ref dayselector_example
63  *
64  */
65
66 /**
67  * @addtogroup Dayselector
68  * @{
69  */
70
71 /**
72  * Identifies the day of the week.
73  * API can call the selection/unselection of day with this as a parameter.
74  *
75  * @see elm_dayselector_day_selected_set()
76  * @see elm_dayselector_day_selected_get()
77  */
78 typedef enum
79 {
80    ELM_DAYSELECTOR_SUN = 0,/**< indicates Sunday */
81    ELM_DAYSELECTOR_MON,    /**< indicates Monday */
82    ELM_DAYSELECTOR_TUE,    /**< indicates Tuesday */
83    ELM_DAYSELECTOR_WED,    /**< indicates Wednesday */
84    ELM_DAYSELECTOR_THU,    /**< indicates Thursday */
85    ELM_DAYSELECTOR_FRI,    /**< indicates Friday */
86    ELM_DAYSELECTOR_SAT,    /**< indicates Saturday */
87    ELM_DAYSELECTOR_MAX     /**< Sentinel value, @b don't use */
88 } Elm_Dayselector_Day;
89
90 /**
91  * Add the dayselector.
92  *
93  * @param parent Parent object
94  * @return New dayselector object or @c NULL, if it cannot be created
95  *
96  * @ingroup Dayselector
97  */
98 EAPI Evas_Object *elm_dayselector_add(Evas_Object *parent);
99
100 /**
101  * Set the state of given Dayselector_Day.
102  *
103  * @param obj Dayselector object
104  * @param day Dayselector_Day that the user want to set state.
105  * @param selected state of the day. @c EINA_TRUE is selected.
106  *
107  * @see Elm_Dayselector_Day
108  * @see elm_dayselector_day_selected_get()
109  *
110  */
111 EAPI void   elm_dayselector_day_selected_set(Evas_Object *obj, Elm_Dayselector_Day day, Eina_Bool selected);
112
113 /**
114  * Get the state of given Dayselector_Day.
115  *
116  * @param obj Dayselector object
117  * @param day Dayselector_Day that the user want to know state.
118  * @return @c EINA_TRUE, if the Day is selected
119  *
120  * @see Elm_Dayselector_Day
121  * @see elm_dayselector_day_selected_set()
122  *
123  */
124 EAPI Eina_Bool   elm_dayselector_day_selected_get(const Evas_Object *obj, Elm_Dayselector_Day day);
125
126 /**
127  * Set the starting day of Dayselector.
128  *
129  * @param obj Dayselector object
130  * @param day Dayselector_Day the first day that the user wants to display.
131  *
132  * @see Elm_Dayselector_Day
133  * @see elm_dayselector_week_start_get()
134  *
135  */
136 EAPI void   elm_dayselector_week_start_set(Evas_Object *obj, Elm_Dayselector_Day day);
137
138 /**
139  * Get the starting day of Dayselector.
140  *
141  * @param obj Dayselector object
142  * @return Day from where Dayselector displays all the weekdays in order.
143  *
144  * @see Elm_Dayselector_Day
145  * @see elm_dayselector_week_start_set()
146  *
147  */
148 EAPI Elm_Dayselector_Day   elm_dayselector_week_start_get(const Evas_Object *obj);
149
150 /**
151  * Set the weekend starting day of Dayselector.
152  *
153  * @param obj Dayselector object
154  * @param day Dayselector_Day the first day from where weekend starts.
155  *
156  * @see Elm_Dayselector_Day
157  * @see elm_dayselector_weekend_start_get()
158  *
159  */
160 EAPI void   elm_dayselector_weekend_start_set(Evas_Object *obj, Elm_Dayselector_Day day);
161
162 /**
163  * Get the weekend starting day of Dayselector.
164  *
165  * @param obj Dayselector object
166  * @return Elm_Dayselector_Day Day from where weekend starts.
167  *
168  * @see Elm_Dayselector_Day
169  * @see elm_dayselector_weekend_start_set()
170  *
171  */
172 EAPI Elm_Dayselector_Day   elm_dayselector_weekend_start_get(const Evas_Object *obj);
173
174 /**
175  * Set the weekend length of Dayselector.
176  *
177  * @param obj Dayselector object
178  * @param length Weekend length, number of days as an integer.
179  *
180  * @see elm_dayselector_weekend_length_get()
181  *
182  */
183 EAPI void   elm_dayselector_weekend_length_set(Evas_Object *obj, unsigned int length);
184
185 /**
186  * Get the weekend length of Dayselector.
187  *
188  * @param obj Dayselector object
189  * @return Number of days marked as a weekend.
190  *
191  * @see Elm_Dayselector_Day
192  * @see elm_dayselector_weekend_length_set()
193  *
194  */
195 EAPI unsigned int   elm_dayselector_weekend_length_get(const Evas_Object *obj);
196
197 /**
198  * @}
199  */