}
+result
+FireWebPageShowRequestedEvent(_WebImpl* pImpl, int event)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(event));
+ SysTryReturnResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+
+ return E_SUCCESS;
+}
+
+
void
OnWebPageShowRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
{
result r = E_SUCCESS;
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ r = FireWebPageShowRequestedEvent(pImpl, WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
}
if (pImpl->GetUiEventListenerF())
{
result r = E_SUCCESS;
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ r = FireWebPageShowRequestedEvent(pImpl, WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED_FLOAT);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
}
}
}
+result
+FireWebWindowClosedRequestedEvent(_WebImpl* pImpl, int event)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(event));
+ SysTryReturnResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+
+ return E_SUCCESS;
+}
+
+
void
OnWebWindowClosedRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
{
result r = E_SUCCESS;
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pChildImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ r = FireWebWindowClosedRequestedEvent(pChildImpl, WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
}
if (pParentImpl->GetUiEventListenerF())
{
result r = E_SUCCESS;
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ r = FireWebWindowClosedRequestedEvent(pChildImpl, WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED_FLOAT);
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+}
+
+
+result
+FireWebPreventDefaultTriggeredEvent(_WebImpl* pImpl, int event, bool trigger)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<Boolean> pPreventTrigger(new (std::nothrow) Boolean(trigger));
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(event));
+ SysTryReturnResult(NID_WEB_CTRL, pPreventTrigger.get() && pEventArg.get(), E_OUT_OF_MEMORY, " Memory allocation failed." );
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::PREVENT_DEFAULT, *pPreventTrigger.get());
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
+void
+OnWebPreventDefaultTriggered(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+ Eina_Bool* pTrigger = reinterpret_cast< Eina_Bool* >(pEventInfo);
+ SysAssertf(pImpl && pTrigger, "Failed to request");
+
+ if (pImpl->GetUiEventListener())
+ {
+ result r = E_SUCCESS;
- r = pChildImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ r = FireWebPreventDefaultTriggeredEvent(pImpl, WEB_EVENT_WEBUIEVENTLISTENER_PREVENT_DEFAULT_TRIGGERED, static_cast< bool >(*pTrigger));
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ if (pImpl->GetUiEventListenerF())
+ {
+ result r = E_SUCCESS;
+
+ r = FireWebPreventDefaultTriggeredEvent(pImpl, WEB_EVENT_WEBUIEVENTLISTENER_PREVENT_DEFAULT_TRIGGERED_FLOAT, static_cast< bool >(*pTrigger));
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
}
}
__textSearch.__caseSensitive = false;
__textSearch.__pending = 0;
__textSearch.__currentIndex = 1;
- __textSearch.__totalCount -1;
+ __textSearch.__totalCount = -1;
__textSearch.__text = L"";
}
{
const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(point));
- return GetElementByPointN(integerPoint);
+ std::unique_ptr<const HitElementResult> pHitElementResult(GetElementByPointN(integerPoint));
+ SysTryReturn(NID_WEB_CTRL, pHitElementResult.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ return pHitElementResult.release();
}
}
-result
+void
_WebImpl::SetPrivateBrowsingEnabled(bool enable)
{
if (__pWebCore->GetWebNativeNode() == null)
{
_WebSettingImpl::GetInstance(__pWebSetting.get())->SetPrivateBrowsingEnabled(enable);
- return E_SUCCESS;
+ return;
}
Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode());
SysAssertf(pSettings, "Failed to get webkit instance.");
ewk_settings_private_browsing_enabled_set(pSettings, static_cast< Eina_Bool >(enable));
-
- return E_SUCCESS;
}
}
-result
+void
_WebImpl::SetScrollEnabled(bool enable)
{
_WebSettingImpl::GetInstance(__pWebSetting.get())->SetScrollEnabled(enable);
-
- return E_SUCCESS;
}
__pJsBridgeList = std::move(pJsBridgeList);
- return r;
+ return E_SUCCESS;
}
r = __pJsBridgeList->Add(key, pJsBridge);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return E_SUCCESS;
}
r = __pJsBridgeList->Remove(key);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return E_SUCCESS;
}
evas_object_smart_callback_add(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested, this);
evas_object_smart_callback_add(pWebNativeNode, "text,found", OnTextFound, this);
+ evas_object_smart_callback_add(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered, this);
+
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
SysAssertf(pContext, "Failed to get webkit instance.");
ewk_context_did_start_download_callback_set(pContext, OnDidStartDownloadCallback, const_cast< _WebImpl* >(this));
evas_object_smart_callback_del(pWebNativeNode, "text,found", OnTextFound);
+ evas_object_smart_callback_del(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered);
+
ewk_view_open_panel_callback_set(null, null, null);
evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
result
_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
{
- const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(startPoint));
+ Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
+
+ Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
+ SysAssertf(pSmartData, "Failed to request");
+
+ Point absPoint(__pWebCore->GetAbsoluteCoordinate(_CoordinateSystemUtils::ConvertToInteger(startPoint)));
+
+ pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
+ pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
- return SetBlockSelectionPosition(integerPoint);
+ ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+
+ SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+
+ if (__pUserUiListenerF)
+ {
+ FireWebPageBlockSelectedEventF();
+ }
+
+ return E_SUCCESS;
}
-result
+void
+_WebImpl::FireWebPageBlockSelectedEvent(void) const
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
+ std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
+ SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ GetBlockRange(*startPoint.get(), *endPoint.get());
+
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
+ SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ startPoint.release();
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ endPoint.release();
+
+ r = __pWebEvent->FireAsync(*pEventArg.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+}
+
+
+void
+_WebImpl::FireWebPageBlockSelectedEventF(void) const
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<FloatPoint> startPoint(new (std::nothrow) FloatPoint());
+ std::unique_ptr<FloatPoint> endPoint(new (std::nothrow) FloatPoint());
+ SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ GetBlockRange(*startPoint.get(), *endPoint.get());
+
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED_FLOAT));
+ SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ startPoint.release();
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ endPoint.release();
+
+ r = __pWebEvent->FireAsync(*pEventArg.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+}
+
+
+void
_WebImpl::ReleaseBlock(void)
{
ewk_view_command_execute(__pWebCore->GetWebNativeNode(), "Unselect", 0);
-
- return E_SUCCESS;
}
-result
+void
_WebImpl::GetBlockRange(Point& startPoint, Point& endPoint) const
{
Eina_Rectangle leftHandle;
startPoint = __pWebCore->GetRelativeCoordinate(startPoint);
endPoint = __pWebCore->GetRelativeCoordinate(endPoint);
}
-
- return E_SUCCESS;
}
-result
+void
_WebImpl::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
{
Eina_Rectangle leftHandle;
startPoint = __pWebCore->GetRelativeCoordinate(startPoint);
endPoint = __pWebCore->GetRelativeCoordinate(endPoint);
}
-
- return E_SUCCESS;
}
void
-_WebImpl::FireWebPageBlockSelectedEvent(void) const
-{
- result r = E_SUCCESS;
-
- std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
- std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
- std::unique_ptr<FloatPoint> startPointF(new (std::nothrow) FloatPoint());
- std::unique_ptr<FloatPoint> endPointF(new (std::nothrow) FloatPoint());
- SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get() && startPointF.get() && endPointF.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = GetBlockRange(*startPoint.get(), *endPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = GetBlockRange(*startPointF.get(), *endPointF.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- startPoint.release();
-
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- endPoint.release();
-
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START_FLOAT, *startPointF.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- startPointF.release();
-
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END_FLOAT, *endPointF.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- endPointF.release();
-
- r = __pWebEvent->FireAsync(*pEventArg.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
-}
-
-void
_WebImpl::SetLoadingErrorOccurred(bool arg)
{
__isLoadingErrorOccurred = arg;
}
case WEB_EVENT_REQUEST_UNKNOWN:
{
+ operationId = L"http://tizen.org/appcontrol/operation/view";
break;
}
default:
SysLog(NID_WEB_CTRL, "The current value of event type is %d", pEventArg->GetEventType());
- IWebUiEventListener* pWebUiEventListener = GetUiEventListener();
- IWebUiEventListenerF* pWebUiEventListenerF = GetUiEventListenerF();
- SysTryReturnResult(NID_WEB_CTRL, pWebUiEventListener || pWebUiEventListenerF, E_SYSTEM, "A system error has been occurred. Web UI listener was not set or null.");
+ SysTryReturnResult(NID_WEB_CTRL, __pUserUiListener, E_SYSTEM, "A system error has been occurred. Web UI listener was not set or null.");
- if (pWebUiEventListener)
+ switch (pEventArg->GetEventType())
{
- switch (pEventArg->GetEventType())
- {
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- Point* pStartPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START)));
- SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Point* pStartPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START)));
+ SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- Point* pEndPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END)));
- SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Point* pEndPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END)));
+ SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pWebUiEventListener->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
- break;
- }
+ __pUserUiListener->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
+ break;
+ }
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- pWebUiEventListener->OnWebPageShowRequested(*pWeb);
- break;
- }
+ __pUserUiListener->OnWebPageShowRequested(*pWeb);
+ break;
+ }
- case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- pWebUiEventListener->OnWebWindowCloseRequested(*pWeb);
- break;
- }
+ __pUserUiListener->OnWebWindowCloseRequested(*pWeb);
+ break;
+ }
- default:
- {
- SysAssert(false);
- }
- }
+ case WEB_EVENT_WEBUIEVENTLISTENER_PREVENT_DEFAULT_TRIGGERED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ Boolean* pTrigger = const_cast< Boolean* >(dynamic_cast< const Boolean* >(pEventArg->GetEventInfo(_WebUiEventArg::PREVENT_DEFAULT)));
+ SysTryReturn(NID_WEB_CTRL, pTrigger, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pUserUiListener->OnWebPreventDefaultTriggered(*pWeb, pTrigger->ToBool());
+ break;
}
- if (pWebUiEventListenerF)
+
+ default:
{
- switch (pEventArg->GetEventType())
- {
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ SysAssert(false);
+ }
+ }
- FloatPoint* pStartPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START_FLOAT)));
- SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ return E_SUCCESS;
+}
- FloatPoint* pEndPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END_FLOAT)));
- SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pWebUiEventListenerF->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
- break;
- }
+result
+_WebImpl::OnHandleWebUiEventF(const IEventArg& arg)
+{
+ result r = E_SUCCESS;
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ const _WebUiEventArg* pEventArg = dynamic_cast< const _WebUiEventArg* >(&arg);
+ SysTryReturnResult(NID_WEB_CTRL, pEventArg, E_INVALID_ARG, "Invalid argument(s) is used. Type casting failed. argument must be IEventArg type.");
- pWebUiEventListenerF->OnWebPageShowRequested(*pWeb);
- break;
- }
+ SysLog(NID_WEB_CTRL, "The current value of event type is %d", pEventArg->GetEventType());
- case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ SysTryReturnResult(NID_WEB_CTRL, __pUserUiListenerF, E_SYSTEM, "A system error has been occurred. Web UI listener was not set or null.");
- pWebUiEventListenerF->OnWebWindowCloseRequested(*pWeb);
- break;
- }
+ switch (pEventArg->GetEventType())
+ {
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED_FLOAT:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- default:
- {
- SysAssert(false);
- }
- }
+ FloatPoint* pStartPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START)));
+ SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ FloatPoint* pEndPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END)));
+ SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pUserUiListenerF->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
+ break;
}
- return r;
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED_FLOAT:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ __pUserUiListenerF->OnWebPageShowRequested(*pWeb);
+ break;
+ }
+
+ case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED_FLOAT:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ __pUserUiListenerF->OnWebWindowCloseRequested(*pWeb);
+ break;
+ }
+
+ case WEB_EVENT_WEBUIEVENTLISTENER_PREVENT_DEFAULT_TRIGGERED_FLOAT:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ Boolean* pTrigger = const_cast< Boolean* >(dynamic_cast< const Boolean* >(pEventArg->GetEventInfo(_WebUiEventArg::PREVENT_DEFAULT)));
+ SysTryReturn(NID_WEB_CTRL, pTrigger, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ __pUserUiListenerF->OnWebPreventDefaultTriggered(*pWeb, pTrigger->ToBool());
+ break;
+ }
+
+ default:
+ {
+ SysAssert(false);
+ }
+ }
+
+ return E_SUCCESS;
}