- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Typedefs | Functions
Calendar

## Macros
#define | elm_obj_calendar_weekdays_names_set(weekdays) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET), EO_TYPECHECK(const char **, weekdays)
#define | elm_obj_calendar_weekdays_names_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET), EO_TYPECHECK(const char ***, ret)
#define | elm_obj_calendar_interval_set(interval) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET), EO_TYPECHECK(double, interval)
#define | elm_obj_calendar_interval_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET), EO_TYPECHECK(double *, ret)
#define | elm_obj_calendar_min_max_year_set(min, max) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max)
#define | elm_obj_calendar_min_max_year_get(min, max) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max)
#define | elm_obj_calendar_selected_time_set(selected_time) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET), EO_TYPECHECK(struct tm *, selected_time)
#define | elm_obj_calendar_selected_time_get(selected_time, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET), EO_TYPECHECK(struct tm *, selected_time), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_calendar_format_function_set(format_function) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET), EO_TYPECHECK(Elm_Calendar_Format_Cb, format_function)
#define | elm_obj_calendar_mark_add(mark_type, mark_time, repeat, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD), EO_TYPECHECK(const char *, mark_type), EO_TYPECHECK(struct tm *, mark_time), EO_TYPECHECK(Elm_Calendar_Mark_Repeat_Type, repeat), EO_TYPECHECK(Elm_Calendar_Mark **, ret)
#define | elm_obj_calendar_marks_clear() ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR)
#define | elm_obj_calendar_marks_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET), EO_TYPECHECK(const Eina_List **, ret)
#define | elm_obj_calendar_marks_draw() ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW)
#define | elm_obj_calendar_first_day_of_week_set(day) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET), EO_TYPECHECK(Elm_Calendar_Weekday, day)
#define | elm_obj_calendar_first_day_of_week_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET), EO_TYPECHECK(Elm_Calendar_Weekday *, ret)
#define | elm_obj_calendar_select_mode_set(mode) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Calendar_Select_Mode, mode)
#define | elm_obj_calendar_select_mode_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Calendar_Select_Mode *, ret)
#define | elm_obj_calendar_selectable_set(selectable) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET), EO_TYPECHECK(Elm_Calendar_Selectable, selectable)
#define | elm_obj_calendar_selectable_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET), EO_TYPECHECK(Elm_Calendar_Selectable *, ret)
#define | elm_obj_calendar_displayed_time_get(displayed_time, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET), EO_TYPECHECK(struct tm *, displayed_time), EO_TYPECHECK(Eina_Bool *, ret)

## Typedefs
typedef _Elm_Calendar_Mark_Repeat_Type | Elm_Calendar_Mark_Repeat_Type
| Event periodicity, used to define if a mark should be repeated beyond event's day. More...
typedef _Elm_Calendar_Weekday | Elm_Calendar_Weekday
| a weekday More...
typedef _Elm_Calendar_Select_Mode | Elm_Calendar_Select_Mode
| the mode, who determine how user could select a day More...
typedef _Elm_Calendar_Selectable | Elm_Calendar_Selectable
| A bitmask used to define which fields of a tm struct will be taken into account, when elm_calendar_selected_time_set() is invoked. More...
typedef char *(* | Elm_Calendar_Format_Cb )(struct tm *stime)
| This callback type is used to format the string that will be used to display month and year. More...

## Functions
void | elm_calendar_weekdays_names_set (Evas_Object *obj, const char *weekdays[])
| Set weekdays names to be displayed by the calendar. More...
void | elm_calendar_mark_del (Elm_Calendar_Mark *mark)
| Delete mark from the calendar. More...
Evas_Object * | elm_calendar_add (Evas_Object *parent)
| Add a new calendar widget to the given parent Elementary (container) object. More...
const char ** | elm_calendar_weekdays_names_get (const Evas_Object *obj)
| Get weekdays names displayed by the calendar. More...
void | elm_calendar_interval_set (Evas_Object *obj, double interval)
| Set the interval on time updates for an user mouse button hold on calendar widgets' month/year selection. More...
double | elm_calendar_interval_get (const Evas_Object *obj)
| Get the interval on time updates for an user mouse button hold on calendar widgets' month/year selection. More...
void | elm_calendar_min_max_year_set (Evas_Object *obj, int min, int max)
| Set the minimum and maximum values for the year. More...
void | elm_calendar_min_max_year_get (const Evas_Object *obj, int *min, int *max)
| Get the minimum and maximum values for the year. More...
void | elm_calendar_selected_time_set (Evas_Object *obj, struct tm *selected_time)
| Set selected date to be highlighted on calendar. More...
Eina_Bool | elm_calendar_selected_time_get (const Evas_Object *obj, struct tm *selected_time)
| Get selected date. More...
void | elm_calendar_format_function_set (Evas_Object *obj, Elm_Calendar_Format_Cb format_func)
| Set a function to format the string that will be used to display month and year;. More...
Elm_Calendar_Mark * | elm_calendar_mark_add (Evas_Object *obj, const char *mark_type, struct tm *mark_time, Elm_Calendar_Mark_Repeat_Type repeat)
| Add a new mark to the calendar. More...
void | elm_calendar_marks_clear (Evas_Object *obj)
| Remove all calendar's marks. More...
const Eina_List * | elm_calendar_marks_get (const Evas_Object *obj)
| Get a list of all the calendar marks. More...
void | elm_calendar_marks_draw (Evas_Object *obj)
| Draw calendar marks. More...
void | elm_calendar_first_day_of_week_set (Evas_Object *obj, Elm_Calendar_Weekday day)
| Set the first day of week to use on calendar widgets'. More...
Elm_Calendar_Weekday | elm_calendar_first_day_of_week_get (const Evas_Object *obj)
| Get the first day of week, who are used on calendar widgets'. More...
void | elm_calendar_select_mode_set (Evas_Object *obj, Elm_Calendar_Select_Mode mode)
| Set select day mode to use. More...
Elm_Calendar_Select_Mode | elm_calendar_select_mode_get (const Evas_Object *obj)
| Get the select day mode used. More...
void | elm_calendar_selectable_set (Evas_Object *obj, Elm_Calendar_Selectable selectable)
| Define which fields of a tm struct will be taken into account, when elm_calendar_selected_time_set() is invoked. More...
Elm_Calendar_Selectable | elm_calendar_selectable_get (const Evas_Object *obj)
| Get how elm_calendar_selected_time_set manage a date. More...
Eina_Bool | elm_calendar_displayed_time_get (const Evas_Object *obj, struct tm *displayed_time)
| Get the current time displayed in the widget. More...

## Detailed Description

This is a calendar widget. It helps applications to flexibly display a calender with day of the week, date, year and month. Applications are able to set specific dates to be reported back, when selected, in the smart callbacks of the calendar widget. The API of this widget lets 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 (e.g. "Thu" or "Thursday")
- setting the year and month format.

This widget inherits from the Layout one, so that all the functions acting on it also work for calendar objects.

This widget emits the following signals, besides the ones sent from Layout:

- `"changed"` - emitted when the date in the calendar is changed.
- `"display,changed"` - emitted when the current month displayed in the calendar is changed.
- `"focused"` - When the calendar has received focus. (since 1.8)
- `"unfocused"` - When the calendar has lost focus. (since 1.8)

Supported elm_object common APIs.

- elm_object_signal_emit
- elm_object_signal_callback_add
- elm_object_signal_callback_del

Here is some sample code using it:

- Calendar - Simple creation.
- Calendar - Layout strings formatting.
- Calendar - Years restrictions.
- Calendar - Days selection.
- Calendar - Signal callback and getters.
- Calendar - Calendar marks.

## Macro Definition Documentation

#define elm_obj_calendar_displayed_time_get | ( |  | displayed_time,
|  |  | ret
| ) |  | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET), EO_TYPECHECK(struct tm *, displayed_time), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get the current time displayed in the widget

Parameters

  [out] | displayed_time |
  [out] | ret |

See Also
  elm_calendar_displayed_time_get

Referenced by elm_calendar_displayed_time_get().

#define elm_obj_calendar_first_day_of_week_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET), EO_TYPECHECK(Elm_Calendar_Weekday *, ret)

Since
  1.8

Get the first day of week, who are used on calendar widgets'.

Parameters

  [out] | ret |

See Also
  elm_calendar_first_day_of_week_get

Referenced by elm_calendar_first_day_of_week_get().

#define elm_obj_calendar_first_day_of_week_set | ( |  | day | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET), EO_TYPECHECK(Elm_Calendar_Weekday, day)

Since
  1.8

Set the first day of week to use on calendar widgets'.

Parameters

  [in] | day |

See Also
  elm_calendar_first_day_of_week_set

Referenced by elm_calendar_first_day_of_week_set().

#define elm_obj_calendar_format_function_set | ( |  | format_function | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET), EO_TYPECHECK(Elm_Calendar_Format_Cb, format_function)

Since
  1.8

Set a function to format the string that will be used to display to display month and year.

Parameters

  [in] | format_function |

See Also
  elm_calendar_format_function_set

Referenced by elm_calendar_format_function_set().

#define elm_obj_calendar_interval_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

Get the interval on time updates for an user mouse button hold

Parameters

  [out] | ret |

See Also
  elm_calendar_interval_get

Referenced by elm_calendar_interval_get().

#define elm_obj_calendar_interval_set | ( |  | interval | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET), EO_TYPECHECK(double, interval)

Since
  1.8

Set the interval on time updates for an user mouse button hold

Parameters

  [in] | interval |

See Also
  elm_calendar_interval_set

Referenced by elm_calendar_interval_set().

#define elm_obj_calendar_mark_add | ( |  | mark_type,
|  |  | mark_time,
|  |  | repeat,
|  |  | ret
| ) |  | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD), EO_TYPECHECK(const char *, mark_type), EO_TYPECHECK(struct tm *, mark_time), EO_TYPECHECK(Elm_Calendar_Mark_Repeat_Type, repeat), EO_TYPECHECK(Elm_Calendar_Mark **, ret)

Since
  1.8

Add a new mark to the calendar

Parameters

  [in] | mark_type |
  [in] | mark_time |
  [in] | repeat |
  [out] | ret |

See Also
  elm_calendar_mark_add

Referenced by elm_calendar_mark_add().

#define elm_obj_calendar_marks_clear | ( |  | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR)

Since
  1.8

Remove all calendar's marks

See Also
  elm_calendar_marks_clear

Referenced by elm_calendar_marks_clear().

#define elm_obj_calendar_marks_draw | ( |  | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW)

Since
  1.8

Draw calendar marks.

See Also
  elm_calendar_marks_draw

Referenced by elm_calendar_marks_draw().

#define elm_obj_calendar_marks_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET), EO_TYPECHECK(const Eina_List **, ret)

Since
  1.8

Get a list of all the calendar marks.

Parameters

  [out] | ret |

See Also
  elm_calendar_marks_get

Referenced by elm_calendar_marks_get().

#define elm_obj_calendar_min_max_year_get | ( |  | min,
|  |  | max
| ) |  | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max)

Since
  1.8

Get the minimum and maximum values for the year

Parameters

  [out] | min |
  [out] | max |

See Also
  elm_calendar_min_max_year_get

Referenced by elm_calendar_min_max_year_get().

#define elm_obj_calendar_min_max_year_set | ( |  | min,
|  |  | max
| ) |  | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max)

Since
  1.8

Set the minimum and maximum values for the year

Parameters

  [in] | min |
  [in] | max |

See Also
  elm_calendar_min_max_year_set

Referenced by elm_calendar_min_max_year_set().

#define elm_obj_calendar_select_mode_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Calendar_Select_Mode *, ret)

Since
  1.8

Get the select day mode used.

Parameters

  [out] | ret |

See Also
  elm_calendar_select_mode_get

Referenced by elm_calendar_select_mode_get().

#define elm_obj_calendar_select_mode_set | ( |  | mode | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Calendar_Select_Mode, mode)

Since
  1.8

Set select day mode to use.

Parameters

  [in] | mode |

See Also
  elm_calendar_select_mode_set

Referenced by elm_calendar_select_mode_set().

#define elm_obj_calendar_selectable_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET), EO_TYPECHECK(Elm_Calendar_Selectable *, ret)

Since
  1.8

Get how elm_calendar_selected_time_set manage a date

Parameters

  [out] | ret |

See Also
  elm_calendar_selectable_get

Referenced by elm_calendar_selectable_get().

#define elm_obj_calendar_selectable_set | ( |  | selectable | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET), EO_TYPECHECK(Elm_Calendar_Selectable, selectable)

Since
  1.8

Define which fields of a tm struct will be taken into account, when elm_calendar_selected_time_set() is invoked.

Parameters

  [in] | selectable |

See Also
  elm_calendar_selectable_set

Referenced by elm_calendar_selectable_set().

#define elm_obj_calendar_selected_time_get | ( |  | selected_time,
|  |  | ret
| ) |  | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET), EO_TYPECHECK(struct tm *, selected_time), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get selected date.

Parameters

  [out] | selected_time |
  [out] | ret |

See Also
  elm_calendar_selected_time_get

Referenced by elm_calendar_selected_time_get().

#define elm_obj_calendar_selected_time_set | ( |  | selected_time | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET), EO_TYPECHECK(struct tm *, selected_time)

Since
  1.8

Set selected date to be highlighted on calendar.

Parameters

  [in] | selected_time |

See Also
  elm_calendar_selected_time_set

Referenced by elm_calendar_selected_time_set().

#define elm_obj_calendar_weekdays_names_get | ( |  | ret | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET), EO_TYPECHECK(const char ***, ret)

Since
  1.8

Get weekdays names displayed by the calendar.

Parameters

  [out] | ret |

See Also
  elm_calendar_weekdays_names_get

Referenced by elm_calendar_weekdays_names_get().

#define elm_obj_calendar_weekdays_names_set | ( |  | weekdays | ) | ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET), EO_TYPECHECK(const char **, weekdays)

Since
  1.8

Set weekdays names to be displayed by the calendar.

Parameters

  [in] | weekdays |

See Also
  elm_calendar_weekdays_names_set

Referenced by elm_calendar_weekdays_names_set().

## Typedef Documentation

Elm_Calendar_Format_Cb

This callback type is used to format the string that will be used to display month and year.

Parameters

  stime | Struct representing time.

Returns
  String representing time that will be set to calendar's text.

See Also
  elm_calendar_format_function_set()

Elm_Calendar_Mark_Repeat_Type

Event periodicity, used to define if a mark should be repeated beyond event's day.

It's set when a mark is added.

So, for a mark added to 13th May with periodicity set to WEEKLY, 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 chosen.

See Also
  elm_calendar_mark_add()

Elm_Calendar_Select_Mode

the mode, who determine how user could select a day

See Also
  elm_calendar_select_mode_set()

Elm_Calendar_Selectable

A bitmask used to define which fields of a tm struct will be taken into account, when elm_calendar_selected_time_set() is invoked.

See Also
  elm_calendar_selectable_set()
  elm_calendar_selected_time_set()

Since
  1.8

Elm_Calendar_Weekday

a weekday

See Also
  elm_calendar_first_day_of_week_set()

## Function Documentation

Evas_Object* elm_calendar_add | ( | Evas_Object * | parent | ) |

Add a new calendar widget to the given parent Elementary (container) object.

Parameters

  parent | The parent object.

Returns
  a new calendar widget handle or `NULL`, on errors.

This function inserts a new calendar widget on the canvas.

Calendar - Simple creation.

Eina_Bool elm_calendar_displayed_time_get | ( | const Evas_Object * | obj,
|  | struct tm * | displayed_time
| ) |  |

Get the current time displayed in the widget.

Parameters

  obj | The calendar object
  selected_time | A tm struct to point to displayed date

Returns
  EINA_FALSE means an error occurred. If it's an error the returned time is zero filled.

Since
  1.8

References elm_obj_calendar_displayed_time_get.

Elm_Calendar_Weekday elm_calendar_first_day_of_week_get | ( | const Evas_Object * | obj | ) |

Get the first day of week, who are used on calendar widgets'.

Parameters

  obj | The calendar object

Returns
  An int which correspond to the first day of the week (Sunday = 0, Monday = 1, ..., Saturday = 6)

See Also
  elm_calendar_first_day_of_week_set() for more details

References elm_obj_calendar_first_day_of_week_get.

void elm_calendar_first_day_of_week_set | ( | Evas_Object * | obj,
|  | Elm_Calendar_Weekday | day
| ) |  |

Set the first day of week to use on calendar widgets'.

Parameters

  obj | The calendar object
  day | An int which correspond to the first day of the week (Sunday = 0, Monday = 1, ..., Saturday = 6)

References elm_obj_calendar_first_day_of_week_set.

void elm_calendar_format_function_set | ( | Evas_Object * | obj,
|  | Elm_Calendar_Format_Cb | format_func
| ) |  |

Set a function to format the string that will be used to display month and year;.

Parameters

  obj | The calendar object
  format_func | Function to set the month-year string given the selected date

By default it uses strftime with "%B %Y" format string. It should allocate the memory that will be used by the string, that will be freed by the widget after usage. A pointer to the string and a pointer to the time struct will be provided.

Example:

static char *
_format_month_year(struct tm *selected_time)
{
char buf[32];
if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL;
return strdup(buf);
}
elm_calendar_format_function_set(calendar, _format_month_year);

Calendar - Layout strings formatting.

References elm_obj_calendar_format_function_set.

double elm_calendar_interval_get | ( | const Evas_Object * | obj | ) |

Get the interval on time updates for an user mouse button hold on calendar widgets' month/year selection.

Parameters

  obj | The calendar object

Returns
  The (first) interval value, in seconds, set on it

See Also
  elm_calendar_interval_set() for more details

References elm_obj_calendar_interval_get.

void elm_calendar_interval_set | ( | Evas_Object * | obj,
|  | double | interval
| ) |  |

Set the interval on time updates for an user mouse button hold on calendar widgets' month/year selection.

Parameters

  obj | The calendar object
  interval | The (first) interval value in seconds

This interval value is decreased while the user holds the mouse pointer either selecting next or previous month/year.

This helps the user to get to a given month distant from the current one easier/faster, as it will start to change quicker and quicker on mouse button holds.

The calculation for the next change interval value, starting from the one set with this call, is the previous interval divided by 1.05, so it decreases a little bit.

The default starting interval value for automatic changes is 0.85 seconds.

See Also
  elm_calendar_interval_get()

References elm_obj_calendar_interval_set.

Elm_Calendar_Mark* elm_calendar_mark_add | ( | Evas_Object * | obj,
|  | const char * | mark_type,
|  | struct tm * | mark_time,
|  | Elm_Calendar_Mark_Repeat_Type | repeat
| ) |  |

Add a new mark to the calendar.

Parameters

  obj | The calendar object
  mark_type | A string used to define the type of mark. It will be emitted to the theme, that should display a related modification on these days representation.
  mark_time | A time struct to represent the date of inclusion of the mark. For marks that repeats it will just be displayed after the inclusion date in the calendar.
  repeat | Repeat the event following this periodicity. Can be a unique mark (that don't repeat), daily, weekly, monthly or annually.

Returns
  The created mark or `NULL` upon failure.

Add a mark that will be drawn in the calendar respecting the insertion time and periodicity. It will emit the type as signal to the widget theme. Default theme supports "holiday" and "checked", but it can be extended.

It won't immediately update the calendar, drawing the marks. For this, call elm_calendar_marks_draw(). However, when user selects next or previous month calendar forces marks drawn.

Marks created with this method can be deleted with elm_calendar_mark_del().

Example

struct tm selected_time;
time_t current_time;
current_time = time(NULL) + 5 * (24 * 60 * 60);
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", selected_time,
ELM_CALENDAR_ANNUALLY);
current_time = time(NULL) + 1 * (24 * 60 * 60);
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE);
elm_calendar_marks_draw(cal);

See Also
  elm_calendar_marks_draw()
  elm_calendar_mark_del()

Calendar - Calendar marks.

References elm_obj_calendar_mark_add.

void elm_calendar_mark_del | ( | Elm_Calendar_Mark * | mark | ) |

Delete mark from the calendar.

Parameters

  mark | The mark to be deleted.

If deleting all calendar marks is required, elm_calendar_marks_clear() should be used instead of getting marks list and deleting each one.

See Also
  elm_calendar_mark_add()

Calendar - Calendar marks.

void elm_calendar_marks_clear | ( | Evas_Object * | obj | ) |

Remove all calendar's marks.

Parameters

  obj | The calendar object.

See Also
  elm_calendar_mark_add()
  elm_calendar_mark_del()

References elm_obj_calendar_marks_clear.

void elm_calendar_marks_draw | ( | Evas_Object * | obj | ) |

Draw calendar marks.

Parameters

  obj | The calendar object.

Should be used after adding, removing or clearing marks. It will go through the entire marks list updating the calendar. If lots of marks will be added, add all the marks and then call this function.

When the month is changed, i.e. user selects next or previous month, marks will be drawn.

See Also
  elm_calendar_mark_add()
  elm_calendar_mark_del()
  elm_calendar_marks_clear()

Calendar - Calendar marks.

References elm_obj_calendar_marks_draw.

const Eina_List* elm_calendar_marks_get | ( | const Evas_Object * | obj | ) |

Get a list of all the calendar marks.

Parameters

  obj | The calendar object.

Returns
  An `Eina_List` of calendar marks objects, or `NULL` on failure.

See Also
  elm_calendar_mark_add()
  elm_calendar_mark_del()
  elm_calendar_marks_clear()

References elm_obj_calendar_marks_get.

void elm_calendar_min_max_year_get | ( | const Evas_Object * | obj,
|  | int * | min,
|  | int * | max
| ) |  |

Get the minimum and maximum values for the year.

Parameters

  obj | The calendar object.
  min | The minimum year.
  max | The maximum year.

Default values are 1902 and -1.

See Also
  elm_calendar_min_max_year_set() for more details.

Calendar - Signal callback and getters.

References elm_obj_calendar_min_max_year_get.

void elm_calendar_min_max_year_set | ( | Evas_Object * | obj,
|  | int | min,
|  | int | max
| ) |  |

Set the minimum and maximum values for the year.

Parameters

  obj | The calendar object
  min | The minimum year, greater than 1901;
  max | The maximum year;

Maximum must be greater than minimum, except if you don't want to set maximum year. Default values are 1902 and -1.

If the maximum year is a negative value, it will be limited depending on the platform architecture (year 2037 for 32 bits);

See Also
  elm_calendar_min_max_year_get()

Calendar - Years restrictions.

References elm_obj_calendar_min_max_year_set.

Elm_Calendar_Select_Mode elm_calendar_select_mode_get | ( | const Evas_Object * | obj | ) |

Get the select day mode used.

Parameters

  obj | The calendar object.

Returns
  the selected mode

Get the day selection mode used.

See Also
  elm_calendar_select_mode_set() for more details

References elm_obj_calendar_select_mode_get.

void elm_calendar_select_mode_set | ( | Evas_Object * | obj,
|  | Elm_Calendar_Select_Mode | mode
| ) |  |

Set select day mode to use.

Parameters

  obj | The calendar object.
  mode | The select mode to use.

Set the day selection mode used.

References elm_obj_calendar_select_mode_set.

Elm_Calendar_Selectable elm_calendar_selectable_get | ( | const Evas_Object * | obj | ) |

Get how elm_calendar_selected_time_set manage a date.

Parameters

  obj | The calendar object

Returns
  The flag used to manage a date with a elm_calendar_selected_time_set

See Also
  elm_calendar_selectable_set
  elm_calendar_selected_time_set

Since
  1.8

References elm_obj_calendar_selectable_get.

void elm_calendar_selectable_set | ( | Evas_Object * | obj,
|  | Elm_Calendar_Selectable | selectable
| ) |  |

Define which fields of a tm struct will be taken into account, when elm_calendar_selected_time_set() is invoked.

Parameters

  obj | The calendar object
  selectable | A bitmask of Elm_Calendar_Selectable

By Default the bitmask is set to use all fields of a tm struct (year, month and day of the month).

See Also
  elm_calendar_selected_time_set

Since
  1.8

References elm_obj_calendar_selectable_set.

Eina_Bool elm_calendar_selected_time_get | ( | const Evas_Object * | obj,
|  | struct tm * | selected_time
| ) |  |

Get selected date.

Parameters

  obj | The calendar object
  selected_time | A tm struct to point to selected date

Returns
  EINA_FALSE means an error occurred and returned time shouldn't be considered.

Get date selected by the user or set by function elm_calendar_selected_time_set(). Selected date changes when the user goes to next/previous month or select a day pressing over it on calendar.

See Also
  elm_calendar_selected_time_get()

Calendar - Signal callback and getters.

References elm_obj_calendar_selected_time_get.

void elm_calendar_selected_time_set | ( | Evas_Object * | obj,
|  | struct tm * | selected_time
| ) |  |

Set selected date to be highlighted on calendar.

Parameters

  obj | The calendar object.
  selected_time | A tm struct to represent the selected date.

Set the selected date, changing the displayed month if needed. Selected date changes when the user goes to next/previous month or select a day pressing over it on calendar.

See Also
  elm_calendar_selected_time_get()

Calendar - Days selection.

References elm_obj_calendar_selected_time_set.

const char** elm_calendar_weekdays_names_get | ( | const Evas_Object * | obj | ) |

Get weekdays names displayed by the calendar.

Parameters

  obj | The calendar object.

Returns
  Array of seven strings to be used as weekday names.

By default, weekdays abbreviations get from system are displayed: E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" The first string is related to Sunday, the second to Monday...

See Also
  elm_calendar_weekdays_name_set()

Calendar - Signal callback and getters.

References elm_obj_calendar_weekdays_names_get.

void elm_calendar_weekdays_names_set | ( | Evas_Object * | obj,
|  | const char * | weekdays[]
| ) |  |

Set weekdays names to be displayed by the calendar.

Parameters

  obj | The calendar object.
  weekdays | Array of seven strings to be used as weekday names.

Warning
  It must have 7 elements, or it will access invalid memory.
  The strings must be NULL terminated ('\0').

By default, weekdays abbreviations get from system are displayed: E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat"

The first string should be related to Sunday, the second to Monday...

The usage should be like this:

const char *weekdays[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
};
elm_calendar_weekdays_names_set(calendar, weekdays);

See Also
  elm_calendar_weekdays_name_get()

Calendar - Layout strings formatting.

References elm_obj_calendar_weekdays_names_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:12