\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();

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