2 * Copyright (C) 2012 Samsung Electronics
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #include "InputPicker.h"
25 #include <Elementary.h>
32 #if OS(TIZEN) && ENABLE(TIZEN_INPUT_TAG_EXTENSION)
34 Input_Picker_Layout::Input_Picker_Layout(Evas_Object* ewkView)
42 , dataListEditField(0)
43 , datetimeLocal(false)
45 evas_object_focus_set(m_ewkView, false);
46 ewk_view_suspend(m_ewkView);
48 /* FIXME : Workaround. OSP requirement.
49 OSP want to block own touch event while webkit internal picker is running. */
50 evas_object_smart_callback_call(m_ewkView, "input,picker,show", 0);
53 Input_Picker_Layout::~Input_Picker_Layout()
55 /* FIXME : Workaround. OSP requirement.
56 OSP want to block own touch event while webkit internal picker is running. */
57 evas_object_smart_callback_call(m_ewkView, "input,picker,hide", 0);
59 ewk_view_resume(m_ewkView);
64 InputPicker::InputPicker(Evas_Object* ewkView)
68 #if ENABLE(TIZEN_INPUT_COLOR_PICKER)
69 , m_isColorPickerShown(false)
74 InputPicker::~InputPicker()
77 if (m_pickerLayout->popup)
78 evas_object_del(m_pickerLayout->popup);
79 delete m_pickerLayout;
83 void InputPicker::show(Ewk_Input_Type inputType, const char* inputValue)
85 if(inputType == EWK_INPUT_TYPE_DATE)
86 ewk_date_popup(inputValue);
87 else if(inputType == EWK_INPUT_TYPE_TIME)
88 ewk_time_popup(inputValue);
89 else if(inputType == EWK_INPUT_TYPE_DATETIME)
90 ewk_datetime_popup(inputValue, false);
91 else if(inputType == EWK_INPUT_TYPE_DATETIMELOCAL)
92 ewk_datetime_popup(inputValue, true);
93 else if(inputType == EWK_INPUT_TYPE_MONTH)
94 ewk_month_popup(inputValue);
95 else if(inputType == EWK_INPUT_TYPE_WEEK)
96 ewk_week_popup(inputValue);
99 #if ENABLE(TIZEN_DATALIST_ELEMENT)
100 void InputPicker::_data_list_popup_response_cb(void* data, Evas_Object* obj, void* eventInfo)
102 InputPicker* inputPicker = static_cast<InputPicker*>(data);
103 const char* selectedItem = elm_entry_entry_get(inputPicker->m_pickerLayout->dataListEditField);
104 ewk_view_data_list_close(inputPicker->m_ewkView, selectedItem);
106 if (inputPicker->m_pickerLayout->popup) {
107 evas_object_del(inputPicker->m_pickerLayout->popup);
108 inputPicker->m_pickerLayout->popup = 0;
111 delete inputPicker->m_pickerLayout;
112 inputPicker->m_pickerLayout = 0;
114 inputPicker->m_dataList = 0;
117 void InputPicker::_data_list_popup_response_cancel_cb(void* data, Evas_Object* obj, void* eventInfo)
119 InputPicker* inputPicker = static_cast<InputPicker*>(data);
121 if (inputPicker->m_pickerLayout->popup) {
122 evas_object_del(inputPicker->m_pickerLayout->popup);
123 inputPicker->m_pickerLayout->popup = 0;
126 delete inputPicker->m_pickerLayout;
127 inputPicker->m_pickerLayout = 0;
129 inputPicker->m_dataList = 0;
132 void InputPicker::_data_list_selected_cb(void* data, Evas_Object* obj, void* eventInfo)
134 InputPicker* inputPicker = static_cast<InputPicker*>(data);
135 Elm_Object_Item* selectedItem = static_cast<Elm_Object_Item*>(eventInfo);
136 Elm_Object_Item* item = elm_list_first_item_get(obj);
140 if (item == selectedItem)
143 item = elm_list_item_next(item);
149 EINA_LIST_FOREACH(inputPicker->m_dataList, list, listItem) {
150 if (listItem && index == listIndex)
151 elm_entry_entry_set(inputPicker->m_pickerLayout->dataListEditField, static_cast<char*>(listItem));
157 static void _eraser_clicked_cb(void* data, Evas_Object* obj, const char* emission, const char* source)
159 Evas_Object* entry = static_cast<Evas_Object*>(data);
160 elm_entry_entry_set(entry, "");
163 static void _changed_cb(void* data, Evas_Object* obj, void* eventInfo)
165 Evas_Object* layout = static_cast<Evas_Object*>(data);
167 if (elm_object_focus_get(layout)) {
168 if (elm_entry_is_empty(obj))
169 elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
171 elm_object_signal_emit(layout, "elm,state,eraser,show", "elm");
175 static void _focused_cb(void* data, Evas_Object* obj, void* eventInfo)
177 Evas_Object* layout = static_cast<Evas_Object*>(data);
179 if (!elm_entry_is_empty(obj))
180 elm_object_signal_emit(layout, "elm,state,eraser,show", "elm");
183 static void _unfocused_cb(void* data, Evas_Object* obj, void* eventInfo)
185 Evas_Object* layout = static_cast<Evas_Object*>(data);
186 elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
189 void InputPicker::showDataList(Ewk_Input_Type inputType, Eina_List* optionList)
191 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
192 Evas_Object* win = parent;
194 m_dataList = optionList;
199 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
201 /* FIXME: If the entry is in the popup, the parent should be naviframe for uifw limitation. */
202 Evas_Object* naviframe = elm_naviframe_add(m_ewkView);
204 const char* type = elm_object_widget_type_get(parent);
206 if (!strcmp(type, elm_object_widget_type_get(naviframe))) {
211 parent = elm_object_parent_widget_get(parent);
214 evas_object_del(naviframe);
219 m_pickerLayout->popup = elm_popup_add(win);
220 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select data list");
222 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
223 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","data_list_picker");
224 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
225 evas_object_show(m_pickerLayout->layout);
226 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
228 Evas_Object* elmList = elm_list_add(m_pickerLayout->layout);
231 EINA_LIST_FOREACH(optionList, list, listItem) {
233 elm_list_item_append(elmList, static_cast<char*>(listItem), 0, 0, _data_list_selected_cb, this);
235 evas_object_size_hint_weight_set(elmList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
236 evas_object_show(elmList);
237 elm_object_part_content_set(m_pickerLayout->layout, "data_list", elmList);
239 Evas_Object* editFieldLayout = elm_layout_add(m_pickerLayout->layout);
240 elm_layout_theme_set(editFieldLayout, "layout", "editfield", "default");
242 m_pickerLayout->dataListEditField = elm_entry_add(editFieldLayout);
243 elm_object_part_content_set(editFieldLayout, "elm.swallow.content", m_pickerLayout->dataListEditField);
245 elm_object_signal_emit(editFieldLayout, "elm,state,guidetext,hide", "elm");
246 elm_object_signal_callback_add(editFieldLayout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, m_pickerLayout->dataListEditField);
247 evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "changed", _changed_cb, editFieldLayout);
248 evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "focused", _focused_cb, editFieldLayout);
249 evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "unfocused", _unfocused_cb, editFieldLayout);
251 elm_object_part_content_set(m_pickerLayout->layout, "selected_item", editFieldLayout);
252 evas_object_show(editFieldLayout);
254 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
255 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
256 elm_object_text_set(m_pickerLayout->okButton, "OK");
257 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
258 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _data_list_popup_response_cb, this);
259 evas_object_show(m_pickerLayout->popup);
260 evas_object_focus_set(m_pickerLayout->okButton, true);
262 Evas_Object* cancelButton = elm_button_add(m_pickerLayout->popup);
263 elm_object_style_set(cancelButton, "popup_button/default");
264 elm_object_text_set(cancelButton, "Cancel");
265 elm_object_part_content_set(m_pickerLayout->popup, "button2", cancelButton);
266 evas_object_smart_callback_add(cancelButton, "clicked", _data_list_popup_response_cancel_cb, this);
267 evas_object_show(cancelButton);
270 void InputPicker::hideDataList(Ewk_Input_Type inputType)
275 if(m_pickerLayout->popup){
276 evas_object_del(m_pickerLayout->popup);
277 m_pickerLayout->popup = 0;
280 delete m_pickerLayout;
287 #if ENABLE(TIZEN_INPUT_COLOR_PICKER)
288 void InputPicker::showColorPicker(int r, int g, int b, int)
290 m_isColorPickerShown = true;
291 ewk_color_popup(r, g, b);
294 void InputPicker::hideColorPicker()
296 m_isColorPickerShown = false;
300 if (m_pickerLayout->popup) {
301 evas_object_del(m_pickerLayout->popup);
302 m_pickerLayout->popup = 0;
305 delete m_pickerLayout;
310 #if ENABLE(ELM_COLORPALLETE)
311 static void _color_palette_changed_cb(void* data, Evas_Object* obj, void* eventInfo)
317 Elm_Object_Item *color_it = static_cast<Elm_Object_Item*>(eventInfo);
318 elm_colorselector_palette_item_color_get(color_it, &r, &g, &b, &a);
319 evas_object_color_set(static_cast<Evas_Object*>(data), r, g, b , a);
323 void InputPicker::_color_selected_cb(void* data, Evas* evas, Evas_Object* obj, void* eventInfo)
329 evas_object_color_get(obj, &r, &g, &b, &a);
331 evas_object_color_set(static_cast<Evas_Object*>(data), r, g, b, a);
334 void InputPicker::ewk_color_popup(int r, int g, int b)
336 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
337 Evas_Object* win = parent;
342 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
345 const char* type = elm_object_widget_type_get(parent);
347 if (!strcmp(type, "elm_win")) {
352 parent = elm_object_parent_widget_get(parent);
358 m_pickerLayout->popup = elm_popup_add(win);
359 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select color");
361 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
362 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","color_picker");
363 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
364 evas_object_show(m_pickerLayout->layout);
365 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
367 m_pickerLayout->colorRect = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
368 evas_object_size_hint_weight_set(m_pickerLayout->colorRect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
369 evas_object_show(m_pickerLayout->colorRect);
371 printf("\n<<<<<<<< r = [%d], g = [%d], b = [%d] >>>>>>>>>>\n", r, g, b);
373 evas_object_color_set(m_pickerLayout->colorRect, r, g, b, 255);
374 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color_rect", m_pickerLayout->colorRect);
375 #if ENABLE(ELM_COLORPALLETE)
376 Evas_Object* colorPalette = elm_colorselector_add(m_pickerLayout->popup);
377 elm_colorselector_mode_set(colorPalette, ELM_COLORSELECTOR_PALETTE);
379 elm_colorselector_palette_color_add(colorPalette, 128, 0, 0, 255);
380 elm_colorselector_palette_color_add(colorPalette, 255, 0, 128, 255);
381 elm_colorselector_palette_color_add(colorPalette, 255, 0, 0, 255);
382 elm_colorselector_palette_color_add(colorPalette, 255, 127, 39, 255);
383 elm_colorselector_palette_color_add(colorPalette, 255, 255, 0, 255);
384 elm_colorselector_palette_color_add(colorPalette, 0, 255, 0, 255);
385 elm_colorselector_palette_color_add(colorPalette, 0, 255, 255, 255);
386 elm_colorselector_palette_color_add(colorPalette, 0, 0, 255, 255);
387 elm_colorselector_palette_color_add(colorPalette, 0, 0, 128, 255);
388 elm_colorselector_palette_color_add(colorPalette, 64, 0, 64, 255);
389 elm_colorselector_palette_color_add(colorPalette, 0, 0, 0, 255);
390 elm_colorselector_palette_color_add(colorPalette, 255, 255, 255, 255);
392 evas_object_size_hint_fill_set(colorPalette, EVAS_HINT_FILL, 0);
393 evas_object_size_hint_weight_set(colorPalette, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
394 evas_object_smart_callback_add(colorPalette, "color,item,selected", _color_palette_changed_cb, m_pickerLayout->colorRect);
395 evas_object_show(colorPalette);
397 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color_palette", colorPalette);
399 Evas_Object* color1 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
400 evas_object_size_hint_weight_set(color1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
401 evas_object_color_set(color1, 128, 0, 0, 255);
402 evas_object_event_callback_add(color1, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
403 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color1", color1);
404 evas_object_show(color1);
406 Evas_Object* color2 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
407 evas_object_size_hint_weight_set(color2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
408 evas_object_color_set(color2, 255, 0, 128, 255);
409 evas_object_event_callback_add(color2, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
410 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color2", color2);
411 evas_object_show(color2);
413 Evas_Object* color3 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
414 evas_object_size_hint_weight_set(color3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
415 evas_object_color_set(color3, 255, 0, 0, 255);
416 evas_object_event_callback_add(color3, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
417 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color3", color3);
418 evas_object_show(color3);
420 Evas_Object* color4 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
421 evas_object_size_hint_weight_set(color4, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
422 evas_object_color_set(color4, 255, 127, 39, 255);
423 evas_object_event_callback_add(color4, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
424 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color4", color4);
425 evas_object_show(color4);
427 Evas_Object* color5 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
428 evas_object_size_hint_weight_set(color5, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
429 evas_object_color_set(color5, 255, 255, 0, 255);
430 evas_object_event_callback_add(color5, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
431 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color5", color5);
432 evas_object_show(color5);
434 Evas_Object* color6 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
435 evas_object_size_hint_weight_set(color6, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
436 evas_object_color_set(color6, 0, 255, 0, 255);
437 evas_object_event_callback_add(color6, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
438 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color6", color6);
439 evas_object_show(color6);
441 Evas_Object* color7 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
442 evas_object_size_hint_weight_set(color7, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
443 evas_object_color_set(color7, 0, 255, 255, 255);
444 evas_object_event_callback_add(color7, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
445 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color7", color7);
446 evas_object_show(color7);
448 Evas_Object* color8 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
449 evas_object_size_hint_weight_set(color8, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
450 evas_object_color_set(color8, 0, 0, 255, 255);
451 evas_object_event_callback_add(color8, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
452 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color8", color8);
453 evas_object_show(color8);
455 Evas_Object* color9 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
456 evas_object_size_hint_weight_set(color9, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
457 evas_object_color_set(color9, 0, 0, 128, 255);
458 evas_object_event_callback_add(color9, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
459 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color9", color9);
460 evas_object_show(color9);
462 Evas_Object* color10 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
463 evas_object_size_hint_weight_set(color10, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
464 evas_object_color_set(color10, 64, 0, 64, 255);
465 evas_object_event_callback_add(color10, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
466 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color10", color10);
467 evas_object_show(color10);
469 Evas_Object* color11 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
470 evas_object_size_hint_weight_set(color11, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
471 evas_object_color_set(color11, 153, 217, 234, 255);
472 evas_object_event_callback_add(color11, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
473 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color11", color11);
474 evas_object_show(color11);
476 Evas_Object* color12 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
477 evas_object_size_hint_weight_set(color12, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
478 evas_object_color_set(color12, 128, 128, 128, 255);
479 evas_object_event_callback_add(color12, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
480 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color12", color12);
481 evas_object_show(color12);
483 Evas_Object* color13 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
484 evas_object_size_hint_weight_set(color13, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
485 evas_object_color_set(color13, 0, 0, 0, 255);
486 evas_object_event_callback_add(color13, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
487 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color13", color13);
488 evas_object_show(color13);
490 Evas_Object* color14 = evas_object_rectangle_add(evas_object_evas_get(m_pickerLayout->layout));
491 evas_object_size_hint_weight_set(color14, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
492 evas_object_color_set(color14, 255, 255, 255, 255);
493 evas_object_event_callback_add(color14, EVAS_CALLBACK_MOUSE_DOWN, _color_selected_cb, m_pickerLayout->colorRect);
494 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.color14", color14);
495 evas_object_show(color14);
497 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
498 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
499 elm_object_text_set(m_pickerLayout->okButton, "OK");
500 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
501 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _color_popup_response_cb, this);
502 evas_object_focus_set(m_pickerLayout->okButton, true);
504 evas_object_show(m_pickerLayout->popup);
507 void InputPicker::_color_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
509 InputPicker* inputPicker = static_cast<InputPicker*>(data);
515 evas_object_color_get(inputPicker->m_pickerLayout->colorRect, &r, &g, &b, &a);
517 ewk_view_color_picker_color_set(inputPicker->m_ewkView, r, g, b, a);
519 inputPicker->hideColorPicker();
522 void InputPicker::ewk_date_popup(const char* inputValue)
524 struct tm* currentTime;
527 currentTime = localtime(&cur_time);
529 Input_Date_Str dateStr;
530 memset(&dateStr, 0, sizeof(Input_Date_Str));
532 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
533 Evas_Object* win = parent;
535 if (inputValue && strlen(inputValue)) {
536 char tmpinputValue[30] = {0,};
538 sprintf(tmpinputValue, "%s", inputValue);
539 strcpy(dateStr.year, strtok(tmpinputValue,"-"));
540 strcpy(dateStr.mon, strtok(0, "-"));
541 strcpy(dateStr.day, strtok(0, "-"));
543 currentTime->tm_year = atoi(dateStr.year);
544 currentTime->tm_mon = atoi(dateStr.mon);
545 currentTime->tm_mday = atoi(dateStr.day);
547 currentTime->tm_year = currentTime->tm_year - 1900;
548 currentTime->tm_mon = currentTime->tm_mon - 1;
551 if (m_pickerLayout) {
552 // Just update the value.
553 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
557 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
560 const char* type = elm_object_widget_type_get(parent);
562 if (!strcmp(type, "elm_win")) {
567 parent = elm_object_parent_widget_get(parent);
573 m_pickerLayout->popup = elm_popup_add(win);
574 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select date");
576 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
577 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","elm/datepicker");
578 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
580 edje_object_part_text_set(elm_layout_edje_get(m_pickerLayout->layout), "title_text", "Date (Default format) :");
582 m_pickerLayout->datePicker = elm_datetime_add(m_pickerLayout->layout);
583 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
585 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_HOUR, EINA_FALSE);
586 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_MINUTE, EINA_FALSE);
587 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_AMPM, EINA_FALSE);
588 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.content.date", m_pickerLayout->datePicker);
590 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
591 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
592 elm_object_text_set(m_pickerLayout->okButton, "OK");
593 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
594 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _date_popup_response_cb, this);
595 evas_object_focus_set(m_pickerLayout->okButton, true);
597 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
598 evas_object_show(m_pickerLayout->popup);
601 #define isLeapYear(year) ((!(year % 4) && (year % 100)) || (!(year % 400) && (year % 1000)))
602 static int _calculateMonthAndDay(int year, int totalDays, int* remains)
605 if (totalDays - 31 < 0) {
606 *remains = totalDays;
610 totalDays = totalDays - 31;
613 if (isLeapYear(year)) {
614 if (totalDays - 29 < 0) {
615 *remains = totalDays;
618 totalDays = totalDays - 29;
620 if (totalDays - 28 < 0) {
621 *remains = totalDays;
624 totalDays = totalDays - 28;
628 if (totalDays - 31 < 0) {
629 *remains = totalDays;
632 totalDays = totalDays - 31;
635 if (totalDays - 30 < 0) {
636 *remains = totalDays;
639 totalDays = totalDays - 30;
642 if (totalDays - 31 < 0) {
643 *remains = totalDays;
646 totalDays = totalDays - 31;
649 if (totalDays - 30 < 0) {
650 *remains = totalDays;
653 totalDays = totalDays - 30;
656 if (totalDays - 31 < 0) {
657 *remains = totalDays;
660 totalDays = totalDays - 31;
663 if (totalDays - 31 < 0) {
664 *remains = totalDays;
667 totalDays = totalDays - 31;
670 if (totalDays - 30 < 0) {
671 *remains = totalDays;
674 totalDays = totalDays - 30;
677 if (totalDays - 31 < 0) {
678 *remains = totalDays;
681 totalDays = totalDays - 31;
684 if (totalDays - 30 < 0) {
685 *remains = totalDays;
688 totalDays = totalDays - 30;
690 *remains = totalDays;
694 void InputPicker::ewk_week_popup(const char* inputValue)
696 struct tm* currentTime;
699 currentTime = localtime(&cur_time);
701 Input_Date_Str dateStr;
702 memset(&dateStr, 0, sizeof(Input_Date_Str));
704 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
705 Evas_Object* win = parent;
707 if (inputValue && strlen(inputValue)) {
708 char tmpinputValue[30] = {0,};
710 sprintf(tmpinputValue, "%s", inputValue);
711 strcpy(dateStr.year, strtok(tmpinputValue,"-"));
712 const char* week = strstr(inputValue, "W");
715 weekNum = atoi(week + 1);
717 currentTime->tm_year = atoi(dateStr.year);
718 currentTime->tm_year = currentTime->tm_year - 1900;
720 struct tm firtTimeOfyear;
721 memset(&firtTimeOfyear, 0, sizeof(struct tm));
722 firtTimeOfyear.tm_year = currentTime->tm_year;
723 firtTimeOfyear.tm_mon = 0;
724 firtTimeOfyear.tm_mday = 1;
725 mktime(&firtTimeOfyear);
727 char firstWeek[10] = {0, };
728 strftime(firstWeek, 10, "%w", &firtTimeOfyear);
729 int firstWeekCount = atoi(firstWeek);
733 totalDays = weekNum * 7 - firstWeekCount;
736 int month = _calculateMonthAndDay(currentTime->tm_year, totalDays, &days);
738 currentTime->tm_mon = month;
739 currentTime->tm_mday = days;
742 if (m_pickerLayout) {
743 // Just update the value.
744 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
748 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
751 const char* type = elm_object_widget_type_get(parent);
753 if (!strcmp(type, "elm_win")) {
758 parent = elm_object_parent_widget_get(parent);
764 m_pickerLayout->popup = elm_popup_add(win);
765 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select date");
767 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
768 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","elm/datepicker");
769 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
771 edje_object_part_text_set(elm_layout_edje_get(m_pickerLayout->layout), "title_text", "Date (Default format) :");
773 m_pickerLayout->datePicker = elm_datetime_add(m_pickerLayout->layout);
774 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
776 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_HOUR, EINA_FALSE);
777 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_MINUTE, EINA_FALSE);
778 elm_datetime_field_visible_set(m_pickerLayout->datePicker, ELM_DATETIME_AMPM, EINA_FALSE);
779 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.content.date", m_pickerLayout->datePicker);
781 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
782 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
783 elm_object_text_set(m_pickerLayout->okButton, "OK");
784 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
785 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _week_popup_response_cb, this);
786 evas_object_focus_set(m_pickerLayout->okButton, true);
788 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
789 evas_object_show(m_pickerLayout->popup);
792 void InputPicker::ewk_time_popup(const char* inputValue)
794 struct tm* currentTime;
797 currentTime = localtime(&cur_time);
799 Input_Date_Str dateStr;
800 memset(&dateStr, 0, sizeof(Input_Date_Str));
802 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
803 Evas_Object* win = parent;
805 if (inputValue && strlen(inputValue)) {
806 char tmpinputValue[30] = {0,};
808 sprintf(tmpinputValue, "%s", inputValue);
809 strcpy(dateStr.hour, strtok(tmpinputValue,":"));
810 strcpy(dateStr.min, strtok(0, ":"));
812 currentTime->tm_hour = atoi(dateStr.hour);
813 currentTime->tm_min = atoi(dateStr.min);
816 if (m_pickerLayout) {
817 // Just update the value.
818 elm_datetime_value_set(m_pickerLayout->timePicker, currentTime);
822 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
825 const char* type = elm_object_widget_type_get(parent);
827 if (!strcmp(type, "elm_win")) {
832 parent = elm_object_parent_widget_get(parent);
838 m_pickerLayout->popup = elm_popup_add(win);
839 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select time");
841 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
842 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","elm/datepicker");
843 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
845 edje_object_part_text_set(elm_layout_edje_get(m_pickerLayout->layout), "title_text", "Time (Default format) :");
847 m_pickerLayout->timePicker = elm_datetime_add(m_pickerLayout->layout);
848 elm_datetime_format_set(m_pickerLayout->timePicker, "%H:%M");
849 elm_datetime_value_set(m_pickerLayout->timePicker, currentTime);
851 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.content.date", m_pickerLayout->timePicker);
853 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
854 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
855 elm_object_text_set(m_pickerLayout->okButton, "OK");
856 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
857 evas_object_focus_set(m_pickerLayout->okButton, true);
859 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _time_popup_response_cb, this);
860 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
861 evas_object_show(m_pickerLayout->popup);
864 void InputPicker::ewk_month_popup(const char* inputValue)
866 struct tm* currentTime;
869 currentTime = localtime(&cur_time);
871 Input_Date_Str dateStr;
872 memset(&dateStr, 0, sizeof(Input_Date_Str));
874 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
875 Evas_Object* win = parent;
877 if (inputValue && strlen(inputValue)) {
878 char tmpInputValue[30] = {0,};
880 sprintf(tmpInputValue, "%s", inputValue);
881 strcpy(dateStr.year, strtok(tmpInputValue,"-"));
882 strcpy(dateStr.mon, strtok(0, "-"));
884 currentTime->tm_year = atoi(dateStr.year);
885 currentTime->tm_mon = atoi(dateStr.mon);
887 currentTime->tm_year = currentTime->tm_year - 1900;
888 currentTime->tm_mon = currentTime->tm_mon - 1;
891 if (m_pickerLayout) {
892 // Just update the value.
893 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
897 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
900 const char* type = elm_object_widget_type_get(parent);
902 if (!strcmp(type, "elm_win")) {
907 parent = elm_object_parent_widget_get(parent);
913 m_pickerLayout->popup = elm_popup_add(win);
915 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select month");
917 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
918 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","elm/datepicker");
920 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
921 m_pickerLayout->datePicker = elm_datetime_add(m_pickerLayout->layout);
923 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
925 edje_object_part_text_set(elm_layout_edje_get(m_pickerLayout->layout), "title_text", "Month (Default format) :");
927 elm_datetime_format_set(m_pickerLayout->datePicker, "%Y %m");
928 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.content.date", m_pickerLayout->datePicker);
930 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
931 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
932 elm_object_text_set(m_pickerLayout->okButton, "OK");
933 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
934 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _month_popup_response_cb, this);
935 evas_object_focus_set(m_pickerLayout->okButton, true);
937 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
938 evas_object_show(m_pickerLayout->popup);
941 void InputPicker::ewk_datetime_popup(const char* inputValue, bool local)
943 struct tm* currentTime;
946 currentTime = localtime(&cur_time);
948 Input_Date_Str dateStr;
949 memset(&dateStr, 0, sizeof(Input_Date_Str));
951 Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
952 Evas_Object* win = parent;
954 if (inputValue && strlen(inputValue)) {
955 char tmpInputValue[30] = {0, };
957 sprintf(tmpInputValue, "%s", inputValue);
958 strcpy(dateStr.year, strtok(tmpInputValue,"-"));
959 strcpy(dateStr.mon, strtok(0, "-"));
960 strcpy(dateStr.day, strtok(0, "T"));
961 strcpy(dateStr.hour, strtok(0, ":"));
964 strcpy(dateStr.min, strtok(0, "Z"));
966 strcpy(dateStr.min, strtok(0, ":"));
968 currentTime->tm_year = atoi(dateStr.year);
969 currentTime->tm_mon = atoi(dateStr.mon);
970 currentTime->tm_mday = atoi(dateStr.day);
971 currentTime->tm_hour = atoi(dateStr.hour);
972 currentTime->tm_min = atoi(dateStr.min);
974 currentTime->tm_year = currentTime->tm_year - 1900;
975 currentTime->tm_mon = currentTime->tm_mon - 1;
978 if (m_pickerLayout) {
979 // Just update the value.
980 m_pickerLayout->datetimeLocal = local;
982 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
983 elm_datetime_value_set(m_pickerLayout->timePicker, currentTime);
987 m_pickerLayout = new Input_Picker_Layout(m_ewkView);
989 m_pickerLayout->datetimeLocal = local;
992 const char* type = elm_object_widget_type_get(parent);
994 if (!strcmp(type, "elm_win")) {
999 parent = elm_object_parent_widget_get(parent);
1005 m_pickerLayout->popup = elm_popup_add(win);
1006 elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select datetime");
1008 m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
1009 elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","datepicker_popup");
1010 evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1012 m_pickerLayout->datePicker = elm_datetime_add(m_pickerLayout->layout);
1013 elm_datetime_value_set(m_pickerLayout->datePicker, currentTime);
1015 elm_datetime_field_visible_set(m_pickerLayout->datePicker , ELM_DATETIME_HOUR, EINA_FALSE);
1016 elm_datetime_field_visible_set(m_pickerLayout->datePicker , ELM_DATETIME_MINUTE, EINA_FALSE);
1017 elm_datetime_field_visible_set(m_pickerLayout->datePicker , ELM_DATETIME_AMPM, EINA_FALSE);
1018 elm_object_part_content_set(m_pickerLayout->layout , "elm.swallow.content.date", m_pickerLayout->datePicker);
1020 m_pickerLayout->timePicker = elm_datetime_add(m_pickerLayout->layout);
1021 elm_datetime_format_set(m_pickerLayout->timePicker, "%H:%M");
1022 elm_datetime_value_set(m_pickerLayout->timePicker, currentTime);
1023 elm_object_part_content_set(m_pickerLayout->layout, "elm.swallow.content.time", m_pickerLayout->timePicker);
1025 m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
1026 elm_object_style_set(m_pickerLayout->okButton, "popup_button/default");
1027 elm_object_text_set(m_pickerLayout->okButton, "OK");
1028 elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
1029 evas_object_focus_set(m_pickerLayout->okButton, true);
1031 evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _datetime_popup_response_cb, this);
1032 elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
1033 evas_object_show(m_pickerLayout->popup);
1037 void InputPicker::_date_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
1039 struct tm currentTime;
1040 memset(¤tTime, 0, sizeof(struct tm));
1042 char dateStr[20] = {0, };
1044 InputPicker* inputPicker = static_cast<InputPicker*>(data);
1046 elm_datetime_value_get(inputPicker->m_pickerLayout->datePicker, ¤tTime);
1048 date.day = currentTime.tm_mday;
1049 date.mon = currentTime.tm_mon;
1050 date.year = currentTime.tm_year;
1052 if(inputPicker->m_pickerLayout->popup){
1053 evas_object_del(inputPicker->m_pickerLayout->popup);
1054 inputPicker->m_pickerLayout->popup = 0;
1057 date.year = 1900 + date.year;
1058 sprintf(dateStr, "%d-%02d-%02d" , date.year, date.mon + 1, date.day);
1060 ewk_view_focused_input_element_value_set(inputPicker->m_ewkView, dateStr);
1061 ewk_view_command_execute(inputPicker->m_ewkView, "Unselect", 0);
1063 delete inputPicker->m_pickerLayout;
1064 inputPicker->m_pickerLayout = 0;
1067 void InputPicker::_week_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
1069 struct tm currentTime;
1070 memset(¤tTime, 0, sizeof(struct tm));
1072 char dateStr[20] = {0, };
1074 InputPicker* inputPicker = static_cast<InputPicker*>(data);
1076 elm_datetime_value_get(inputPicker->m_pickerLayout->datePicker, ¤tTime);
1078 date.day = currentTime.tm_mday;
1079 date.mon = currentTime.tm_mon;
1080 date.year = currentTime.tm_year;
1081 mktime(¤tTime);
1083 if(inputPicker->m_pickerLayout->popup){
1084 evas_object_del(inputPicker->m_pickerLayout->popup);
1085 inputPicker->m_pickerLayout->popup = 0;
1088 struct tm firtTimeOfyear;
1089 memset(&firtTimeOfyear, 0, sizeof(struct tm));
1090 firtTimeOfyear.tm_year = date.year;
1091 firtTimeOfyear.tm_mon = 0;
1092 firtTimeOfyear.tm_mday = 1;
1093 mktime(&firtTimeOfyear);
1095 char firstWeek[10] = {0, };
1096 strftime(firstWeek, 10, "%w", &firtTimeOfyear);
1097 int firstWeekCount = atoi(firstWeek);
1099 char totalDay[10] = {0, };
1100 strftime(totalDay, 10, "%j", ¤tTime);
1101 int totalDayCount = atoi(totalDay);
1103 int weekNum = (totalDayCount + firstWeekCount) / 7;
1104 if (totalDayCount + firstWeekCount > weekNum * 7)
1107 date.year = 1900 + date.year;
1108 sprintf(dateStr, "%d-W%02d" , date.year, weekNum);
1110 ewk_view_focused_input_element_value_set(inputPicker->m_ewkView, dateStr);
1111 ewk_view_command_execute(inputPicker->m_ewkView, "Unselect", 0);
1113 delete inputPicker->m_pickerLayout;
1114 inputPicker->m_pickerLayout = 0;
1117 void InputPicker::_time_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
1119 struct tm currentTime;
1120 memset(¤tTime, 0, sizeof(struct tm));
1122 char dateStr[20] = {0, };
1124 InputPicker* inputPicker = static_cast<InputPicker*>(data);
1126 elm_datetime_value_get(inputPicker->m_pickerLayout->timePicker, ¤tTime);
1128 date.hour = currentTime.tm_hour;
1129 date.min = currentTime.tm_min;
1131 if(inputPicker->m_pickerLayout->popup){
1132 evas_object_del(inputPicker->m_pickerLayout->popup);
1133 inputPicker->m_pickerLayout->popup = 0;
1136 sprintf(dateStr, "%02d:%02d" , date.hour, date.min);
1137 ewk_view_focused_input_element_value_set(inputPicker->m_ewkView, dateStr);
1138 ewk_view_command_execute(inputPicker->m_ewkView, "Unselect", 0);
1140 delete inputPicker->m_pickerLayout;
1141 inputPicker->m_pickerLayout = 0;
1144 void InputPicker::_month_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
1146 struct tm currentTime;
1147 memset(¤tTime, 0, sizeof(struct tm));
1149 char dateStr[20] = {0, };
1151 InputPicker* inputPicker = static_cast<InputPicker*>(data);
1153 elm_datetime_value_get(inputPicker->m_pickerLayout->datePicker, ¤tTime);
1155 date.mon = currentTime.tm_mon;
1156 date.year = currentTime.tm_year;
1158 if(inputPicker->m_pickerLayout->popup){
1159 evas_object_del(inputPicker->m_pickerLayout->popup);
1160 inputPicker->m_pickerLayout->popup = 0;
1163 date.year = 1900 + date.year;
1164 sprintf(dateStr, "%02d-%02d" , date.year, date.mon + 1);
1166 ewk_view_focused_input_element_value_set(inputPicker->m_ewkView, dateStr);
1167 ewk_view_command_execute(inputPicker->m_ewkView, "Unselect", 0);
1169 delete inputPicker->m_pickerLayout;
1170 inputPicker->m_pickerLayout = 0;
1173 void InputPicker::_datetime_popup_response_cb(void* data, Evas_Object* obj, void* event_info)
1175 struct tm currentTime;
1176 memset(¤tTime, 0, sizeof(struct tm));
1178 char dateStr[50] = {0, };
1180 InputPicker* inputPicker = static_cast<InputPicker*>(data);
1182 elm_datetime_value_get(inputPicker->m_pickerLayout->datePicker, ¤tTime);
1183 date.year = currentTime.tm_year;
1184 date.day = currentTime.tm_mday;
1185 date.mon = currentTime.tm_mon;
1187 elm_datetime_value_get(inputPicker->m_pickerLayout->timePicker, ¤tTime);
1188 date.hour = currentTime.tm_hour;
1189 date.min = currentTime.tm_min;
1191 if (inputPicker->m_pickerLayout->popup) {
1192 evas_object_del(inputPicker->m_pickerLayout->popup);
1193 inputPicker->m_pickerLayout->popup = 0;
1196 date.year = 1900 + date.year;
1198 if (inputPicker->m_pickerLayout->datetimeLocal)
1199 sprintf(dateStr, "%d-%02d-%02dT%02d:%02d" , date.year, date.mon + 1, date.day, date.hour, date.min);
1201 sprintf(dateStr, "%d-%02d-%02dT%02d:%02dZ" , date.year, date.mon + 1, date.day, date.hour, date.min);
1203 ewk_view_focused_input_element_value_set(inputPicker->m_ewkView, dateStr);
1204 ewk_view_command_execute(inputPicker->m_ewkView, "Unselect", 0);
1206 delete inputPicker->m_pickerLayout;
1207 inputPicker->m_pickerLayout = 0;
1210 } // namespace WebKit
1212 #endif // OS(TIZEN) && ENABLE(TIZEN_INPUT_TAG_EXTENSION)