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