#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
#include <dali-toolkit/devel-api/controls/web-view/web-context.h>
#include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
#include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
}
}
-WebView::WebView(int argc, char** argv)
+WebView::WebView(uint32_t argc, char** argv)
: Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
mUrl(),
mVisual(),
return handle;
}
-Toolkit::WebView WebView::New(int argc, char** argv)
+Toolkit::WebView WebView::New(uint32_t argc, char** argv)
{
WebView* impl = new WebView(argc, argv);
Toolkit::WebView handle = Toolkit::WebView(*impl);
return mWebEngine ? mWebEngine.StopInspectorServer() : false;
}
-void WebView::ScrollBy(int deltaX, int deltaY)
+void WebView::ScrollBy(int32_t deltaX, int32_t deltaY)
{
if(mWebEngine)
{
}
}
-bool WebView::ScrollEdgeBy(int deltaX, int deltaY)
+bool WebView::ScrollEdgeBy(int32_t deltaX, int32_t deltaY)
{
return mWebEngine ? mWebEngine.ScrollEdgeBy(deltaX, deltaY) : false;
}
}
}
+std::unique_ptr<Dali::WebEngineHitTest> WebView::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
+{
+ std::unique_ptr<Dali::WebEngineHitTest> webHitTest;
+ if(!mWebEngine)
+ {
+ return webHitTest;
+ }
+
+ return mWebEngine.CreateHitTest(x, y, mode);
+}
+
+bool WebView::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
+{
+ bool result = false;
+ if(mWebEngine)
+ {
+ result = mWebEngine.CreateHitTestAsynchronously(x, y, mode, callback);
+ }
+ return result;
+}
+
void WebView::ClearHistory()
{
if(mWebEngine)
}
}
-Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor)
+Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
{
Dali::Toolkit::ImageView imageView;
if(mWebEngine)
return imageView;
}
-bool WebView::GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback)
+bool WebView::GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback)
{
mScreenshotCapturedCallback = callback;
return mWebEngine ? mWebEngine.GetScreenshotAsynchronously(viewArea, scaleFactor, std::bind(&WebView::OnScreenshotCaptured, this, std::placeholders::_1)) : false;
Vector3 anchorPointOffSet = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
Vector2 screenPosition = self.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
- Dali::Rect<int> displayArea;
+ Dali::Rect<int32_t> displayArea;
displayArea.x = screenPosition.x - anchorPointOffSet.x;
displayArea.y = screenPosition.y - anchorPointOffSet.y;
displayArea.width = actorSize.x;
{
if(!mFormRepostDecisionSignal.Empty())
{
- Dali::Toolkit::WebView handle(GetOwner());
- std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> repostDecision(new Dali::Toolkit::WebFormRepostDecision(decision));
- mFormRepostDecisionSignal.Emit(handle, std::move(repostDecision));
+ Dali::Toolkit::WebView handle(GetOwner());
+ mFormRepostDecisionSignal.Emit(handle, std::move(decision));
}
}
bool WebView::OnHoverEvent(Actor actor, const Dali::HoverEvent& hover)
{
bool result = false;
- if(mWebEngine)
+ if(mWebEngine && mMouseEventsEnabled)
{
result = mWebEngine.SendHoverEvent(hover);
}
bool WebView::OnWheelEvent(Actor actor, const Dali::WheelEvent& wheel)
{
bool result = false;
- if(mWebEngine)
+ if(mWebEngine && mMouseEventsEnabled)
{
result = mWebEngine.SendWheelEvent(wheel);
}
EmitKeyInputFocusSignal(false); // Calls back into the Control hence done last.
}
-void WebView::SetScrollPosition(int x, int y)
+void WebView::SetScrollPosition(int32_t x, int32_t y)
{
if(mWebEngine)
{