static Eina_Bool _ewk_view_input_picker_show(Ewk_View_Smart_Data*, Ewk_Input_Type, const char* inputValue);
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-static Eina_Bool _ewk_view_data_list_show(Ewk_View_Smart_Data*, Ewk_Input_Type, Eina_List*);
-static Eina_Bool _ewk_view_data_list_hide(Ewk_View_Smart_Data*, Ewk_Input_Type);
-#endif
-
#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
static Eina_Bool _ewk_input_picker_color_request(Ewk_View_Smart_Data*, int, int, int, int);
static Eina_Bool _ewk_input_picker_color_dismiss(Ewk_View_Smart_Data*);
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
api->input_picker_show = _ewk_view_input_picker_show;
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
- api->data_list_show = _ewk_view_data_list_show;
- api->data_list_hide = _ewk_view_data_list_hide;
-#endif
#if ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT_INTERNAL)
api->orientation_lock = _ewk_orientation_lock;
api->orientation_unlock = _ewk_orientation_unlock;
}
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-static Eina_Bool _ewk_view_data_list_show(Ewk_View_Smart_Data* smartData, Ewk_Input_Type inputType, Eina_List* optionList)
-{
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
-
- impl->inputPicker->showDataList(inputType, optionList);
- return true;
-}
-
-static Eina_Bool _ewk_view_data_list_hide(Ewk_View_Smart_Data* smartData, Ewk_Input_Type inputType)
-{
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
-
- impl->inputPicker->hideDataList(inputType);
- return true;
-}
-#endif
-
#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
static Eina_Bool _ewk_input_picker_color_request(Ewk_View_Smart_Data* smartData, int r, int g, int b, int a)
{
#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
}
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-void ewkViewDataListShowRequest(Evas_Object* ewkView, Ewk_Input_Type inputType, Vector<String> optionList)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api->data_list_show);
-
- if (impl->dataList)
- ewkViewDataListHideRequest(ewkView, inputType);
-
- for (Vector<String>::const_iterator it = optionList.begin(); it != optionList.end(); ++it) {
- String value = *it;
- impl->dataList = eina_list_append(impl->dataList, eina_stringshare_add(value.utf8().data()));
- }
-
- smartData->api->data_list_show(smartData, inputType, impl->dataList);
-}
-
-void ewkViewDataListHideRequest(Evas_Object* ewkView, Ewk_Input_Type inputType)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
- EINA_SAFETY_ON_NULL_RETURN(impl->dataList);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api->data_list_hide);
-
- impl->deleteDataList();
-
- smartData->api->data_list_hide(smartData, inputType);
-}
-#endif
-
-void ewk_view_data_list_close(Evas_Object* ewkView, const char* value)
-{
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
-
- impl->deleteDataList();
-
- ewk_view_focused_input_element_value_set(ewkView, value);
-#endif
-}
-
Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* ewkView)
{
#if ENABLE(TIZEN_GESTURE)
Eina_Bool (*input_picker_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, const char* inputValue);
//#endif
-//#if ENABLE(TIZEN_DATALIST_ELEMENT)
- Eina_Bool (*data_list_show)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType, Eina_List *optionList);
- Eina_Bool (*data_list_hide)(Ewk_View_Smart_Data *sd, Ewk_Input_Type inputType);
-// #endif
-
// #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
Eina_Bool (*orientation_lock)(Ewk_View_Smart_Data *sd, int orientations);
void (*orientation_unlock)(Ewk_View_Smart_Data *sd);
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
-#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializer to zero a whole Ewk_View_Smart_Class structure.
EAPI const char* ewk_view_focused_input_element_value_get(Evas_Object* o);
// #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-// #if ENABLE(TIZEN_DATALIST_ELEMENT)
-/**
- * Closes data list picker
- *
- * @param o view object contains data list element
- * @param value value to be set to the input element
- */
-EAPI void ewk_view_data_list_close(Evas_Object *o, const char *value);
-//#endif // ENABLE(TIZEN_DATALIST_ELEMENT)
-
/**
* Selects index of current popup menu.
*
ewk_week_popup(inputValue);
}
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-void InputPicker::_data_list_popup_response_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- InputPicker* inputPicker = static_cast<InputPicker*>(data);
- const char* selectedItem = elm_entry_entry_get(inputPicker->m_pickerLayout->dataListEditField);
- ewk_view_data_list_close(inputPicker->m_ewkView, selectedItem);
-
- if (inputPicker->m_pickerLayout->popup) {
- evas_object_del(inputPicker->m_pickerLayout->popup);
- inputPicker->m_pickerLayout->popup = 0;
- }
-
- delete inputPicker->m_pickerLayout;
- inputPicker->m_pickerLayout = 0;
-
- inputPicker->m_dataList = 0;
-}
-
-void InputPicker::_data_list_popup_response_cancel_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- InputPicker* inputPicker = static_cast<InputPicker*>(data);
-
- if (inputPicker->m_pickerLayout->popup) {
- evas_object_del(inputPicker->m_pickerLayout->popup);
- inputPicker->m_pickerLayout->popup = 0;
- }
-
- delete inputPicker->m_pickerLayout;
- inputPicker->m_pickerLayout = 0;
-
- inputPicker->m_dataList = 0;
-}
-
-void InputPicker::_data_list_selected_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- InputPicker* inputPicker = static_cast<InputPicker*>(data);
- Elm_Object_Item* selectedItem = static_cast<Elm_Object_Item*>(eventInfo);
- Elm_Object_Item* item = elm_list_first_item_get(obj);
-
- int index = 0;
- while (item) {
- if (item == selectedItem)
- break;
- index++;
- item = elm_list_item_next(item);
- }
-
- Eina_List* list = 0;
- void* listItem = 0;
- int listIndex = 0;
- EINA_LIST_FOREACH(inputPicker->m_dataList, list, listItem) {
- if (listItem && index == listIndex)
- elm_entry_entry_set(inputPicker->m_pickerLayout->dataListEditField, static_cast<char*>(listItem));
-
- listIndex++;
- }
-}
-
-static void _eraser_clicked_cb(void* data, Evas_Object* obj, const char* emission, const char* source)
-{
- Evas_Object* entry = static_cast<Evas_Object*>(data);
- elm_entry_entry_set(entry, "");
-}
-
-static void _changed_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- Evas_Object* layout = static_cast<Evas_Object*>(data);
-
- if (elm_object_focus_get(layout)) {
- if (elm_entry_is_empty(obj))
- elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
- else
- elm_object_signal_emit(layout, "elm,state,eraser,show", "elm");
- }
-}
-
-static void _focused_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- Evas_Object* layout = static_cast<Evas_Object*>(data);
-
- if (!elm_entry_is_empty(obj))
- elm_object_signal_emit(layout, "elm,state,eraser,show", "elm");
-}
-
-static void _unfocused_cb(void* data, Evas_Object* obj, void* eventInfo)
-{
- Evas_Object* layout = static_cast<Evas_Object*>(data);
- elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
-}
-
-void InputPicker::showDataList(Ewk_Input_Type inputType, Eina_List* optionList)
-{
- Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
- Evas_Object* win = parent;
-
- m_dataList = optionList;
-
- if (m_pickerLayout)
- return;
-
- m_pickerLayout = new Input_Picker_Layout(m_ewkView);
-
- /* FIXME: If the entry is in the popup, the parent should be naviframe for uifw limitation. */
- Evas_Object* naviframe = elm_naviframe_add(m_ewkView);
- while (parent) {
- const char* type = elm_object_widget_type_get(parent);
- if (type) {
- if (!strcmp(type, elm_object_widget_type_get(naviframe))) {
- win = parent;
- break;
- }
- }
- parent = elm_object_parent_widget_get(parent);
- }
-
- evas_object_del(naviframe);
-
- if (!win)
- win = m_ewkView;
-
- m_pickerLayout->popup = elm_popup_add(win);
- elm_object_part_text_set(m_pickerLayout->popup, "title,text", "Select data list");
-
-#if ENABLE(TIZEN_HW_MORE_BACK_KEY)
- if (EflAssistHandle) {
- void (*webkit_ea_object_event_callback_add)(Evas_Object *, Ea_Callback_Type , Ea_Event_Cb func, void *);
- webkit_ea_object_event_callback_add = (void (*)(Evas_Object *, Ea_Callback_Type , Ea_Event_Cb func, void *))dlsym(EflAssistHandle, "ea_object_event_callback_add");
- (*webkit_ea_object_event_callback_add)(m_pickerLayout->popup, EA_CALLBACK_BACK, _data_list_popup_response_cancel_cb, this);
- }
-#endif
-
- m_pickerLayout->layout = elm_layout_add(m_pickerLayout->popup);
- elm_layout_file_set(m_pickerLayout->layout, EDJE_DIR"/control.edj","data_list_picker");
- evas_object_size_hint_weight_set(m_pickerLayout->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(m_pickerLayout->layout);
- elm_object_content_set(m_pickerLayout->popup, m_pickerLayout->layout);
-
- Evas_Object* elmList = elm_list_add(m_pickerLayout->layout);
- Eina_List* list = 0;
- void* listItem = 0;
- EINA_LIST_FOREACH(optionList, list, listItem) {
- if (listItem)
- elm_list_item_append(elmList, static_cast<char*>(listItem), 0, 0, _data_list_selected_cb, this);
- }
- evas_object_size_hint_weight_set(elmList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(elmList);
- elm_object_part_content_set(m_pickerLayout->layout, "data_list", elmList);
-
- Evas_Object* editFieldLayout = elm_layout_add(m_pickerLayout->layout);
- elm_layout_theme_set(editFieldLayout, "layout", "editfield", "default");
-
- m_pickerLayout->dataListEditField = elm_entry_add(editFieldLayout);
- elm_object_part_content_set(editFieldLayout, "elm.swallow.content", m_pickerLayout->dataListEditField);
-
- elm_object_signal_emit(editFieldLayout, "elm,state,guidetext,hide", "elm");
- elm_object_signal_callback_add(editFieldLayout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, m_pickerLayout->dataListEditField);
- evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "changed", _changed_cb, editFieldLayout);
- evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "focused", _focused_cb, editFieldLayout);
- evas_object_smart_callback_add(m_pickerLayout->dataListEditField, "unfocused", _unfocused_cb, editFieldLayout);
-
- elm_object_part_content_set(m_pickerLayout->layout, "selected_item", editFieldLayout);
- evas_object_show(editFieldLayout);
-
- m_pickerLayout->okButton = elm_button_add(m_pickerLayout->popup);
- elm_object_style_set(m_pickerLayout->okButton, "popup");
- elm_object_text_set(m_pickerLayout->okButton, "OK");
- elm_object_part_content_set(m_pickerLayout->popup, "button1", m_pickerLayout->okButton);
- evas_object_smart_callback_add(m_pickerLayout->okButton, "clicked", _data_list_popup_response_cb, this);
- evas_object_show(m_pickerLayout->popup);
- evas_object_focus_set(m_pickerLayout->okButton, true);
-
- Evas_Object* cancelButton = elm_button_add(m_pickerLayout->popup);
- elm_object_style_set(cancelButton, "popup");
- elm_object_text_set(cancelButton, "Cancel");
- elm_object_part_content_set(m_pickerLayout->popup, "button2", cancelButton);
- evas_object_smart_callback_add(cancelButton, "clicked", _data_list_popup_response_cancel_cb, this);
- evas_object_show(cancelButton);
-}
-
-void InputPicker::hideDataList(Ewk_Input_Type inputType)
-{
- if (!m_dataList)
- return;
-
- if(m_pickerLayout->popup){
- evas_object_del(m_pickerLayout->popup);
- m_pickerLayout->popup = 0;
- }
-
- delete m_pickerLayout;
- m_pickerLayout = 0;
-
- m_dataList = 0;
-}
-#endif
-
#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
void InputPicker::showColorPicker(int r, int g, int b, int)
{