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