Implement Focus UI
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / efl / WebPageProxyEfl.cpp
index 0507d75..3d7b14d 100755 (executable)
@@ -410,14 +410,23 @@ void WebPageProxy::initializeTizenClient(const WKPageTizenClient* client)
 }
 
 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
+#if ENABLE(TOUCH_ADJUSTMENT)
+WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, const IntSize& area)
+#else
 WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode)
+#endif
 {
     WebHitTestResult::Data hitTestResultData;
     if (!isValid())
         return hitTestResultData;
 
+#if ENABLE(TOUCH_ADJUSTMENT)
+    process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode, area),
+                        Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
+#else
     process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode),
                         Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
+#endif
 
     return hitTestResultData;
 }
@@ -875,33 +884,33 @@ void WebPageProxy::startOfflinePageSave(String subresourceFolderName)
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-bool WebPageProxy::selectClosestWord(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool WebPageProxy::selectClosestWord(const IntPoint& point)
 {
     if (!isValid())
         return false;
 
     bool result = false;
-    process()->sendSync(Messages::WebPage::SelectClosestWord(point, isStartedTextSelectionFromOutside), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
+    process()->sendSync(Messages::WebPage::SelectClosestWord(point), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
     return result;
 }
 
-bool WebPageProxy::setLeftSelection(const IntPoint& point)
+int WebPageProxy::setLeftSelection(const IntPoint& point, const int direction)
 {
     if (!isValid())
-        return false;
+        return 0;
 
-    bool result = false;
-    process()->sendSync(Messages::WebPage::SetLeftSelection(point), Messages::WebPage::SetLeftSelection::Reply(result), m_pageID);
+    int result = 0;
+    process()->sendSync(Messages::WebPage::SetLeftSelection(point, direction), Messages::WebPage::SetLeftSelection::Reply(result), m_pageID);
     return result;
 }
 
-bool WebPageProxy::setRightSelection(const IntPoint& point)
+int WebPageProxy::setRightSelection(const IntPoint& point, const int direction)
 {
     if (!isValid())
-        return false;
+        return 0;
 
-    bool result;
-    process()->sendSync(Messages::WebPage::SetRightSelection(point), Messages::WebPage::SetRightSelection::Reply(result), m_pageID);
+    int result = 0;
+    process()->sendSync(Messages::WebPage::SetRightSelection(point, direction), Messages::WebPage::SetRightSelection::Reply(result), m_pageID);
     return result;
 }
 
@@ -1028,7 +1037,14 @@ void WebPageProxy::clearScreenReader()
     process()->send(Messages::WebPage::ClearScreenReader(), m_pageID);
 }
 
-void WebPageProxy::didScreenReaderFocusRectChanged(const IntRect& rect)
+void WebPageProxy::didScreenReaderTextChanged(const String& text)
+{
+    ScreenReaderProxy::screenReader().setText(text);
+}
+#endif
+
+#if ENABLE(TIZEN_SCREEN_READER) || ENABLE(TIZEN_FOCUS_UI)
+void WebPageProxy::didChangeFocusedRect(const IntRect& rect)
 {
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
     FocusRing* focusRing = ewkViewGetFocusRing(viewWidget());
@@ -1042,11 +1058,7 @@ void WebPageProxy::didScreenReaderFocusRectChanged(const IntRect& rect)
 #else
     UNUSED_PARAM(rect);
 #endif
-}
 
-void WebPageProxy::didScreenReaderTextChanged(const String& text)
-{
-    ScreenReaderProxy::screenReader().setText(text);
 }
 #endif
 
@@ -1232,4 +1244,20 @@ void WebPageProxy::setContentSuspendedByInspector(bool isSuspended)
 }
 #endif
 
+#if ENABLE(TIZEN_FOCUS_UI)
+void WebPageProxy::setSpatialNavigationEnabled(bool enabled)
+{
+    if (m_spatialNavigationEnabled == enabled)
+        return;
+
+    m_spatialNavigationEnabled = enabled;
+
+    if (enabled)
+        static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->focusRing->setImage(FOCUS_UI_FOCUS_RING_IMAGE_PATH, 4, 2);
+    else
+        static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->focusRing->setImage(String(), 0, 0);
+
+    process()->send(Messages::WebPage::SetSpatialNavigationEnabled(enabled), m_pageID);
+}
+#endif
 } // namespace WebKit