/**
+ * @defgroup Calendar Calendar
+ * @ingroup Elementary
+ *
+ * This is a Calendar widget. Calender widget helps applications to flexibly
+ * display a calender with day of the week, day, year and month. Applications will be
+ * able to choose a specific date that will be reported in the smart_callbacks for
+ * the calendar widget. The APIs of calendar widget let the applications perform
+ * other functions like,
+ * placing marks on specific dates
+ * Setting the bounds for the calendar (minimum and maximum years)
+ * Setting the day names of the week. ( for ex. Thu. or Thursday)
+ * Setting the year and month format.
+ *
+ * Signals that you can add callbacks for are:
+ * - @c "changed" - emitted when the date in the calendar is changed.
+ *
+ * Supported elm_object common APIs.
+ * @li @ref elm_object_signal_emit
+ * @li @ref elm_object_signal_callback_add
+ * @li @ref elm_object_signal_callback_del
+ *
+ * Here is some sample code using it:
+ * @li @ref calendar_example_01
+ * @li @ref calendar_example_02
+ * @li @ref calendar_example_03
+ * @li @ref calendar_example_04
+ * @li @ref calendar_example_05
+ * @li @ref calendar_example_06
+ */
+
+/**
* @addtogroup Calendar
* @{
*/
+typedef enum
+{
+ ELM_CALENDAR_UNIQUE, /**< Default value. Marks will be displayed only on event day. */
+ ELM_CALENDAR_DAILY, /**< Marks will be displayed every day after event day (inclusive). */
+ ELM_CALENDAR_WEEKLY, /**< Marks will be displayed every week after event day (inclusive) - i.e. each seven days. */
+ ELM_CALENDAR_MONTHLY, /**< Marks will be displayed every month day that coincides to event day. E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, but will be displayed on 30th Mar*/
+ ELM_CALENDAR_ANNUALLY /**< Marks will be displayed every year that coincides to event day (and month). E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013. */
+} _Elm_Calendar_Mark_Repeat_Type;
+
/**
- * @enum _Elm_Calendar_Mark_Repeat
- * @typedef Elm_Calendar_Mark_Repeat
+ * @enum _Elm_Calendar_Mark_Repeat_Type
+ * @typedef Elm_Calendar_Mark_Repeat_Type
*
* Event periodicity, used to define if a mark should be repeated
* @b beyond event's day. It's set when a mark is added.
* there will be marks every week after this date. Marks will be displayed
* at 13th, 20th, 27th, 3rd June ...
*
- * Values don't work as bitmask, only one can be choosen.
+ * Values don't work as bitmask, only one can be chosen.
*
* @see elm_calendar_mark_add()
*
* @ingroup Calendar
*/
-typedef enum _Elm_Calendar_Mark_Repeat
+typedef _Elm_Calendar_Mark_Repeat_Type Elm_Calendar_Mark_Repeat_Type;
+
+typedef enum
{
- ELM_CALENDAR_UNIQUE, /**< Default value. Marks will be displayed only on event day. */
- ELM_CALENDAR_DAILY, /**< Marks will be displayed everyday after event day (inclusive). */
- ELM_CALENDAR_WEEKLY, /**< Marks will be displayed every week after event day (inclusive) - i.e. each seven days. */
- ELM_CALENDAR_MONTHLY, /**< Marks will be displayed every month day that coincides to event day. E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb, but will be displayed on 30th Mar*/
- ELM_CALENDAR_ANNUALLY /**< Marks will be displayed every year that coincides to event day (and month). E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013. */
-} Elm_Calendar_Mark_Repeat;
+ ELM_DAY_SUNDAY,
+ ELM_DAY_MONDAY,
+ ELM_DAY_TUESDAY,
+ ELM_DAY_WEDNESDAY,
+ ELM_DAY_THURSDAY,
+ ELM_DAY_FRIDAY,
+ ELM_DAY_SATURDAY,
+ ELM_DAY_LAST
+} _Elm_Calendar_Weekday;
+
+/**
+ * @enum _Elm_Calendar_Weekday
+ * @typedef Elm_Calendar_Weekday
+ *
+ * a weekday
+ *
+ * @see elm_calendar_first_day_of_week_set()
+ *
+ * @ingroup Calendar
+ */
+typedef _Elm_Calendar_Weekday Elm_Calendar_Weekday;
+
+
+typedef enum
+{
+ ELM_CALENDAR_SELECT_MODE_DEFAULT = 0, /**< Default value. a day is always selected. */
+ ELM_CALENDAR_SELECT_MODE_ALWAYS, /**< a day is always selected. */
+ ELM_CALENDAR_SELECT_MODE_NONE, /**< None of the days can be selected. */
+ ELM_CALENDAR_SELECT_MODE_ONDEMAND /**< User may have selected a day or not. */
+} _Elm_Calendar_Select_Mode;
+
+/**
+ * @enum _Elm_Calendar_Select_Mode
+ * @typedef Elm_Calendar_Select_Mode
+ *
+ * the mode, who determine how user could select a day
+ *
+ * @see elm_calendar_select_mode_set()
+ *
+ * @ingroup Calendar
+ */
+typedef _Elm_Calendar_Select_Mode Elm_Calendar_Select_Mode;
typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark; /**< Item handle for a calendar mark. Created with elm_calendar_mark_add() and deleted with elm_calendar_mark_del(). */
/**
+ * @typedef Elm_Calendar_Format_Cb
+ *
+ * This callback type is used to format the string that will be used
+ * to display month and year.
+ *
+ * @param stime Struct representing time.
+ * @return String representing time that will be set to calendar's text.
+ *
+ * @see elm_calendar_format_function_set()
+ *
+ * @ingroup Calendar
+ */
+typedef char * (*Elm_Calendar_Format_Cb)(struct tm *stime);
+
+/**
* Add a new calendar widget to the given parent Elementary
* (container) object.
*
*
* @ingroup Calendar
*/
-EAPI Evas_Object *
- elm_calendar_add(Evas_Object *parent)
-EINA_ARG_NONNULL(1);
+EAPI Evas_Object *elm_calendar_add(Evas_Object *parent);
/**
* Get weekdays names displayed by the calendar.
*
* @ingroup Calendar
*/
-EAPI const char **elm_calendar_weekdays_names_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI const char **elm_calendar_weekdays_names_get(const Evas_Object *obj);
/**
* Set weekdays names to be displayed by the calendar.
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_weekdays_names_set(Evas_Object *obj, const char *weekdays[]) EINA_ARG_NONNULL(1, 2);
+EAPI void elm_calendar_weekdays_names_set(Evas_Object *obj, const char *weekdays[]);
/**
* Set the minimum and maximum values for the year
* @param min The minimum year, greater than 1901;
* @param max The maximum year;
*
- * Maximum must be greater than minimum, except if you don't wan't to set
+ * Maximum must be greater than minimum, except if you don't want to set
* maximum year.
* Default values are 1902 and -1.
*
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max);
/**
* Get the minimum and maximum values for the year
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_min_max_year_get(const Evas_Object *obj, int *min, int *max) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_min_max_year_get(const Evas_Object *obj, int *min, int *max);
/**
- * Enable or disable day selection
+ * Set select day mode to use.
*
* @param obj The calendar object.
- * @param enabled @c EINA_TRUE to enable selection or @c EINA_FALSE to
- * disable it.
+ * @param select_mdoe The select mode to use.
*
- * Enabled by default. If disabled, the user still can select months,
- * but not days. Selected days are highlighted on calendar.
- * It should be used if you won't need such selection for the widget usage.
- *
- * When a day is selected, or month is changed, smart callbacks for
- * signal "changed" will be called.
- *
- * @see elm_calendar_day_selection_enable_get()
- *
- * @ref calendar_example_04
+ * Set the day selection mode used.
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_day_selection_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_select_mode_set(Evas_Object *obj, Elm_Calendar_Select_Mode mode);
/**
- * Get a value whether day selection is enabled or not.
- *
- * @see elm_calendar_day_selection_enable_set() for details.
+ * Get the select day mode used.
*
* @param obj The calendar object.
- * @return EINA_TRUE means day selection is enabled. EINA_FALSE indicates
- * it's disabled. If @p obj is NULL, EINA_FALSE is returned.
*
- * @ref calendar_example_05
+ * @return the selected mode
+ *
+ * Get the day selection mode used.
+ *
+ * @see elm_calendar_select_mode_set() for more details
*
* @ingroup Calendar
*/
-EAPI Eina_Bool elm_calendar_day_selection_enabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Elm_Calendar_Select_Mode elm_calendar_select_mode_get(const Evas_Object *obj);
/**
* Set selected date to be highlighted on calendar.
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time);
/**
* Get selected date.
*
* @param obj The calendar object
* @param selected_time A @b tm struct to point to selected date
- * @return EINA_FALSE means an error ocurred and returned time shouldn't
+ * @return EINA_FALSE means an error occurred and returned time shouldn't
* be considered.
*
* Get date selected by the user or set by function
*
* @ingroup Calendar
*/
-EAPI Eina_Bool elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time);
/**
* Set a function to format the string that will be used to display
* month and year;
*
* @param obj The calendar object
- * @param format_function Function to set the month-year string given
+ * @param format_func Function to set the month-year string given
* the selected date
*
* By default it uses strftime with "%B %Y" format string.
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_format_function_set(Evas_Object *obj, char *(*format_function)(struct tm *stime)) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_format_function_set(Evas_Object *obj, Elm_Calendar_Format_Cb format_func);
/**
* Add a new mark to the calendar
*
* @ingroup Calendar
*/
-EAPI Elm_Calendar_Mark *elm_calendar_mark_add(Evas_Object *obj, const char *mark_type, struct tm *mark_time, Elm_Calendar_Mark_Repeat repeat) EINA_ARG_NONNULL(1);
+EAPI Elm_Calendar_Mark *elm_calendar_mark_add(Evas_Object *obj, const char *mark_type, struct tm *mark_time, Elm_Calendar_Mark_Repeat_Type repeat);
/**
* Delete mark from the calendar.
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_mark_del(Elm_Calendar_Mark *mark) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_mark_del(Elm_Calendar_Mark *mark);
/**
* Remove all calendar's marks
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_marks_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_marks_clear(Evas_Object *obj);
/**
* Get a list of all the calendar marks.
*
* @ingroup Calendar
*/
-EAPI const Eina_List *elm_calendar_marks_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI const Eina_List *elm_calendar_marks_get(const Evas_Object *obj);
/**
* Draw calendar marks.
* this function.
*
* When the month is changed, i.e. user selects next or previous month,
- * marks will be drawed.
+ * marks will be drawn.
*
* @see elm_calendar_mark_add()
* @see elm_calendar_mark_del()
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_marks_draw(Evas_Object *obj) EINA_ARG_NONNULL(1);
-
-/**
- * Set a day text color to the same that represents Saturdays.
- *
- * @param obj The calendar object.
- * @param pos The text position. Position is the cell counter, from left
- * to right, up to down. It starts on 0 and ends on 41.
- *
- * @deprecated use elm_calendar_mark_add() instead like:
- *
- * @code
- * struct tm t = { 0, 0, 12, 6, 0, 0, 6, 6, -1 };
- * elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
- * @endcode
- *
- * @see elm_calendar_mark_add()
- *
- * @ingroup Calendar
- */
-EINA_DEPRECATED EAPI void elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1);
-
-/**
- * Set a day text color to the same that represents Sundays.
- *
- * @param obj The calendar object.
- * @param pos The text position. Position is the cell counter, from left
- * to right, up to down. It starts on 0 and ends on 41.
-
- * @deprecated use elm_calendar_mark_add() instead like:
- *
- * @code
- * struct tm t = { 0, 0, 12, 7, 0, 0, 0, 0, -1 };
- * elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY);
- * @endcode
- *
- * @see elm_calendar_mark_add()
- *
- * @ingroup Calendar
- */
-EINA_DEPRECATED EAPI void elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1);
-
-/**
- * Set a day text color to the same that represents Weekdays.
- *
- * @param obj The calendar object
- * @param pos The text position. Position is the cell counter, from left
- * to right, up to down. It starts on 0 and ends on 41.
- *
- * @deprecated use elm_calendar_mark_add() instead like:
- *
- * @code
- * struct tm t = { 0, 0, 12, 1, 0, 0, 0, 0, -1 };
- *
- * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // monday
- * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
- * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // tuesday
- * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
- * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // wednesday
- * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
- * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // thursday
- * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++;
- * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // friday
- * @endcode
- *
- * @see elm_calendar_mark_add()
- *
- * @ingroup Calendar
- */
-EINA_DEPRECATED EAPI void elm_calendar_text_weekday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_marks_draw(Evas_Object *obj);
/**
* Set the interval on time updates for an user mouse button hold
*
* @ingroup Calendar
*/
-EAPI void elm_calendar_interval_set(Evas_Object *obj, double interval) EINA_ARG_NONNULL(1);
+EAPI void elm_calendar_interval_set(Evas_Object *obj, double interval);
/**
* Get the interval on time updates for an user mouse button hold
*
* @ingroup Calendar
*/
-EAPI double elm_calendar_interval_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI double elm_calendar_interval_get(const Evas_Object *obj);
+
+/**
+ * Set the first day of week to use on calendar widgets'.
+ *
+ * @param obj The calendar object
+ * @param day An int which correspond to the first day of the week (Sunday = 0, monday = 1,
+ * ..., saturday = 6)
+ *
+ * @ingroup Calendar
+ */
+EAPI void elm_calendar_first_day_of_week_set(Evas_Object *obj, Elm_Calendar_Weekday day);
+
+/**
+ * Get the first day of week, who are used on calendar widgets'.
+ *
+ * @param obj The calendar object
+ * @return An int which correspond to the first day of the week (Sunday = 0, monday = 1,
+ * ..., saturday = 6)
+ *
+ * @see elm_calendar_first_day_of_week_set() for more details
+ *
+ * @ingroup Calendar
+ */
+EAPI Elm_Calendar_Weekday elm_calendar_first_day_of_week_get(const Evas_Object *obj);
/**
* @}