\section{calendar\-\_\-example\-\_\-05.\-c}

\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#include <Elementary.h>}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_print\_cal\_info\_cb(\textcolor{keywordtype}{void} *data, Evas\_Object *obj, \textcolor{keywordtype}{void} *event\_info)
\{
   \textcolor{keywordtype}{int} year\_min, year\_max;
   Eina\_Bool sel\_enabled;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} **wds;
   \textcolor{keyword}{struct }tm sel\_time;
   \textcolor{keywordtype}{double} interval;

   \textcolor{keywordflow}{if} (!elm_calendar_selected_time_get(obj, &sel\_time))
     \textcolor{keywordflow}{return};

   interval = elm_calendar_interval_get(obj);
   elm_calendar_min_max_year_get(obj, &year\_min, &year\_max);
   sel\_enabled = (elm_calendar_select_mode_get(obj) != ELM\_CALENDAR\_SELECT\_MODE\_NONE);
   wds = elm_calendar_weekdays_names_get(obj);

   printf(\textcolor{stringliteral}{"Day: %i, Mon: %i, Year %i, WeekDay: %i<br>\(\backslash\)n"}
          \textcolor{stringliteral}{"Interval: %0.2f, Year\_Min: %i, Year\_Max %i, Sel Enabled : %i<br>\(\backslash\)n"}
          \textcolor{stringliteral}{"Weekdays: %s, %s, %s, %s, %s, %s, %s<br>\(\backslash\)n\(\backslash\)n"},
          sel\_time.tm\_mday, sel\_time.tm\_mon, sel\_time.tm\_year + 1900, sel\_time.tm\_wday,
          interval, year\_min, year\_max, sel\_enabled,
          wds[0], wds[1], wds[2], wds[3], wds[4], wds[5], wds[6]);
\}

EAPI\_MAIN \textcolor{keywordtype}{int}
elm\_main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   Evas\_Object *win, *cal;

   win = elm_win_util_standard_add(\textcolor{stringliteral}{"calendar"}, \textcolor{stringliteral}{"Calendar Getters Example"});
   elm_win_autodel_set(win, EINA\_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   cal = elm_calendar_add(win);
   evas\_object\_size\_hint\_weight\_set(cal, EVAS\_HINT\_EXPAND, EVAS\_HINT\_EXPAND);
   elm_win_resize_object_add(win, cal);
   \textcolor{comment}{/* Add callback to display calendar information every time user}
\textcolor{comment}{    * selects a new date */}
   evas\_object\_smart\_callback\_add(cal, \textcolor{stringliteral}{"changed"}, \_print\_cal\_info\_cb, NULL);
   evas\_object\_show(cal);

   evas\_object\_show(win);

   elm_run();
   elm_shutdown();

   \textcolor{keywordflow}{return} 0;
\}
ELM_MAIN()
\end{DoxyCodeInclude}
 