3 typedef struct _Elm_Params_Calendar
9 Eina_Bool sel_exists:1;
13 } Elm_Params_Calendar;
16 external_calendar_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
18 const Elm_Params_Calendar *p;
21 if (to_params) p = to_params;
22 else if (from_params) p = from_params;
27 elm_calendar_min_max_year_get(obj, NULL, &max);
28 elm_calendar_min_max_year_set(obj, p->year_min, max);
32 elm_calendar_min_max_year_get(obj, &min, NULL);
33 elm_calendar_min_max_year_set(obj, min, p->year_max);
36 elm_calendar_day_selection_enabled_set(obj, p->sel_enable);
38 elm_calendar_text_weekday_color_set(obj,p->weekday_color);
39 if (p->saturday_color)
40 elm_calendar_text_weekday_color_set(obj,p->saturday_color);
42 elm_calendar_text_weekday_color_set(obj,p->sunday_color);
46 external_calendar_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
50 if (!strcmp(param->name, "year_min"))
52 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
54 elm_calendar_min_max_year_get(obj, NULL, &max);
55 elm_calendar_min_max_year_set(obj, param->i, max);
59 else if (!strcmp(param->name, "year_max"))
61 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
63 elm_calendar_min_max_year_get(obj, &min, NULL);
64 elm_calendar_min_max_year_set(obj, min,param->i);
68 else if (!strcmp(param->name, "sel_enable"))
70 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
72 elm_calendar_day_selection_enabled_set(obj,param->i );
76 else if (!strcmp(param->name, "weekday_color"))
78 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
80 elm_calendar_text_weekday_color_set(obj,param->i);
84 else if (!strcmp(param->name, "saturday_color"))
86 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
88 elm_calendar_text_saturday_color_set(obj,param->i);
92 else if (!strcmp(param->name, "sunday_color"))
94 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
96 elm_calendar_text_sunday_color_set(obj,param->i);
101 ERR("unknown parameter '%s' of type '%s'",
102 param->name, edje_external_param_type_str(param->type));
108 external_calendar_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
112 if (!strcmp(param->name, "year_min"))
114 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
116 elm_calendar_min_max_year_get(obj, &(param->i) ,&max);
120 else if (!strcmp(param->name, "year_max"))
122 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
124 elm_calendar_min_max_year_get(obj, &min,&(param->i));
128 else if (!strcmp(param->name, "sel_enable"))
130 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
132 param->i = elm_calendar_day_selection_enabled_get(obj);
136 else if (!strcmp(param->name, "weekday_color"))
138 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
140 //there is no API available to get the dates with normal weekday color
144 else if (!strcmp(param->name, "saturday_color"))
146 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
148 // there is no API available to get the dates with saturday color
152 else if (!strcmp(param->name, "sunday_color"))
154 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
156 // there is no API available to get the dates with sunday color
161 ERR("unknown parameter '%s' of type '%s'",
162 param->name, edje_external_param_type_str(param->type));
168 external_calendar_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params)
170 Elm_Params_Calendar *mem;
171 Edje_External_Param *param;
174 mem = calloc(1, sizeof(Elm_Params_Calendar));
178 EINA_LIST_FOREACH(params, l, param)
180 if (!strcmp(param->name, "year_min"))
181 mem->year_min = param->i;
183 else if(!strcmp(param->name, "year_max"))
184 mem->year_max = param->i;
186 else if (!strcmp(param->name, "sel_enable"))
188 mem->sel_enable = param->i;
189 mem->sel_exists = EINA_TRUE;
192 else if (!strcmp(param->name, "weekday_color"))
193 mem->weekday_color = param->i;
195 else if (!strcmp(param->name, "saturday_color"))
196 mem->saturday_color = param->i;
198 else if (!strcmp(param->name, "sunday_color"))
199 mem->sunday_color = param->i;
205 static Evas_Object *external_calendar_content_get(void *data __UNUSED__,
206 const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
213 external_calendar_params_free(void *params)
218 static Edje_External_Param_Info external_calendar_params[] = {
219 DEFINE_EXTERNAL_COMMON_PARAMS,
220 EDJE_EXTERNAL_PARAM_INFO_INT("year_min"),
221 EDJE_EXTERNAL_PARAM_INFO_INT("year_max"),
222 EDJE_EXTERNAL_PARAM_INFO_BOOL("sel_enable"),
223 EDJE_EXTERNAL_PARAM_INFO_INT("weekday_color"),
224 EDJE_EXTERNAL_PARAM_INFO_INT("saturday_color"),
225 EDJE_EXTERNAL_PARAM_INFO_INT("sunday_color"),
226 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
229 DEFINE_EXTERNAL_ICON_ADD(calendar, "calendar");
230 DEFINE_EXTERNAL_TYPE_SIMPLE(calendar, "Calendar");