Merge "[dali-toolkit] fix set max character length when text already set" into devel...
authorjoogab yun <joogab.yun@samsung.com>
Thu, 15 Apr 2021 05:09:23 +0000 (05:09 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 15 Apr 2021 05:09:23 +0000 (05:09 +0000)
93 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Markup.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-toolkit/devel-api/controls/accessible-impl.cpp
dali-toolkit/devel-api/controls/accessible-impl.h
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/devel-api/controls/text-controls/text-label-devel.cpp [moved from dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.cpp with 57% similarity]
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.cpp [deleted file]
dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h [deleted file]
dali-toolkit/devel-api/controls/web-view/web-back-forward-list.cpp [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-context.cpp
dali-toolkit/devel-api/controls/web-view/web-context.h [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h [deleted file]
dali-toolkit/devel-api/controls/web-view/web-settings.cpp
dali-toolkit/devel-api/controls/web-view/web-settings.h
dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/text/text-utils-devel.cpp
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/radio-button-impl.cpp
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/graphics/shaders/color-visual-blur-edge-shader.frag
dali-toolkit/internal/graphics/shaders/color-visual-blur-edge-shader.vert
dali-toolkit/internal/graphics/shaders/color-visual-rounded-corner-shader.frag
dali-toolkit/internal/graphics/shaders/color-visual-rounded-corner-shader.vert
dali-toolkit/internal/graphics/shaders/gradient-visual-bounding-box-rounded-corner-shader.vert
dali-toolkit/internal/graphics/shaders/gradient-visual-linear-rounded-corner-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-radial-rounded-corner-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-user-space-rounded-corner-shader.vert
dali-toolkit/internal/graphics/shaders/image-visual-rounded-corner-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-rounded-corner-shader.vert
dali-toolkit/internal/text/anchor.h [new file with mode: 0644]
dali-toolkit/internal/text/logical-model-impl.cpp
dali-toolkit/internal/text/logical-model-impl.h
dali-toolkit/internal/text/markup-processor-anchor.cpp [new file with mode: 0644]
dali-toolkit/internal/text/markup-processor-anchor.h [new file with mode: 0644]
dali-toolkit/internal/text/markup-processor.cpp
dali-toolkit/internal/text/markup-processor.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-anchor-control-interface.h [new file with mode: 0644]
dali-toolkit/internal/text/text-controller-event-handler.cpp
dali-toolkit/internal/text/text-controller-event-handler.h
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/text/text-controller-text-updater.cpp
dali-toolkit/internal/text/text-controller-text-updater.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
dali-toolkit/styles/images-common/IoT-selection-popup-background.9.png [new file with mode: 0644]
packaging/dali-toolkit.spec

index b7a1122..d98f397 100755 (executable)
@@ -108,7 +108,8 @@ void CreateTextModel( const std::string& text,
 
   MarkupProcessData markupProcessData( logicalModel->mColorRuns,
                                        logicalModel->mFontDescriptionRuns,
-                                       logicalModel->mEmbeddedItems );
+                                       logicalModel->mEmbeddedItems,
+                                       logicalModel->mAnchors );
 
   Length textSize = 0u;
   const uint8_t* utf8 = NULL;
index bd8f3a4..f3d97a9 100644 (file)
@@ -98,6 +98,9 @@ int UtcDaliAccessibilityPushButtonStates(void)
 
   Dali::Accessibility::TestEnableSC( true );
 
+  /* add to scene and remove from scene to touch AccessibilityDeregister */
+  application.GetScene().Add( pushbutton );
+
   auto states = accessible->GetStates();
   DALI_TEST_EQUALS( static_cast< unsigned int >( states[ Accessibility::State::PRESSED ] ), false, TEST_LOCATION );
 
@@ -108,6 +111,9 @@ int UtcDaliAccessibilityPushButtonStates(void)
   states = accessible->GetStates();
   DALI_TEST_EQUALS( static_cast< unsigned int >( states[ Accessibility::State::PRESSED ] ), true, TEST_LOCATION );
 
+  /* add to scene and remove from scene to touch AccessibilityDeregister */
+  application.GetScene().Remove( pushbutton );
+
   Dali::Accessibility::TestEnableSC( false );
 
   END_TEST;
index 779eb56..6e2d632 100755 (executable)
@@ -184,7 +184,8 @@ namespace
     Vector<ColorRun> colorRuns;
     Vector<FontDescriptionRun> fontRuns;
     Vector<EmbeddedItem> items;
-    MarkupProcessData markupProcessData( colorRuns, fontRuns, items );
+    Vector<Anchor> anchors;
+    MarkupProcessData markupProcessData( colorRuns, fontRuns, items, anchors );
     ProcessMarkupString( data.xHTMLEntityString, markupProcessData );
 
     for( Vector<EmbeddedItem>::Iterator it = items.Begin(),
index 54e8f77..51f0721 100644 (file)
@@ -682,6 +682,16 @@ void TestGraphicsController::Resume()
   mCallStack.PushCall("Resume", "");
 }
 
+void TestGraphicsController::Shutdown()
+{
+  mCallStack.PushCall("Shutdown", "");
+}
+
+void TestGraphicsController::Destroy()
+{
+  mCallStack.PushCall("Destroy", "");
+}
+
 void TestGraphicsController::UpdateTextures(const std::vector<Graphics::TextureUpdateInfo>&       updateInfoList,
                                             const std::vector<Graphics::TextureUpdateSourceInfo>& sourceList)
 {
index d70ed3b..803678e 100644 (file)
@@ -87,6 +87,16 @@ public:
   void Resume() override;
 
   /**
+   * @brief Lifecycle shutdown event
+   */
+  void Shutdown() override;
+
+  /**
+   * @brief Lifecycle destroy event
+   */
+  void Destroy() override;
+
+  /**
    * @brief Executes batch update of textures
    *
    * This function may perform full or partial update of many textures.
index db94ec0..430615d 100755 (executable)
 #include <dali/devel-api/adaptor-framework/web-engine.h>
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.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-frame.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/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/property-map.h>
 #include <memory>
 #include <string.h>
 #include <toolkit-application.h>
@@ -43,14 +54,16 @@ namespace Adaptor
 {
 
 class WebEngine;
+class MockWebEngineContext;
 
 namespace
 {
 
 // Generally only one WebEngine instance exists.
 // If > 1, a new web engine has been created by CreateWindowSignal.
-static WebEngine* gInstance = 0;
+static WebEngine* gInstance = nullptr;
 static int gInstanceCount = 0;
+static MockWebEngineContext* gWebEngineContextInstance = nullptr;
 
 bool OnGoBack();
 bool OnGoForward();
@@ -59,11 +72,17 @@ bool OnEvaluteJavaScript();
 bool OnJavaScriptAlert();
 bool OnJavaScriptConfirm();
 bool OnJavaScriptPrompt();
+bool OnHitTestCreated();
 bool OnScrollEdge();
 bool OnScreenshotCaptured();
 bool OnVideoPlaying();
 bool OnGeolocationPermission();
 bool OnClearHistory();
+bool OnSecurityOriginAcquired();
+bool OnStorageUsageAcquired();
+bool OnFormPasswordAcquired();
+bool OnDownloadStarted();
+bool OnMimeOverridden();
 
 static void ConnectToGlobalSignal( bool ( *func )() )
 {
@@ -108,12 +127,52 @@ public:
   {
   }
 
-  void DeleteWebDatabase() override
+  void DeleteAllWebDatabase() override
   {
   }
 
-  void DeleteWebStorage() override
+  bool GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
   {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnSecurityOriginAcquired);
+      mSecurityOriginAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  bool DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
+  }
+
+  bool GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnSecurityOriginAcquired);
+      mSecurityOriginAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  bool GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback) 
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnStorageUsageAcquired);
+      mStorageUsageAcquiredCallback = callback;
+    }
+    return true;
+  }
+
+  void DeleteAllWebStorage() override
+  {
+  }
+
+  bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
   }
 
   void DeleteLocalFileSystem() override
@@ -128,6 +187,45 @@ public:
   {
   }
 
+  bool DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
+  {
+    return true;
+  }
+
+  void GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnFormPasswordAcquired);
+      mFormPasswordAcquiredCallback = callback;
+    }
+  }
+
+  void RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnDownloadStarted);
+      mDownloadStartedCallback = callback;
+    }
+  }
+
+  void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal(&OnMimeOverridden);
+      mMimeOverriddenCallback = callback;
+    }
+  }
+
+public:
+  Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback mSecurityOriginAcquiredCallback;
+  Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback mStorageUsageAcquiredCallback;
+  Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback mFormPasswordAcquiredCallback;
+  Dali::WebEngineContext::WebEngineDownloadStartedCallback mDownloadStartedCallback;
+  Dali::WebEngineContext::WebEngineMimeOverriddenCallback mMimeOverriddenCallback;
+
 private:
   Dali::WebEngineContext::CacheModel mockModel;
 };
@@ -197,19 +295,31 @@ class MockWebEngineBackForwardList : public Dali::WebEngineBackForwardList
 {
 public:
   MockWebEngineBackForwardList()
-    : mockItem(),
-      pMockItem( &mockItem )
   {
   }
 
-  Dali::WebEngineBackForwardListItem& GetCurrentItem() const override
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem() const override
+  {
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
+    return ret;
+  }
+
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem() const override
   {
-    return *pMockItem;
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
+    return ret;
   }
 
-  Dali::WebEngineBackForwardListItem& GetItemAtIndex( uint32_t index ) const override
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem() const override
   {
-    return *pMockItem;
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
+    return ret;
+  }
+
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex( uint32_t index ) const override
+  {
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> ret(new MockWebEngineBackForwardListItem());
+    return ret;
   }
 
   uint32_t GetItemCount() const override
@@ -217,9 +327,74 @@ public:
     return 1;
   }
 
-private:
-  MockWebEngineBackForwardListItem mockItem;
-  WebEngineBackForwardListItem* pMockItem;
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit) override
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> ret;
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> item(new MockWebEngineBackForwardListItem());
+    ret.push_back(std::move(item));
+    return ret;
+  }
+
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit) override
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> ret;
+    std::unique_ptr<Dali::WebEngineBackForwardListItem> item(new MockWebEngineBackForwardListItem());
+    ret.push_back(std::move(item));
+    return ret;
+  }
+};
+
+
+class MockWebEngineCertificate : public Dali::WebEngineCertificate
+{
+public:
+  MockWebEngineCertificate()
+  {
+  }
+
+  void Allow(bool allowed) override
+  {
+  }
+
+  bool IsFromMainFrame() const override
+  {
+    return true;
+  }
+
+  std::string GetPem() const override
+  {
+    return "abc";
+  }
+
+  bool IsContextSecure() const override
+  {
+    return true;
+  }
+};
+
+class MockWebEngineHttpAuthHandler : public Dali::WebEngineHttpAuthHandler
+{
+public:
+  MockWebEngineHttpAuthHandler()
+  {
+  }
+
+  std::string GetRealm() const override
+  {
+    return "test";
+  }
+
+  void Suspend() override
+  {
+  }
+
+  void UseCredential(const std::string& user, const std::string& password) override
+  {
+  }
+
+  void CancelCredential() override
+  {
+  }
 };
 
 class MockWebEngineFormRepostDecision : public WebEngineFormRepostDecision
@@ -232,6 +407,85 @@ public:
   void Reply(bool allowed) override {}
 };
 
+class MockWebEngineFrame : public Dali::WebEngineFrame
+{
+public:
+  MockWebEngineFrame()
+  {
+  }
+
+  bool IsMainFrame() const override
+  {
+    return true;
+  }
+};
+
+class MockWebEnginePolicyDecision : public Dali::WebEnginePolicyDecision
+{
+public:
+  MockWebEnginePolicyDecision()
+  {
+  }
+
+  std::string GetUrl() const override
+  {
+    return "http://test.html";
+  }
+
+  std::string GetCookie() const override
+  {
+    return "test:abc";
+  }
+
+  Dali::WebEnginePolicyDecision::DecisionType GetDecisionType() const
+  {
+    return Dali::WebEnginePolicyDecision::DecisionType::USE;
+  }
+
+  std::string GetResponseMime() const
+  {
+    return "txt/xml";
+  }
+
+  int32_t GetResponseStatusCode() const
+  {
+    return 500;
+  }
+
+  Dali::WebEnginePolicyDecision::NavigationType GetNavigationType() const
+  {
+    return Dali::WebEnginePolicyDecision::NavigationType::LINK_CLICKED;
+  }
+
+  Dali::WebEngineFrame& GetFrame() const
+  {
+    return *(Dali::WebEngineFrame*)(&mockWebFrame);
+  }
+
+  std::string GetScheme() const
+  {
+    return "test";
+  }
+
+  bool Use()
+  {
+    return true;
+  }
+
+  bool Ignore()
+  {
+    return true;
+  }
+
+  bool Suspend()
+  {
+    return true;
+  }
+
+private:
+  MockWebEngineFrame mockWebFrame;
+};
+
 class MockWebEngineRequestInterceptor : public WebEngineRequestInterceptor
 {
 public:
@@ -265,6 +519,261 @@ public:
   }
 };
 
+class MockWebEngineConsoleMessage : public Dali::WebEngineConsoleMessage
+{
+public:
+  MockWebEngineConsoleMessage()
+  {
+  }
+
+  std::string GetSource() const override
+  {
+    return "source";
+  }
+
+  uint32_t GetLine() const override
+  {
+    return 10;
+  }
+
+  SeverityLevel GetSeverityLevel() const override
+  {
+    return SeverityLevel::EMPTY;
+  }
+
+  std::string GetText() const override
+  {
+    return "This is a text.";
+  }
+};
+
+class MockWebEngineLoadError : public Dali::WebEngineLoadError
+{
+public:
+  MockWebEngineLoadError(const std::string& url)
+    : mockUrl(url)
+  {
+  }
+
+  std::string GetUrl() const override
+  {
+    return mockUrl;
+  }
+
+  ErrorCode GetCode() const override
+  {
+    return ErrorCode::UNKNOWN;
+  }
+
+  std::string GetDescription() const override
+  {
+    return "This is an error.";
+  }
+
+  ErrorType GetType() const override
+  {
+    return ErrorType::NONE;
+  }
+
+private:
+  std::string mockUrl;
+};
+
+class MockWebEngineContextMenuItem : public Dali::WebEngineContextMenuItem
+{
+public:
+  MockWebEngineContextMenuItem()
+  {
+  }
+
+  ItemTag GetTag() const override
+  {
+    return ItemTag::NO_ACTION;
+  }
+
+  ItemType GetType() const override
+  {
+    return ItemType::ACTION;
+  }
+
+  bool IsEnabled() const override
+  {
+    return true;
+  }
+
+  std::string GetLinkUrl() const override
+  {
+    return "http://test.html";
+  }
+
+  std::string GetImageUrl() const override
+  {
+    return "http://test.jpg";
+  }
+
+  std::string GetTitle() const override
+  {
+    return "title";
+  }
+
+  std::unique_ptr<Dali::WebEngineContextMenu> GetParentMenu() const override
+  {
+    std::unique_ptr<Dali::WebEngineContextMenu> result;
+    return result;
+  }
+};
+
+class MockWebEngineContextMenu : public Dali::WebEngineContextMenu
+{
+public:
+  MockWebEngineContextMenu()
+  {
+  }
+
+  uint32_t GetItemCount() const override
+  {
+    return 1;
+  }
+
+  std::unique_ptr<Dali::WebEngineContextMenuItem> GetItemAt(uint32_t index) const override
+  {
+    std::unique_ptr<Dali::WebEngineContextMenuItem> webitem(new MockWebEngineContextMenuItem());
+    return webitem;
+  }
+
+  std::vector<std::unique_ptr<WebEngineContextMenuItem>> GetItemList() const override
+  {
+    std::vector<std::unique_ptr<WebEngineContextMenuItem>> result;
+    std::unique_ptr<Dali::WebEngineContextMenuItem> webitem(new MockWebEngineContextMenuItem());
+    result.push_back(std::move(webitem));
+    return result;
+  }
+
+  Dali::Vector2 GetPosition() const override
+  {
+    return Dali::Vector2(100, 100);
+  }
+
+  bool RemoveItem(WebEngineContextMenuItem& item) override
+  {
+    return true;
+  }
+
+  bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) override
+  {
+    return true;
+  }
+
+  bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) override
+  {
+    return true;
+  }
+
+  bool SelectItem(WebEngineContextMenuItem& item) override
+  {
+    return true;
+  }
+
+  bool Hide() override
+  {
+    return true;
+  }
+};
+
+class MockWebEngineHitTest : public Dali::WebEngineHitTest
+{
+public:
+  MockWebEngineHitTest()
+  {
+  }
+
+  ResultContext GetResultContext() const override
+  {
+    return ResultContext::DOCUMENT;
+  }
+
+  std::string GetLinkUri() const override
+  {
+    return "http://test.html";
+  }
+
+  std::string GetLinkTitle() const override
+  {
+    return "test";
+  }
+
+  std::string GetLinkLabel() const override
+  {
+    return "label";
+  }
+
+  std::string GetImageUri() const override
+  {
+    return "http://test.jpg";
+  }
+
+  std::string GetMediaUri() const override
+  {
+    return "http://test.mp4";
+  }
+
+  std::string GetTagName() const override
+  {
+    return "img";
+  }
+
+  std::string GetNodeValue() const override
+  {
+    return "test";
+  }
+
+  Dali::Property::Map& GetAttributes() const override
+  {
+    return mockAttributesMap;
+  }
+
+  std::string GetImageFileNameExtension() const override
+  {
+    return "jpg";
+  }
+
+  Dali::PixelData GetImageBuffer() override
+  {
+    uint8_t* faviconData = new uint8_t[ 16 ];
+    memset(faviconData, 0xff, 16);
+    return Dali::PixelData::New( faviconData, 16, 2, 2,
+                                 Dali::Pixel::Format::RGBA8888,
+                                 Dali::PixelData::ReleaseFunction::DELETE_ARRAY );
+  }
+
+private:
+  mutable Dali::Property::Map mockAttributesMap;
+};
+
+class MockWebEngineSecurityOrigin : public Dali::WebEngineSecurityOrigin
+{
+public:
+  MockWebEngineSecurityOrigin()
+    : mockUrl("https://test.html")
+    , mockPotocol("https")
+  {
+  }
+
+  std::string GetHost() const
+  {
+    return mockUrl;
+  }
+
+  std::string GetProtocol() const
+  {
+    return mockPotocol;
+  }
+
+private:
+  std::string mockUrl;
+  std::string mockPotocol;
+};
+
 class MockWebEngineSettings : public WebEngineSettings
 {
 public:
@@ -480,6 +989,40 @@ public:
   {
   }
 
+  bool SetViewportMetaTag(bool enable) override
+  {
+    return true;
+  }
+
+  bool SetForceZoom(bool enable) override
+  {
+    return true;
+  }
+
+  bool IsZoomForced() const override
+  {
+    return true;
+  }
+
+  bool SetTextZoomEnabled(bool enable) override
+  {
+    return true;
+  }
+
+  bool IsTextZoomEnabled() const override
+  {
+    return true;
+  }
+
+  void SetExtraFeature(const std::string& feature, bool enable) override
+  {
+  }
+
+  bool IsExtraFeatureEnabled(const std::string& feature) const override
+  {
+    return  true;
+  }
+
 private:
   int mockDefaultFontSize;
   bool mockJavaScriptEnabled;
@@ -521,7 +1064,12 @@ public:
     }
 
     mockWebEngineSettings = new MockWebEngineSettings();
-    mockWebEngineContext = new MockWebEngineContext();
+    MockWebEngineContext* engineContext = new MockWebEngineContext();
+    mockWebEngineContext = engineContext;
+    if ( gInstanceCount == 1 )
+    {
+      gWebEngineContextInstance = engineContext;
+    }
     mockWebEngineCookieManager = new MockWebEngineCookieManager();
     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
   }
@@ -532,6 +1080,7 @@ public:
     if( !gInstanceCount )
     {
       gInstance = 0;
+      gWebEngineContextInstance = 0;
     }
 
     delete mockWebEngineSettings;
@@ -661,6 +1210,22 @@ public:
     }
   }
 
+  std::unique_ptr<Dali::WebEngineHitTest> CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
+  {
+    std::unique_ptr<Dali::WebEngineHitTest> hitTest(new MockWebEngineHitTest());
+    return hitTest;
+  }
+
+  bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
+  {
+    if (callback)
+    {
+      ConnectToGlobalSignal( &OnHitTestCreated );
+      mHitTestCreatedCallback = callback;
+    }
+    return true;
+  }
+
   void ClearHistory()
   {
     ConnectToGlobalSignal( &OnClearHistory );
@@ -676,7 +1241,7 @@ public:
     mUserAgent = userAgent;
   }
 
-  void ScrollBy( int dx, int dy )
+  void ScrollBy( int32_t dx, int32_t dy )
   {
     mScrollPosition += Dali::Vector2( dx, dy );
     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
@@ -685,7 +1250,7 @@ public:
     }
   }
 
-  bool ScrollEdgeBy( int dx, int dy )
+  bool ScrollEdgeBy( int32_t dx, int32_t dy )
   {
     mScrollPosition += Dali::Vector2( dx, dy );
     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
@@ -695,7 +1260,7 @@ public:
     return true;
   }
 
-  void SetScrollPosition( int x, int y )
+  void SetScrollPosition( int32_t x, int32_t y )
   {
     mScrollPosition.x = x;
     mScrollPosition.y = y;
@@ -751,7 +1316,7 @@ public:
     return mScaleFactor;
   }
 
-  Dali::PixelData GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor)
+  Dali::PixelData GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
   {
     uint32_t bufferSize = viewArea.width * viewArea.height * 4 ;
     uint8_t* pixel = new uint8_t[ bufferSize ];
@@ -761,7 +1326,7 @@ public:
                                  Dali::PixelData::ReleaseFunction::DELETE_ARRAY );
   }
 
-  bool GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
+  bool GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
   {
     if ( callback )
     {
@@ -835,20 +1400,62 @@ public:
     return mRequestInterceptorSignal;
   }
 
+  Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal()
+  {
+    return mConsoleMessageSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal()
+  {
+    return mPolicyDecisionSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal()
+  {
+    return mCertificateConfirmSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal()
+  {
+    return mSslCertificateChangedSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal()
+  {
+    return mHttpAuthHandlerSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal()
+  {
+    return mContextMenuCustomizedSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal()
+  {
+    return mContextMenuItemSelectedSignal;
+  }
+
   std::string              mUrl;
   std::vector<std::string> mHistory;
   size_t                   mCurrentPlusOnePos;
   std::string              mUserAgent;
 
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType           mPageLoadStartedSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType           mPageLoadInProgressSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType           mPageLoadFinishedSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType      mPageLoadErrorSignal;
-  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType  mScrollEdgeReachedSignal;
-  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType         mUrlChangedSignal;
-  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType mFormRepostDecisionSignal;
-  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType      mFrameRenderedSignal;
-  Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType mRequestInterceptorSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadStartedSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadInProgressSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadFinishedSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType           mPageLoadErrorSignal;
+  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
+  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType              mUrlChangedSignal;
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType      mFormRepostDecisionSignal;
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType           mFrameRenderedSignal;
+  Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType      mRequestInterceptorSignal;
+  Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType          mConsoleMessageSignal;
+  Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType          mPolicyDecisionSignal;
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType             mCertificateConfirmSignal;
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType             mSslCertificateChangedSignal;
+  Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
+  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
+  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
 
   bool  mEvaluating;
   float mPageZoomFactor;
@@ -863,13 +1470,14 @@ public:
   WebEngineCookieManager*   mockWebEngineCookieManager;
   WebEngineSettings*        mockWebEngineSettings;
 
-  std::vector<JavaScriptEvaluatedResultCallback>              mResultCallbacks;
-  Dali::WebEnginePlugin::JavaScriptAlertCallback              mJavaScriptAlertCallback;
-  Dali::WebEnginePlugin::JavaScriptConfirmCallback            mJavaScriptConfirmCallback;
-  Dali::WebEnginePlugin::JavaScriptPromptCallback             mJavaScriptPromptCallback;
-  Dali::WebEnginePlugin::ScreenshotCapturedCallback           mScreenshotCapturedCallback;
-  Dali::WebEnginePlugin::VideoPlayingCallback                 mVideoPlayingCallback;
-  Dali::WebEnginePlugin::GeolocationPermissionCallback        mGeolocationPermissionCallback;
+  std::vector<JavaScriptEvaluatedResultCallback>         mResultCallbacks;
+  Dali::WebEnginePlugin::JavaScriptAlertCallback         mJavaScriptAlertCallback;
+  Dali::WebEnginePlugin::JavaScriptConfirmCallback       mJavaScriptConfirmCallback;
+  Dali::WebEnginePlugin::JavaScriptPromptCallback        mJavaScriptPromptCallback;
+  Dali::WebEnginePlugin::ScreenshotCapturedCallback      mScreenshotCapturedCallback;
+  Dali::WebEnginePlugin::VideoPlayingCallback            mVideoPlayingCallback;
+  Dali::WebEnginePlugin::GeolocationPermissionCallback   mGeolocationPermissionCallback;
+  Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback mHitTestCreatedCallback;
 };
 
 
@@ -915,11 +1523,30 @@ bool OnLoadUrl()
     gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
     gInstance->mUrlChangedSignal.Emit( "http://new-test" );
 
-    std::shared_ptr<Dali::WebEngineFormRepostDecision> decision(new MockWebEngineFormRepostDecision());
-    gInstance->mFormRepostDecisionSignal.Emit(std::move(decision));
+    std::shared_ptr<Dali::WebEngineFormRepostDecision> repostDecision(new MockWebEngineFormRepostDecision());
+    gInstance->mFormRepostDecisionSignal.Emit(std::move(repostDecision));
     gInstance->mFrameRenderedSignal.Emit();
     std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor(new MockWebEngineRequestInterceptor());
     gInstance->mRequestInterceptorSignal.Emit(std::move(interceptor));
+
+    std::shared_ptr<Dali::WebEngineLoadError> error(new MockWebEngineLoadError(gInstance->mUrl));
+    gInstance->mPageLoadErrorSignal.Emit(std::move(error));
+    std::shared_ptr<Dali::WebEngineConsoleMessage> message(new MockWebEngineConsoleMessage());
+    gInstance->mConsoleMessageSignal.Emit(std::move(message));
+    std::shared_ptr<Dali::WebEnginePolicyDecision> policyDecision(new MockWebEnginePolicyDecision());
+    gInstance->mPolicyDecisionSignal.Emit(std::move(policyDecision));
+
+    std::shared_ptr<Dali::WebEngineCertificate> certificate(new MockWebEngineCertificate());
+    gInstance->mCertificateConfirmSignal.Emit(std::move(certificate));
+    std::shared_ptr<Dali::WebEngineCertificate> sslCertificate(new MockWebEngineCertificate());
+    gInstance->mSslCertificateChangedSignal.Emit(std::move(sslCertificate));
+    std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler(new MockWebEngineHttpAuthHandler());
+    gInstance->mHttpAuthHandlerSignal.Emit(std::move(handler));
+
+    std::shared_ptr<Dali::WebEngineContextMenu> menu(new MockWebEngineContextMenu());
+    gInstance->mContextMenuCustomizedSignal.Emit(std::move(menu));
+    std::shared_ptr<Dali::WebEngineContextMenuItem> item(new MockWebEngineContextMenuItem());
+    gInstance->mContextMenuItemSelectedSignal.Emit(std::move(item));
   }
   return false;
 }
@@ -1016,6 +1643,17 @@ bool OnGeolocationPermission()
   return false;
 }
 
+bool OnHitTestCreated()
+{
+  DisconnectFromGlobalSignal(&OnHitTestCreated);
+  if (gInstance)
+  {
+    std::unique_ptr<Dali::WebEngineHitTest> test(new MockWebEngineHitTest());
+    gInstance->mHitTestCreatedCallback(std::move(test));
+  }
+  return false;
+}
+
 bool OnClearHistory()
 {
   DisconnectFromGlobalSignal( &OnClearHistory );
@@ -1030,6 +1668,65 @@ bool OnClearHistory()
   return false;
 }
 
+bool OnSecurityOriginAcquired()
+{
+  DisconnectFromGlobalSignal(&OnSecurityOriginAcquired);
+  if (gWebEngineContextInstance)
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> securityOriginList;
+    std::unique_ptr<Dali::WebEngineSecurityOrigin> origin(new MockWebEngineSecurityOrigin());
+    securityOriginList.push_back(std::move(origin));
+    gWebEngineContextInstance->mSecurityOriginAcquiredCallback(securityOriginList);
+  }
+  return false;
+}
+
+bool OnStorageUsageAcquired()
+{
+  DisconnectFromGlobalSignal(&OnStorageUsageAcquired);
+  if (gWebEngineContextInstance)
+  {
+    gWebEngineContextInstance->mStorageUsageAcquiredCallback(0);
+  }
+  return false;
+}
+
+bool OnFormPasswordAcquired()
+{
+  DisconnectFromGlobalSignal(&OnFormPasswordAcquired);
+  if (gWebEngineContextInstance)
+  {
+    std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> formPasswordList;
+    std::unique_ptr<Dali::WebEngineContext::PasswordData> data(new Dali::WebEngineContext::PasswordData());
+    data->url = "http://test.html";
+    data->useFingerprint = false;
+    formPasswordList.push_back(std::move(data));
+    gWebEngineContextInstance->mFormPasswordAcquiredCallback(formPasswordList);
+  }
+  return false;
+}
+
+bool OnDownloadStarted()
+{
+  DisconnectFromGlobalSignal(&OnDownloadStarted);
+  if (gWebEngineContextInstance)
+  {
+    gWebEngineContextInstance->mDownloadStartedCallback("http://test.html");
+  }
+  return false;
+}
+
+bool OnMimeOverridden()
+{
+  DisconnectFromGlobalSignal(&OnMimeOverridden);
+  if (gWebEngineContextInstance)
+  {
+    std::string newMime;
+    gWebEngineContextInstance->mMimeOverriddenCallback("http://test.html", "txt/xml", newMime);
+  }
+  return false;
+}
+
 } // namespace
 
 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
@@ -1087,11 +1784,11 @@ WebEngine WebEngine::DownCast( BaseHandle handle )
   return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) );
 }
 
-void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
+void WebEngine::Create( uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId )
 {
 }
 
-void WebEngine::Create( int width, int height, int argc, char** argv )
+void WebEngine::Create( uint32_t width, uint32_t height, uint32_t argc, char** argv )
 {
 }
 
@@ -1265,6 +1962,16 @@ void WebEngine::JavaScriptPromptReply( const std::string& result )
 {
 }
 
+std::unique_ptr<Dali::WebEngineHitTest> WebEngine::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
+{
+  return Internal::Adaptor::GetImplementation(*this).CreateHitTest(x, y, mode);
+}
+
+bool WebEngine::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
+{
+  return Internal::Adaptor::GetImplementation(*this).CreateHitTestAsynchronously(x, y, mode, callback);
+}
+
 void WebEngine::ClearAllTilesResources()
 {
 }
@@ -1297,12 +2004,12 @@ void WebEngine::AddDynamicCertificatePath(const std::string& host, const std::st
 {
 }
 
-Dali::PixelData WebEngine::GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor)
+Dali::PixelData WebEngine::GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
 {
   return Internal::Adaptor::GetImplementation( *this ).GetScreenshot(viewArea, scaleFactor);
 }
 
-bool WebEngine::GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
+bool WebEngine::GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
 {
   return Internal::Adaptor::GetImplementation( *this ).GetScreenshotAsynchronously(viewArea, scaleFactor, callback);
 }
@@ -1327,17 +2034,17 @@ void WebEngine::SetUserAgent( const std::string& userAgent )
   Internal::Adaptor::GetImplementation( *this ).SetUserAgent( userAgent );
 }
 
-void WebEngine::ScrollBy( int dx, int dy )
+void WebEngine::ScrollBy( int32_t dx, int32_t dy )
 {
   Internal::Adaptor::GetImplementation( *this ).ScrollBy( dx, dy );
 }
 
-bool WebEngine::ScrollEdgeBy( int dx, int dy )
+bool WebEngine::ScrollEdgeBy( int32_t dx, int32_t dy )
 {
   return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeBy( dx, dy );
 }
 
-void WebEngine::SetScrollPosition( int x, int y )
+void WebEngine::SetScrollPosition( int32_t x, int32_t y )
 {
   Internal::Adaptor::GetImplementation( *this ).SetScrollPosition( x, y );
 }
@@ -1357,7 +2064,7 @@ Dali::Vector2 WebEngine::GetContentSize() const
   return Internal::Adaptor::GetImplementation( *this ).GetContentSize();
 }
 
-void WebEngine::SetSize( int width, int height )
+void WebEngine::SetSize( uint32_t width, uint32_t height )
 {
 }
 
@@ -1431,7 +2138,7 @@ float WebEngine::GetLoadProgressPercentage() const
   return Internal::Adaptor::GetImplementation( *this ).GetLoadProgressPercentage();
 }
 
-void WebEngine::UpdateDisplayArea( Dali::Rect< int > displayArea )
+void WebEngine::UpdateDisplayArea( Dali::Rect< int32_t > displayArea )
 {
 }
 
@@ -1479,7 +2186,7 @@ Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSigna
 
 Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
 {
-  return Internal::Adaptor::GetImplementation( *this ).FormRepostDecisionSignal();
+  return Internal::Adaptor::GetImplementation(*this).FormRepostDecisionSignal();
 }
 
 Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
@@ -1492,5 +2199,40 @@ Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType& WebEngine::Request
   return Internal::Adaptor::GetImplementation(*this).RequestInterceptorSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& WebEngine::ConsoleMessageSignal()
+{
+  return Internal::Adaptor::GetImplementation(*this).ConsoleMessageSignal();
+}
+
+Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& WebEngine::PolicyDecisionSignal()
+{
+  return Internal::Adaptor::GetImplementation(*this).PolicyDecisionSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal()
+{
+  return Internal::Adaptor::GetImplementation(*this).CertificateConfirmSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal()
+{
+  return Internal::Adaptor::GetImplementation(*this).SslCertificateChangedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal()
+{
+  return Internal::Adaptor::GetImplementation(*this).HttpAuthHandlerSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).ContextMenuCustomizedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).ContextMenuItemSelectedSignal();
+}
+
 } // namespace Dali;
 
index c77b4ac..6d74b7c 100644 (file)
@@ -90,9 +90,9 @@ int UtcDaliAnimatedImageVisualGetPropertyMap01(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == TEST_GIF_FILE_NAME );
 
-  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
+  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get<float>(), 22.2f, TEST_LOCATION );
+  DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(22.2f, 22.2f, 22.2f, 22.2f), TEST_LOCATION );
 
   value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, Property::INTEGER );
   DALI_TEST_CHECK( value );
@@ -136,7 +136,7 @@ int UtcDaliAnimatedImageVisualGetPropertyMap02(void)
     .Add( "pixelArea", Vector4() )
     .Add( "wrapModeU", WrapMode::REPEAT )
     .Add( "wrapModeV", WrapMode::DEFAULT )
-    .Add( "cornerRadius", 50.0f )
+    .Add( "cornerRadius", Vector4(50.0f, 25.0f, 12.5f, 33.0f) )
     .Add( "cornerRadiusPolicy", Visual::Transform::Policy::RELATIVE ));
 
   Property::Map resultMap;
@@ -174,7 +174,7 @@ int UtcDaliAnimatedImageVisualGetPropertyMap02(void)
 
   value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius" );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get<float>(), 50.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(50.0f, 25.0f, 12.5f, 33.0f), TEST_LOCATION );
 
   value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
   DALI_TEST_CHECK( value );
@@ -242,7 +242,7 @@ int UtcDaliAnimatedImageVisualGetPropertyMap03(void)
 
   value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius" );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get<float>(), 50.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(50.5f, 50.5f, 50.5f, 50.5f), TEST_LOCATION );
 
   value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
   DALI_TEST_CHECK( value );
index b692ebb..dfd0b72 100644 (file)
@@ -172,7 +172,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
   tet_infoline( "UtcDaliVisualFactoryGetAnimatedVectorImageVisual04: Request animated vector image visual with a Property::Map" );
 
   int startFrame = 1, endFrame = 3;
-  float cornerRadius = 50.0f;
+  float cornerRadius = 22.0f;
   Property::Array playRange;
   playRange.PushBack( startFrame );
   playRange.PushBack( endFrame );
@@ -241,9 +241,9 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< bool >() == false );
 
-  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
+  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get< float >(), cornerRadius, TEST_LOCATION );
+  DALI_TEST_EQUALS( value->Get< Vector4 >(), Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius), TEST_LOCATION );
 
   value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
   DALI_TEST_CHECK( value );
@@ -261,7 +261,7 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   tet_infoline( "UtcDaliAnimatedVectorImageVisualGetPropertyMap01" );
 
   int startFrame = 1, endFrame = 3;
-  float cornerRadius = 50.0f;
+  Vector4 cornerRadius(50.0f, 22.0f, 0.0f, 3.0f);
   Property::Array playRange;
   playRange.PushBack( startFrame );
   playRange.PushBack( endFrame );
@@ -332,9 +332,9 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< bool >() == true );    // Check default value
 
-  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
+  value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get< float >(), cornerRadius, TEST_LOCATION );
+  DALI_TEST_EQUALS( value->Get< Vector4 >(), cornerRadius, TEST_LOCATION );
 
   value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
   DALI_TEST_CHECK( value );
index af5a453..12d8805 100644 (file)
@@ -130,6 +130,8 @@ const char* HANDLE_RIGHT_SELECTION_FILE_NAME = TEST_RESOURCE_DIR "/selection_han
 
 const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
 
+static bool gAnchorClickedCallBackCalled;
+static bool gAnchorClickedCallBackNotCalled;
 static bool gTextChangedCallBackCalled;
 static bool gInputStyleChangedCallbackCalled;
 static bool gMaxCharactersCallBackCalled;
@@ -149,6 +151,18 @@ struct CallbackFunctor
   bool* mCallbackFlag;
 };
 
+static void TestAnchorClickedCallback(TextEditor control, const char* href, unsigned int hrefLength)
+{
+  tet_infoline(" TestAnchorClickedCallback");
+
+  gAnchorClickedCallBackNotCalled = false;
+
+  if (!strcmp(href, "https://www.tizen.org") && hrefLength == strlen(href))
+  {
+    gAnchorClickedCallBackCalled = true;
+  }
+}
+
 static void TestTextChangedCallback( TextEditor control )
 {
   tet_infoline(" TestTextChangedCallback");
@@ -952,6 +966,52 @@ int utcDaliTextEditorAtlasRenderP(void)
   END_TEST;
 }
 
+// Positive test for the anchorClicked signal.
+int utcDaliTextEditorAnchorClickedP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorAnchorClickedP");
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK(editor);
+
+  application.GetScene().Add(editor);
+
+  // connect to the anchor clicked signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextEditor::AnchorClickedSignal(editor).Connect(&TestAnchorClickedCallback);
+  bool anchorClickedSignal = false;
+  editor.ConnectSignal(testTracker, "anchorClicked", CallbackFunctor(&anchorClickedSignal));
+
+  gAnchorClickedCallBackCalled = false;
+  editor.SetProperty(TextEditor::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  editor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true);
+  editor.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  application.SendNotification();
+  application.Render();
+  editor.SetKeyInputFocus();
+
+  // Create a tap event to touch the text editor.
+  TestGenerateTap(application, 5.0f, 5.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+  DALI_TEST_CHECK(anchorClickedSignal);
+
+  gAnchorClickedCallBackNotCalled = true;
+  // Tap the outside of anchor, callback should not be called.
+  TestGenerateTap(application, 150.f, 100.f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackNotCalled);
+
+  END_TEST;
+}
+
 // Positive test for the textChanged signal.
 int utcDaliTextEditorTextChangedP(void)
 {
@@ -3293,3 +3353,36 @@ int UtcDaliTextEditorPrimaryCursorPosition(void)
 
   END_TEST;
 }
+
+int UtcDaliTextEditorLineCountAfterGetNaturalSize(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliTextEditorLineCountAfterGetNaturalSize ");
+
+  TextEditor textEditor = TextEditor::New();
+  textEditor.SetProperty(TextEditor::Property::TEXT, "A\nB\nC\nD\nE\nF\n");
+  textEditor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  textEditor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  textEditor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  application.GetScene().Add( textEditor );
+
+  application.SendNotification();
+  application.Render();
+
+  int lineCount = 0;
+  lineCount =  textEditor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
+  DALI_TEST_EQUALS( lineCount, 7, TEST_LOCATION );
+
+  textEditor.GetNaturalSize();
+
+  // Create a tap event to touch the text editor.
+  TestGenerateTap( application, 18.0f, 25.0f );
+
+  application.SendNotification();
+  application.Render();
+
+  lineCount =  textEditor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
+  DALI_TEST_EQUALS( lineCount, 7, TEST_LOCATION );
+
+  END_TEST;
+}
index 848326a..05eaeb1 100644 (file)
@@ -121,6 +121,8 @@ const int KEY_D_CODE = 40;
 
 const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
 
+static bool gAnchorClickedCallBackCalled;
+static bool gAnchorClickedCallBackNotCalled;
 static bool gTextChangedCallBackCalled;
 static bool gMaxCharactersCallBackCalled;
 static bool gInputStyleChangedCallbackCalled;
@@ -206,6 +208,18 @@ struct CallbackFunctor
   bool* mCallbackFlag;
 };
 
+static void TestAnchorClickedCallback(TextField control, const char* href, unsigned int hrefLength)
+{
+  tet_infoline(" TestAnchorClickedCallback");
+
+  gAnchorClickedCallBackNotCalled = false;
+
+  if (!strcmp(href, "https://www.tizen.org") && hrefLength == strlen(href))
+  {
+    gAnchorClickedCallBackCalled = true;
+  }
+}
+
 static void TestTextChangedCallback( TextField control )
 {
   tet_infoline(" TestTextChangedCallback");
@@ -1022,6 +1036,303 @@ int utcDaliTextFieldAtlasRenderP(void)
   END_TEST;
 }
 
+// Positive test for the anchorClicked signal.
+int utcDaliTextFieldAnchorClicked01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldAnchorClicked01");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK(field);
+
+  application.GetScene().Add(field);
+
+  // connect to the anchor clicked signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextField::AnchorClickedSignal(field).Connect(&TestAnchorClickedCallback);
+  bool anchorClickedSignal = false;
+  field.ConnectSignal(testTracker, "anchorClicked", CallbackFunctor(&anchorClickedSignal));
+
+  gAnchorClickedCallBackCalled = false;
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(TextField::Property::ENABLE_MARKUP, true);
+  field.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  field.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  field.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  application.SendNotification();
+  application.Render();
+  field.SetKeyInputFocus();
+
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 5.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+  DALI_TEST_CHECK(anchorClickedSignal);
+
+  gAnchorClickedCallBackNotCalled = true;
+  // Tap the outside of anchor, callback should not be called.
+  TestGenerateTap(application, 150.f, 100.f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackNotCalled);
+
+  END_TEST;
+}
+
+// Positive test for the anchorClicked signal.
+int utcDaliTextFieldAnchorClicked02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldAnchorClicked02");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK(field);
+
+  application.GetScene().Add(field);
+
+  // connect to the anchor clicked signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextField::AnchorClickedSignal(field).Connect(&TestAnchorClickedCallback);
+  bool anchorClickedSignal = false;
+  field.ConnectSignal(testTracker, "anchorClicked", CallbackFunctor(&anchorClickedSignal));
+
+  gAnchorClickedCallBackCalled = false;
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(TextField::Property::ENABLE_MARKUP, true);
+  field.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  field.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  field.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  application.SendNotification();
+  application.Render();
+  field.SetKeyInputFocus();
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+  DALI_TEST_CHECK(anchorClickedSignal);
+
+
+  // For coverage InsertTextAnchor, RemoveTextAnchor
+  // first index insert
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 0);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  field.SetKeyInputFocus();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // last index insert
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 5);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  field.SetKeyInputFocus();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // mid index insert
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 2);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  field.SetKeyInputFocus();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // first index remove
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 0);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.ProcessEvent(GenerateKey("Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  field.SetKeyInputFocus();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // last index remove
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 5);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.ProcessEvent(GenerateKey("Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // middle index
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 2);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.ProcessEvent(GenerateKey("Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // 0 ~ 1 index remove
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_START, 0);
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_END, 1);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // 1 ~ 3 index remove
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_START, 1);
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_END, 3);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // 3 ~ 4 index remove
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_START, 3);
+  field.SetProperty( DevelTextField::Property::SELECTED_TEXT_END, 4);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  gAnchorClickedCallBackCalled = false;
+  // Create a tap event to touch the text field.
+  TestGenerateTap(application, 30.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+
+  // Remove front of anchor
+  field.SetProperty(TextField::Property::TEXT, "TIZEN<a href='https://www.tizen.org'>TIZEN</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 3);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  // Remove whole text
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  DevelTextField::SelectWholeText(field);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  // Remove all with backspace
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>T</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 1);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  // Remove all with delete
+  field.SetProperty(TextField::Property::TEXT, "<a href='https://www.tizen.org'>T</a>");
+  field.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 0);
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent(GenerateKey("Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
 // Positive test for the textChanged signal.
 int utcDaliTextFieldTextChangedP(void)
 {
index 57862f4..ecefef7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -77,6 +77,35 @@ const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
 const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
 
+static bool gAnchorClickedCallBackCalled;
+static bool gAnchorClickedCallBackNotCalled;
+
+struct CallbackFunctor
+{
+  CallbackFunctor(bool* callbackFlag)
+  : mCallbackFlag( callbackFlag )
+  {
+  }
+
+  void operator()()
+  {
+    *mCallbackFlag = true;
+  }
+  bool* mCallbackFlag;
+};
+
+static void TestAnchorClickedCallback(TextLabel control, const char* href, unsigned int hrefLength)
+{
+  tet_infoline(" TestAnchorClickedCallback");
+
+  gAnchorClickedCallBackNotCalled = false;
+
+  if (!strcmp(href, "https://www.tizen.org") && hrefLength == strlen(href))
+  {
+    gAnchorClickedCallBackCalled = true;
+  }
+}
+
 bool DaliTestCheckMaps( const Property::Map& mapGet, const Property::Map& mapSet, const std::vector<std::string>& indexConversionTable = std::vector<std::string>() )
 {
   const Property::Map::SizeType size = mapGet.Count();
@@ -1727,3 +1756,49 @@ int UtcDaliToolkitTextlabelFontSizeScale(void)
 
   END_TEST;
 }
+
+// Positive test for the anchorClicked signal.
+int UtcDaliToolkitTextlabelAnchorClicked(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelAnchorClicked");
+  TextLabel label = TextLabel::New();
+  DALI_TEST_CHECK(label);
+
+  application.GetScene().Add(label);
+
+  // connect to the anchor clicked signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextLabel::AnchorClickedSignal(label).Connect(&TestAnchorClickedCallback);
+  bool anchorClickedSignal = false;
+  label.ConnectSignal(testTracker, "anchorClicked", CallbackFunctor(&anchorClickedSignal));
+
+  gAnchorClickedCallBackCalled = false;
+  label.SetProperty(TextLabel::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
+  label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
+  label.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  application.SendNotification();
+  application.Render();
+
+  // Create a tap event to touch the text label.
+  TestGenerateTap(application, 5.0f, 25.0f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
+  DALI_TEST_CHECK(anchorClickedSignal);
+
+
+  gAnchorClickedCallBackNotCalled = true;
+  // Tap the outside of anchor, callback should not be called.
+  TestGenerateTap(application, 150.f, 100.f);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gAnchorClickedCallBackNotCalled);
+
+  END_TEST;
+}
index a9a2ed2..127a611 100644 (file)
@@ -516,9 +516,9 @@ int UtcDaliVisualGetPropertyMap1(void)
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::BLUE );
 
-  Property::Value* cornerRadiusValue = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
+  Property::Value* cornerRadiusValue = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
   DALI_TEST_CHECK( cornerRadiusValue );
-  DALI_TEST_CHECK( cornerRadiusValue->Get< float >() == 10.0f );
+  DALI_TEST_CHECK( cornerRadiusValue->Get< Vector4 >() == Vector4(10.0f, 10.0f, 10.0f, 10.0f) );
 
   Property::Value* cornerRadiusPolicyValue = resultMap.Find( DevelVisual::Property::CORNER_RADIUS_POLICY, Property::INTEGER );
   DALI_TEST_CHECK( cornerRadiusPolicyValue );
@@ -3665,7 +3665,7 @@ int UtcDaliVisualRoundedCorner(void)
 
   static std::vector<UniformData> customUniforms =
   {
-    UniformData("cornerRadius", Property::Type::FLOAT),
+    UniformData("cornerRadius", Property::Type::VECTOR4),
     UniformData("cornerRadiusPolicy", Property::Type::FLOAT),
   };
 
@@ -3701,7 +3701,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius) ), true, TEST_LOCATION );
     // Default corner radius policy is absolute.
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
@@ -3734,7 +3734,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius) ), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
 
@@ -3742,7 +3742,7 @@ int UtcDaliVisualRoundedCorner(void)
   {
     VisualFactory factory = VisualFactory::Get();
     Property::Map properties;
-    float cornerRadius = 0.5f;
+    Vector4 cornerRadius(0.5f, 0.5f, 0.5f, 0.3f);
 
     properties[Visual::Property::TYPE] = Visual::COLOR;
     properties[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
@@ -3766,7 +3766,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::RELATIVE ), true, TEST_LOCATION );
   }
 
@@ -3774,7 +3774,7 @@ int UtcDaliVisualRoundedCorner(void)
   {
     VisualFactory factory = VisualFactory::Get();
     Property::Map properties;
-    float cornerRadius = 30.0f;
+    Vector4 cornerRadius(30.0f, 30.0f, 30.0f, 20.0f);
 
     properties[Visual::Property::TYPE] = Visual::COLOR;
     properties[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
@@ -3798,7 +3798,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
     // Default corner radius policy is absolute.
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
@@ -3845,7 +3845,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius) ), true, TEST_LOCATION );
     // Default corner radius policy is absolute.
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
@@ -3854,11 +3854,11 @@ int UtcDaliVisualRoundedCorner(void)
   {
     VisualFactory factory = VisualFactory::Get();
     Property::Map properties;
-    float cornerRadius = 24.0f;
+    Vector4 cornerRadius(24.0f, 23.0f, 22.0f, 21.0f);
 
     properties[Visual::Property::TYPE] = Visual::ANIMATED_IMAGE;
     properties[ImageVisual::Property::URL] = TEST_GIF_FILE_NAME;
-    properties[DevelVisual::Property::CORNER_RADIUS] = cornerRadius + 10.0f; // Dummy Input
+    properties[DevelVisual::Property::CORNER_RADIUS] = cornerRadius.x + 10.0f; // Dummy Input
     properties[DevelVisual::Property::CORNER_RADIUS] = cornerRadius;
     properties["cornerRadiusPolicy"] = Toolkit::Visual::Transform::Policy::ABSOLUTE;
 
@@ -3881,7 +3881,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
 
@@ -3889,7 +3889,7 @@ int UtcDaliVisualRoundedCorner(void)
   {
     VisualFactory factory = VisualFactory::Get();
     Property::Map properties;
-    float cornerRadius = 27.0f;
+    Vector4 cornerRadius(27.0f, 72.0f, 11.0f, 500.5f);
 
     properties[Visual::Property::TYPE] = Visual::SVG;
     properties[ImageVisual::Property::URL] = TEST_SVG_FILE_NAME;
@@ -3914,7 +3914,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
     // Default corner radius policy is absolute.
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::ABSOLUTE ), true, TEST_LOCATION );
   }
@@ -3927,6 +3927,7 @@ int UtcDaliVisualRoundedCorner(void)
 
     properties[Visual::Property::TYPE] = DevelVisual::ANIMATED_VECTOR_IMAGE;
     properties[ImageVisual::Property::URL] = TEST_VECTOR_IMAGE_FILE_NAME;
+    properties["cornerRadius"] = Vector4(1.0f, 100.0f, 10.0f, 0.1f); // Dummy Input
     properties["cornerRadius"] = cornerRadius;
     properties[DevelVisual::Property::CORNER_RADIUS_POLICY] = Toolkit::Visual::Transform::Policy::RELATIVE;
 
@@ -3949,7 +3950,7 @@ int UtcDaliVisualRoundedCorner(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadius", cornerRadius ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< Vector4 >( "cornerRadius", Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius) ), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "cornerRadiusPolicy", Toolkit::Visual::Transform::Policy::RELATIVE ), true, TEST_LOCATION );
   }
 #else
@@ -4148,7 +4149,7 @@ int UtcDaliVisualGetVisualProperty01(void)
     UniformData("mixColor", Property::Type::VECTOR3),
     UniformData("offset", Property::Type::VECTOR2),
     UniformData("size", Property::Type::VECTOR2),
-    UniformData("cornerRadius", Property::Type::FLOAT),
+    UniformData("cornerRadius", Property::Type::VECTOR4),
     UniformData("blurRadius", Property::Type::FLOAT),
   };
 
@@ -4159,7 +4160,7 @@ int UtcDaliVisualGetVisualProperty01(void)
   Property::Map propertyMap;
   propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
   propertyMap.Insert(Visual::Property::MIX_COLOR, Color::BLUE);
-  propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS, 10.0f);
+  propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS, Vector4(10.0f, 0.0f, 2.0f, 4.0f));
   propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS_POLICY, Toolkit::Visual::Transform::Policy::RELATIVE);
   propertyMap.Insert(DevelColorVisual::Property::BLUR_RADIUS, 20.0f);
   Visual::Base colorVisual = factory.CreateVisual(propertyMap);
@@ -4177,7 +4178,7 @@ int UtcDaliVisualGetVisualProperty01(void)
   Vector2 targetOffset(0.05f, 0.05f);
   Vector2 targetSize(1.1f, 1.1f);
   float targetOpacity = 0.5f;
-  float targetCornerRadius = 20.0f;
+  Vector4 targetCornerRadius(0.0f, 0.0f, 0.0f, 0.0f);
   float targetBlurRadius = 10.0f;
 
   Animation animation = Animation::New(1.0f);
@@ -4213,9 +4214,9 @@ int UtcDaliVisualGetVisualProperty01(void)
   DALI_TEST_CHECK(sizeValue);
   DALI_TEST_EQUALS(sizeValue->Get<Vector2>(), targetSize, TEST_LOCATION);
 
-  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::FLOAT);
+  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
   DALI_TEST_CHECK(cornerRadiusValue);
-  DALI_TEST_EQUALS(cornerRadiusValue->Get< float >(), targetCornerRadius, TEST_LOCATION);
+  DALI_TEST_EQUALS(cornerRadiusValue->Get< Vector4 >(), targetCornerRadius, TEST_LOCATION);
 
   Property::Value* blurRadiusValue = resultMap.Find(DevelColorVisual::Property::BLUR_RADIUS, Property::FLOAT);
   DALI_TEST_CHECK(blurRadiusValue);
@@ -4225,7 +4226,7 @@ int UtcDaliVisualGetVisualProperty01(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", targetColor), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("offset", targetOffset), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("size", targetSize), true, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("blurRadius", targetBlurRadius), true, TEST_LOCATION);
 
   // Test not-supported property
@@ -4248,7 +4249,6 @@ int UtcDaliVisualGetVisualProperty01(void)
 
 int UtcDaliVisualGetVisualProperty02(void)
 {
-#ifdef OLD_GRAPHICS_TEST
   ToolkitTestApplication application;
   tet_infoline( "UtcDaliVisualGetVisualProperty02: Test animatable property" );
 
@@ -4257,7 +4257,7 @@ int UtcDaliVisualGetVisualProperty02(void)
     UniformData("mixColor", Property::Type::VECTOR3),
     UniformData("offset", Property::Type::VECTOR2),
     UniformData("size", Property::Type::VECTOR2),
-    UniformData("cornerRadius", Property::Type::FLOAT),
+    UniformData("cornerRadius", Property::Type::VECTOR4),
     UniformData("blurRadius", Property::Type::FLOAT),
   };
 
@@ -4282,7 +4282,7 @@ int UtcDaliVisualGetVisualProperty02(void)
   Vector2 targetOffset(0.05f, 0.05f);
   Vector2 targetSize(1.1f, 1.1f);
   float targetOpacity = 0.5f;
-  float targetCornerRadius = 20.0f;
+  Vector4 targetCornerRadius(20.0f, 0.0f, 20.0f, 0.0f);
   float targetBlurRadius = 10.0f;
 
   // Should work when the properties are not set before
@@ -4319,22 +4319,21 @@ int UtcDaliVisualGetVisualProperty02(void)
   DALI_TEST_CHECK(sizeValue);
   DALI_TEST_EQUALS(sizeValue->Get<Vector2>(), targetSize, TEST_LOCATION);
 
-  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::FLOAT);
+  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
   DALI_TEST_CHECK(cornerRadiusValue);
-  DALI_TEST_EQUALS(cornerRadiusValue->Get< float >(), targetCornerRadius, TEST_LOCATION);
+  DALI_TEST_EQUALS(cornerRadiusValue->Get< Vector4 >(), targetCornerRadius, TEST_LOCATION);
 
   Property::Value* blurRadiusValue = resultMap.Find(DevelColorVisual::Property::BLUR_RADIUS, Property::FLOAT);
   DALI_TEST_CHECK(blurRadiusValue);
   DALI_TEST_EQUALS(blurRadiusValue->Get< float >(), targetBlurRadius, TEST_LOCATION);
 
+#ifdef OLD_GRAPHICS_TEST
   // Test uniform values
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", targetColor), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("offset", targetOffset), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("size", targetSize), true, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("blurRadius", targetBlurRadius), true, TEST_LOCATION);
-#else
-  tet_result(TET_PASS);
 #endif
 
   END_TEST;
@@ -4348,7 +4347,7 @@ int UtcDaliVisualGetVisualProperty03(void)
 
   static std::vector<UniformData> customUniforms =
   {
-    UniformData("cornerRadius", Property::Type::FLOAT),
+    UniformData("cornerRadius", Property::Type::VECTOR4),
   };
 
   TestGraphicsController& graphics = application.GetGraphicsController();
@@ -4373,7 +4372,7 @@ int UtcDaliVisualGetVisualProperty03(void)
   application.Render();
 
   float targetOpacity = 0.5f;
-  float targetCornerRadius = 20.0f;
+  Vector4 targetCornerRadius(20.0f, 20.0f, 0.0f, 0.0f);
 
   Animation animation = Animation::New(1.0f);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Property::OPACITY), targetOpacity);
@@ -4392,12 +4391,12 @@ int UtcDaliVisualGetVisualProperty03(void)
   DALI_TEST_CHECK(colorValue);
   DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Vector4(1.0f, 1.0f, 1.0f, targetOpacity), TEST_LOCATION);
 
-  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::FLOAT);
+  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
   DALI_TEST_CHECK(cornerRadiusValue);
-  DALI_TEST_EQUALS(cornerRadiusValue->Get< float >(), targetCornerRadius, TEST_LOCATION);
+  DALI_TEST_EQUALS(cornerRadiusValue->Get< Vector4 >(), targetCornerRadius, TEST_LOCATION);
 
   // Test uniform value
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
 #else
   tet_result(TET_PASS);
 #endif
@@ -4413,7 +4412,7 @@ int UtcDaliVisualGetVisualProperty04(void)
 
   static std::vector<UniformData> customUniforms =
   {
-    UniformData("cornerRadius", Property::Type::FLOAT),
+    UniformData("cornerRadius", Property::Type::VECTOR4),
   };
 
   TestGraphicsController& graphics = application.GetGraphicsController();
@@ -4445,7 +4444,7 @@ int UtcDaliVisualGetVisualProperty04(void)
   application.Render();
 
   float targetOpacity = 0.5f;
-  float targetCornerRadius = 20.0f;
+  Vector4 targetCornerRadius(20.0f, 30.0f, 10.0f, 20.0f);
 
   Animation animation = Animation::New(1.0f);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Property::OPACITY), targetOpacity);
@@ -4464,12 +4463,12 @@ int UtcDaliVisualGetVisualProperty04(void)
   DALI_TEST_CHECK(colorValue);
   DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Vector4(1.0f, 1.0f, 1.0f, targetOpacity), TEST_LOCATION);
 
-  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::FLOAT);
+  Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
   DALI_TEST_CHECK(cornerRadiusValue);
-  DALI_TEST_EQUALS(cornerRadiusValue->Get< float >(), targetCornerRadius, TEST_LOCATION);
+  DALI_TEST_EQUALS(cornerRadiusValue->Get< Vector4 >(), targetCornerRadius, TEST_LOCATION);
 
   // Test uniform value
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<float>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
 #else
   tet_result(TET_PASS);
 #endif
index a97eb79..39ebd29 100755 (executable)
 #include "dali-toolkit-test-utils/toolkit-timer.h"
 
 #include <dali.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-frame.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/devel-api/adaptor-framework/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.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/controls/web-view/web-view.h>
 
@@ -50,6 +60,8 @@ const char* const TEST_URL2( "http://www.somewhere.valid2.com" );
 static int gPageLoadStartedCallbackCalled = 0;
 static int gPageLoadInProgressCallbackCalled = 0;
 static int gPageLoadFinishedCallbackCalled = 0;
+static int gPageLoadErrorCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineLoadError> gPageLoadErrorInstance = nullptr;
 static int gScrollEdgeReachedCallbackCalled = 0;
 static int gUrlChangedCallbackCalled = 0;
 static int gEvaluateJavaScriptCallbackCalled = 0;
@@ -63,10 +75,32 @@ static bool gTouched = false;
 static bool gHovered = false;
 static bool gWheelEventHandled = false;
 static int gFormRepostDecisionCallbackCalled = 0;
-static std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> gFormRepostDecisionInstance;
+static std::shared_ptr<Dali::WebEngineFormRepostDecision> gFormRepostDecisionInstance = nullptr;
 static int gFrameRenderedCallbackCalled = 0;
 static int gRequestInterceptorCallbackCalled = 0;
 static std::shared_ptr<Dali::WebEngineRequestInterceptor> gRequestInterceptorInstance = nullptr;
+static int gConsoleMessageCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineConsoleMessage> gConsoleMessageInstance = nullptr;
+static int gPolicyDecisionCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEnginePolicyDecision> gPolicyDecisionInstance = nullptr;
+static int gCertificateConfirmCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gCertificateConfirmInstance = nullptr;
+static int gSslCertificateChangedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
+static int gHttpAuthHandlerCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
+static int gSecurityOriginsAcquiredCallbackCalled = 0;
+static int gStorageUsageAcquiredCallbackCalled = 0;
+static int gFormPasswordsAcquiredCallbackCalled = 0;
+static int gDownloadStartedCallbackCalled = 0;
+static int gMimeOverriddenCallbackCalled = 0;
+static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
+static std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> gPasswordDataList;
+static int gContextMenuCustomizedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenu> gContextMenuInstance = nullptr;
+static int gContextMenuItemSelectedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenuItem> gContextMenuItemInstance = nullptr;
+static int gHitTestCreatedCallbackCalled = 0;
 
 struct CallbackFunctor
 {
@@ -102,13 +136,27 @@ static void OnScrollEdgeReached( WebView view, Dali::WebEnginePlugin::ScrollEdge
   gScrollEdgeReachedCallbackCalled++;
 }
 
+static void OnPolicyDecisionRequest(WebView view, std::shared_ptr<Dali::WebEnginePolicyDecision> decision)
+{
+  gPolicyDecisionCallbackCalled++;
+  gPolicyDecisionInstance = std::move(decision);
+}
+
 static void OnUrlChanged( WebView view, const std::string& url )
 {
   gUrlChangedCallbackCalled++;
 }
 
-static void OnPageLoadError( WebView view, const std::string& url, WebView::LoadErrorCode errorCode )
+static bool OnHitTestCreated(std::unique_ptr<Dali::WebEngineHitTest> test)
+{
+  gHitTestCreatedCallbackCalled++;
+  return true;
+}
+
+static void OnPageLoadError(WebView view, std::shared_ptr<Dali::WebEngineLoadError> error)
 {
+  gPageLoadErrorCallbackCalled++;
+  gPageLoadErrorInstance = std::move(error);
 }
 
 static void OnEvaluateJavaScript( const std::string& result )
@@ -136,7 +184,7 @@ static bool OnJavaScriptPrompt( const std::string& meesage1, const std::string&
 
 static void OnScreenshotCaptured(Dali::Toolkit::ImageView)
 {
-  gScreenshotCapturedCallbackCalled++;\r
+  gScreenshotCapturedCallbackCalled++;
 }
 
 static void OnVideoPlaying(bool isPlaying)
@@ -168,10 +216,10 @@ static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheel )
   return true;
 }
 
-static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> decision)
+static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::WebEngineFormRepostDecision> decision)
 {
   gFormRepostDecisionCallbackCalled++;
-  gFormRepostDecisionInstance = decision;
+  gFormRepostDecisionInstance = std::move(decision);
 }
 
 static void OnFrameRendered(WebView)
@@ -185,6 +233,72 @@ static void OnRequestInterceptor(WebView view, std::shared_ptr<Dali::WebEngineRe
   gRequestInterceptorInstance = std::move(interceptor);
 }
 
+static void OnConsoleMessage(WebView view, std::shared_ptr<Dali::WebEngineConsoleMessage> message)
+{
+  gConsoleMessageCallbackCalled++;
+  gConsoleMessageInstance = std::move(message);
+}
+
+static void OnCertificateConfirm(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+  gCertificateConfirmCallbackCalled++;
+  gCertificateConfirmInstance = std::move(certificate);
+}
+
+static void OnSslCertificateChanged(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+  gSslCertificateChangedCallbackCalled++;
+  gSslCertificateInstance = std::move(certificate);
+}
+
+static void OnHttpAuthHandler( WebView view, std::shared_ptr<Dali::WebEngineHttpAuthHandler> hander )
+{
+  gHttpAuthHandlerCallbackCalled++;
+  gHttpAuthInstance = std::move(hander);
+}
+
+static void OnSecurityOriginsAcquired(std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>>& origins)
+{
+  gSecurityOriginsAcquiredCallbackCalled++;
+  gSecurityOriginList.clear();
+  gSecurityOriginList.swap(origins);
+}
+
+static void OnStorageUsageAcquired(uint64_t usage)
+{
+  gStorageUsageAcquiredCallbackCalled++;
+}
+
+static void OnFormPasswordsAcquired(std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>>& passwords)
+{
+  gFormPasswordsAcquiredCallbackCalled++;
+  gPasswordDataList.clear();
+  gPasswordDataList.swap(passwords);
+}
+
+static void OnDownloadStarted(const std::string& url)
+{
+  gDownloadStartedCallbackCalled++;
+}
+
+static bool OnMimeOverridden(const std::string&, const std::string&, std::string&)
+{
+  gMimeOverriddenCallbackCalled++;
+  return false;
+}
+
+static void OnContextMenuCustomized(WebView view, std::shared_ptr<Dali::WebEngineContextMenu> menu)
+{
+  gContextMenuCustomizedCallbackCalled++;
+  gContextMenuInstance = std::move(menu);
+}
+
+static void OnContextMenuItemSelected(WebView view, std::shared_ptr<Dali::WebEngineContextMenuItem> item)
+{
+  gContextMenuItemSelectedCallbackCalled++;
+  gContextMenuItemInstance = std::move(item);
+}
+
 } // namespace
 
 void web_view_startup(void)
@@ -215,7 +329,6 @@ int UtcDaliWebViewBasics(void)
   assign = copy;
   DALI_TEST_CHECK( assign == view );
 
-
   // DownCast Test
   tet_infoline( "UtcDaliWebViewBasic DownCast Test" );
   BaseHandle handle(view);
@@ -225,7 +338,6 @@ int UtcDaliWebViewBasics(void)
   DALI_TEST_CHECK( view2 );
   DALI_TEST_CHECK( view == view2 );
 
-
   // TypeRegistry Test
   tet_infoline( "UtcDaliWebViewBasic TypeRegistry Test" );
   TypeRegistry typeRegistry = TypeRegistry::Get();
@@ -261,7 +373,6 @@ int UtcDaliWebViewPageNavigation(void)
   view.PageLoadStartedSignal().Connect( &OnPageLoadStarted );
   view.PageLoadInProgressSignal().Connect( &OnPageLoadInProgress );
   view.PageLoadFinishedSignal().Connect( &OnPageLoadFinished );
-  view.PageLoadErrorSignal().Connect( &OnPageLoadError );
   view.UrlChangedSignal().Connect( &OnUrlChanged );
   bool signal1 = false;
   bool signal2 = false;
@@ -323,6 +434,60 @@ int UtcDaliWebViewPageNavigation(void)
   END_TEST;
 }
 
+int UtcDaliWebViewPageLoadErrorConsoleMessage(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+  view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+  application.GetScene().Add( view );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( view );
+
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.PageLoadErrorSignal().Connect( &OnPageLoadError );
+  view.ConsoleMessageSignal().Connect( &OnConsoleMessage );
+  bool signal1 = false;
+  bool signal2 = false;
+  view.ConnectSignal( testTracker, "pageLoadError", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "consoleMessage", CallbackFunctor(&signal2) );
+  DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 0, TEST_LOCATION );
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 & signal2);
+
+  // error code.
+  DALI_TEST_CHECK(gPageLoadErrorInstance);
+  DALI_TEST_EQUALS(gPageLoadErrorInstance->GetUrl(), TEST_URL1, TEST_LOCATION);
+  DALI_TEST_EQUALS(gPageLoadErrorInstance->GetCode(), Dali::WebEngineLoadError::ErrorCode::UNKNOWN, TEST_LOCATION);
+  std::string testErrorDescription("This is an error.");
+  DALI_TEST_EQUALS(gPageLoadErrorInstance->GetDescription(), testErrorDescription, TEST_LOCATION);
+  DALI_TEST_EQUALS(gPageLoadErrorInstance->GetType(), Dali::WebEngineLoadError::ErrorType::NONE, TEST_LOCATION);
+
+  // console message.
+  DALI_TEST_CHECK(gConsoleMessageInstance);
+  std::string testConsoleSource("source");
+  DALI_TEST_EQUALS(gConsoleMessageInstance->GetSource(), testConsoleSource, TEST_LOCATION);
+  DALI_TEST_EQUALS(gConsoleMessageInstance->GetLine(), 10, TEST_LOCATION);
+  DALI_TEST_EQUALS(gConsoleMessageInstance->GetSeverityLevel(), Dali::WebEngineConsoleMessage::SeverityLevel::EMPTY, TEST_LOCATION);
+  std::string testConsoleText("This is a text.");
+  DALI_TEST_EQUALS(gConsoleMessageInstance->GetText(), testConsoleText, TEST_LOCATION);
+
+  // reset
+  gPageLoadErrorInstance = nullptr;
+  gConsoleMessageInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewTouchAndKeys(void)
 {
   ToolkitTestApplication application;
@@ -663,6 +828,65 @@ int UtcDaliWebViewFormRepostDecisionFrameRendering(void)
   END_TEST;
 }
 
+int UtcDaliWebViewSslCertificateHttpAuthentication(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+  view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+  application.GetScene().Add( view );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( view );
+
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.CertificateConfirmSignal().Connect(&OnCertificateConfirm);
+  view.SslCertificateChangedSignal().Connect(&OnSslCertificateChanged);
+  view.HttpAuthHandlerSignal().Connect(&OnHttpAuthHandler);
+  bool signal1 = false;
+  bool signal2 = false;
+  bool signal3 = false;
+  view.ConnectSignal( testTracker, "certificateConfirm", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "sslCertificateChanged", CallbackFunctor(&signal2) );
+  view.ConnectSignal( testTracker, "httpAuthRequest", CallbackFunctor(&signal3) );
+  DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 0, TEST_LOCATION );
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 & signal2 & signal3);
+
+  // certificate.
+  DALI_TEST_CHECK(gCertificateConfirmInstance);
+  gCertificateConfirmInstance->Allow(true);
+  DALI_TEST_CHECK(gCertificateConfirmInstance->IsFromMainFrame());
+
+  DALI_TEST_CHECK(gSslCertificateInstance);
+  DALI_TEST_EQUALS(gSslCertificateInstance->GetPem(), "abc", TEST_LOCATION);
+  DALI_TEST_CHECK(gSslCertificateInstance->IsContextSecure());
+
+  // http authentication.
+  DALI_TEST_CHECK(gHttpAuthInstance);
+  gHttpAuthInstance->Suspend();
+  gHttpAuthInstance->UseCredential("", "");
+  gHttpAuthInstance->CancelCredential();
+  DALI_TEST_EQUALS(gHttpAuthInstance->GetRealm(), "test", TEST_LOCATION);
+
+  // reset
+  gCertificateConfirmInstance = nullptr;
+  gSslCertificateInstance = nullptr;
+  gHttpAuthInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewGetWebBackForwardList(void)
 {
   ToolkitTestApplication application;
@@ -838,6 +1062,67 @@ int UtcDaliWebViewPropertyTitleFavicon(void)
   END_TEST;
 }
 
+int UtcDaliWebViewContextMenuCustomizedAndItemSelected(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.ContextMenuCustomizedSignal().Connect( &OnContextMenuCustomized );
+  view.ContextMenuItemSelectedSignal().Connect( &OnContextMenuItemSelected );
+  bool signal1 = false;
+  bool signal2 = false;
+  view.ConnectSignal( testTracker, "contextMenuCustomized", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "contextMenuItemSelected", CallbackFunctor(&signal2) );
+  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_CHECK(gContextMenuInstance == 0);
+  DALI_TEST_CHECK(gContextMenuItemInstance == 0);
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 );
+  DALI_TEST_CHECK( signal2 );
+
+  // check context meun & its items.
+  DALI_TEST_CHECK(gContextMenuInstance != 0);
+  std::unique_ptr<Dali::WebEngineContextMenuItem> item = gContextMenuInstance->GetItemAt(0);
+  DALI_TEST_CHECK(item.get() != 0);
+  std::vector<std::unique_ptr<Dali::WebEngineContextMenuItem>> itemList = gContextMenuInstance->GetItemList();
+  DALI_TEST_CHECK(itemList.size() == 1);
+  Dali::Vector2 testPosition = Dali::Vector2(100, 100);
+  DALI_TEST_EQUALS(gContextMenuInstance->GetPosition(), testPosition, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuInstance->RemoveItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuInstance->AppendItemAsAction(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", false));
+  DALI_TEST_CHECK(gContextMenuInstance->AppendItem(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", "", false));
+  DALI_TEST_CHECK(gContextMenuInstance->SelectItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuInstance->Hide());
+
+  DALI_TEST_CHECK(gContextMenuItemInstance != 0);
+  Dali::WebEngineContextMenuItem::ItemTag testItemTag = Dali::WebEngineContextMenuItem::ItemTag::NO_ACTION;
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTag(), testItemTag, TEST_LOCATION);
+  Dali::WebEngineContextMenuItem::ItemType testItemType = Dali::WebEngineContextMenuItem::ItemType::ACTION;
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetType(), testItemType, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuItemInstance->IsEnabled());
+  std::string testLinkUrl("http://test.html");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetLinkUrl(), testLinkUrl, TEST_LOCATION);
+  std::string testImageUrl("http://test.jpg");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetImageUrl(), testImageUrl, TEST_LOCATION);
+  std::string testTitle("title");
+  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTitle(), testTitle, TEST_LOCATION);
+  DALI_TEST_CHECK(gContextMenuItemInstance->GetParentMenu().get() == 0);
+
+  gContextMenuInstance = nullptr;
+  gContextMenuItemInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewScrollBy(void)
 {
   ToolkitTestApplication application;
@@ -1009,6 +1294,99 @@ int UtcDaliWebViewHttpRequestInterceptor(void)
   END_TEST;
 }
 
+int UtcDaliWebViewPolicyDecisionRequest(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.PolicyDecisionSignal().Connect( &OnPolicyDecisionRequest );
+  bool signal1 = false;
+  view.ConnectSignal( testTracker, "policyDecision", CallbackFunctor(&signal1) );
+  DALI_TEST_EQUALS( gPolicyDecisionCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_CHECK(gPolicyDecisionInstance == 0);
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gPolicyDecisionCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 );
+
+  // check policy decision & its frame.
+  DALI_TEST_CHECK(gPolicyDecisionInstance != 0);
+  std::string testUrl("http://test.html");
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetUrl(), testUrl, TEST_LOCATION);
+  std::string testCookie("test:abc");
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetCookie(), testCookie, TEST_LOCATION);
+  Dali::WebEnginePolicyDecision::DecisionType testDecisionType = Dali::WebEnginePolicyDecision::DecisionType::USE;
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetDecisionType(), testDecisionType, TEST_LOCATION);
+  std::string testResponseMime("txt/xml");
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetResponseMime(), testResponseMime, TEST_LOCATION);
+  int32_t ResponseStatusCode = 500;
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetResponseStatusCode(), ResponseStatusCode, TEST_LOCATION);
+  Dali::WebEnginePolicyDecision::NavigationType testNavigationType = Dali::WebEnginePolicyDecision::NavigationType::LINK_CLICKED;
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetNavigationType(), testNavigationType, TEST_LOCATION);
+  std::string testScheme("test");
+  DALI_TEST_EQUALS(gPolicyDecisionInstance->GetScheme(), testScheme, TEST_LOCATION);
+  DALI_TEST_CHECK(gPolicyDecisionInstance->Use());
+  DALI_TEST_CHECK(gPolicyDecisionInstance->Ignore());
+  DALI_TEST_CHECK(gPolicyDecisionInstance->Suspend());
+
+  Dali::WebEngineFrame* webFrame = &(gPolicyDecisionInstance->GetFrame());
+  DALI_TEST_CHECK(webFrame);
+  DALI_TEST_CHECK(webFrame->IsMainFrame());
+
+  gPolicyDecisionInstance = nullptr;
+
+  END_TEST;
+}
+
+int UtcDaliWebViewHitTest(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  // load url.
+  view.LoadUrl( TEST_URL1 );
+
+  // sync hit test.
+  std::unique_ptr<Dali::WebEngineHitTest> hitTest = view.CreateHitTest(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT);
+  DALI_TEST_CHECK(hitTest != 0);
+  DALI_TEST_EQUALS(hitTest->GetResultContext(), Dali::WebEngineHitTest::ResultContext::DOCUMENT, TEST_LOCATION);
+  std::string testLinkUri("http://test.html");
+  DALI_TEST_EQUALS(hitTest->GetLinkUri(), testLinkUri, TEST_LOCATION);
+  std::string testLinkTitle("test");
+  DALI_TEST_EQUALS(hitTest->GetLinkTitle(), testLinkTitle, TEST_LOCATION);
+  std::string testLinkLabel("label");
+  DALI_TEST_EQUALS(hitTest->GetLinkLabel(), testLinkLabel, TEST_LOCATION);
+  std::string testImageUri("http://test.jpg");
+  DALI_TEST_EQUALS(hitTest->GetImageUri(), testImageUri, TEST_LOCATION);
+  std::string testMediaUri("http://test.mp4");
+  DALI_TEST_EQUALS(hitTest->GetMediaUri(), testMediaUri, TEST_LOCATION);
+  std::string testTagName("img");
+  DALI_TEST_EQUALS(hitTest->GetTagName(), testTagName, TEST_LOCATION);
+  std::string testNodeValue("test");
+  DALI_TEST_EQUALS(hitTest->GetNodeValue(), testNodeValue, TEST_LOCATION);
+  Dali::Property::Map* testMap = &hitTest->GetAttributes();
+  DALI_TEST_CHECK(testMap);
+  std::string testImageFileNameExtension("jpg");
+  DALI_TEST_EQUALS(hitTest->GetImageFileNameExtension(), testImageFileNameExtension, TEST_LOCATION);
+  Dali::PixelData testImageBuffer = hitTest->GetImageBuffer();
+  DALI_TEST_CHECK((int)testImageBuffer.GetWidth() == 2 && (int)testImageBuffer.GetHeight() == 2);
+
+  // async...
+  bool result = view.CreateHitTestAsynchronously(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT, &OnHitTestCreated);
+  DALI_TEST_CHECK(result);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gHitTestCreatedCallbackCalled, 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliWebViewEvaluteJavaScript(void)
 {
   ToolkitTestApplication application;
@@ -1149,9 +1527,15 @@ int UtcDaliWebBackForwardListCheckItem(void)
   unsigned int itemCount = bfList->GetItemCount();
   DALI_TEST_CHECK( itemCount == 1 )
 
-  Dali::Toolkit::WebBackForwardListItem* citem = bfList->GetCurrentItem();
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citem = bfList->GetCurrentItem();
   DALI_TEST_CHECK( citem != 0 );
 
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citemP = bfList->GetPreviousItem();
+  DALI_TEST_CHECK( citemP != 0 );
+
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> citemN = bfList->GetNextItem();
+  DALI_TEST_CHECK( citemN != 0 );
+
   const std::string kDefaultUrl( "http://url" );
   std::string testValue = citem->GetUrl();
   DALI_TEST_EQUALS( testValue, kDefaultUrl, TEST_LOCATION );
@@ -1164,9 +1548,15 @@ int UtcDaliWebBackForwardListCheckItem(void)
   testValue = citem->GetOriginalUrl();
   DALI_TEST_EQUALS( testValue, kDefaultOriginalUrl, TEST_LOCATION );
 
-  Dali::Toolkit::WebBackForwardListItem* item = bfList->GetItemAtIndex( 0 );
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> item = bfList->GetItemAtIndex( 0 );
   DALI_TEST_CHECK( item != 0 );
 
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecBack = bfList->GetBackwardItems(-1);
+  DALI_TEST_CHECK( vecBack.size() == 1 );
+
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecForward = bfList->GetForwardItems(-1);
+  DALI_TEST_CHECK( vecForward.size() == 1 );
+
   END_TEST;
 }
 
@@ -1189,8 +1579,8 @@ int UtcDaliWebContextGetSetCacheModel(void)
   context->SetCertificateFilePath( kDefaultValue );
   context->DisableCache( false );
   context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
-  context->DeleteWebDatabase();
-  context->DeleteWebStorage();
+  context->DeleteAllWebDatabase();
+  context->DeleteAllWebStorage();
   context->DeleteLocalFileSystem();
   context->ClearCache();
 
@@ -1206,6 +1596,76 @@ int UtcDaliWebContextGetSetCacheModel(void)
   END_TEST;
 }
 
+int UtcDaliWebContextGetWebDatabaseStorageOrigins(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebContext* context = view.GetContext();
+  DALI_TEST_CHECK( context != 0 )
+
+  std::string kDefaultValue;
+
+  // get origins of web database
+  bool result = context->GetWebDatabaseOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  Dali::WebEngineSecurityOrigin* origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->DeleteWebDatabase(*origin);
+  DALI_TEST_CHECK( result );
+
+  // get origins of web storage
+  result = context->GetWebStorageOrigins(&OnSecurityOriginsAcquired);
+  DALI_TEST_CHECK( result );
+
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 2, TEST_LOCATION );
+  DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
+
+  origin = gSecurityOriginList[0].get();
+  DALI_TEST_CHECK( origin );
+
+  result = context->GetWebStorageUsageForOrigin(*origin, &OnStorageUsageAcquired);
+  DALI_TEST_CHECK( result );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION );
+
+  result = context->DeleteWebStorageOrigin(*origin);
+  DALI_TEST_CHECK( result );
+
+  result = context->DeleteApplicationCache(*origin);
+  DALI_TEST_CHECK( result );
+
+  // form passwords, download state, mime type.
+  context->GetFormPasswordList(&OnFormPasswordsAcquired);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gFormPasswordsAcquiredCallbackCalled, 1, TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList.size() == 1);
+  DALI_TEST_EQUALS(gPasswordDataList[0]->url, "http://test.html", TEST_LOCATION);
+  DALI_TEST_CHECK(gPasswordDataList[0]->useFingerprint == false);
+
+  context->RegisterDownloadStartedCallback(&OnDownloadStarted);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gDownloadStartedCallbackCalled, 1, TEST_LOCATION);
+
+  context->RegisterMimeOverriddenCallback(&OnMimeOverridden);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gMimeOverriddenCallbackCalled, 1, TEST_LOCATION);
+
+  gSecurityOriginList.clear();
+  gPasswordDataList.clear();
+
+  END_TEST;
+}
+
 // test cases for web cookie manager.
 
 int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
@@ -1747,3 +2207,78 @@ int UtcDaliWebSettingsGetSetDefaultTextEncodingName(void)
   END_TEST;
 }
 
+int UtcDaliWebSettingsSetViewportMetaTag(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetViewportMetaTag(true);
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetForceZoom(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetForceZoom(true);
+  DALI_TEST_CHECK( value );
+
+  value = settings->IsZoomForced();
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetTextZoomEnabled(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  bool value = settings->SetTextZoomEnabled(true);
+  DALI_TEST_CHECK( value );
+
+  value = settings->IsTextZoomEnabled();
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsSetExtraFeature(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Check the value is true or not
+  settings->SetExtraFeature("test", true);
+  bool value = settings->IsExtraFeatureEnabled("test");
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
index be4735b..dd1fc93 100644 (file)
@@ -35,15 +35,15 @@ AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role,
 : self(self),
   modal(modal)
 {
-  auto control = Dali::Toolkit::Control::DownCast(self);
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
   if(controlImpl.mAccessibilityRole == Dali::Accessibility::Role::UNKNOWN)
     controlImpl.mAccessibilityRole = role;
 
-  self.PropertySetSignal().Connect(&controlImpl, [this, &controlImpl](Dali::Handle& handle, Dali::Property::Index index, Dali::Property::Value value) {
-    if(this->self != Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
+  Self().PropertySetSignal().Connect(&controlImpl, [this, &controlImpl](Dali::Handle& handle, Dali::Property::Index index, Dali::Property::Value value) {
+    if(this->Self() != Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
     {
       return;
     }
@@ -68,7 +68,7 @@ AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role,
 
 std::string AccessibleImpl::GetName()
 {
-  auto control = Dali::Toolkit::Control::DownCast(self);
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
@@ -86,7 +86,7 @@ std::string AccessibleImpl::GetName()
   if(auto raw = GetNameRaw(); !raw.empty())
     return raw;
 
-  return self.GetProperty<std::string>(Actor::Property::NAME);
+  return Self().GetProperty<std::string>(Actor::Property::NAME);
 }
 
 std::string AccessibleImpl::GetNameRaw()
@@ -96,7 +96,7 @@ std::string AccessibleImpl::GetNameRaw()
 
 std::string AccessibleImpl::GetDescription()
 {
-  auto control = Dali::Toolkit::Control::DownCast(self);
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
@@ -121,22 +121,22 @@ std::string AccessibleImpl::GetDescriptionRaw()
 
 Dali::Accessibility::Accessible* AccessibleImpl::GetParent()
 {
-  return Dali::Accessibility::Accessible::Get(self.GetParent());
+  return Dali::Accessibility::Accessible::Get(Self().GetParent());
 }
 
 size_t AccessibleImpl::GetChildCount()
 {
-  return self.GetChildCount();
+  return Self().GetChildCount();
 }
 
 Dali::Accessibility::Accessible* AccessibleImpl::GetChildAtIndex(size_t index)
 {
-  return Dali::Accessibility::Accessible::Get(self.GetChildAt(static_cast<unsigned int>(index)));
+  return Dali::Accessibility::Accessible::Get(Self().GetChildAt(static_cast<unsigned int>(index)));
 }
 
 size_t AccessibleImpl::GetIndexInParent()
 {
-  auto s      = self;
+  auto s      = Self();
   auto parent = s.GetParent();
   DALI_ASSERT_ALWAYS(parent && "can't call GetIndexInParent on object without parent");
   auto count = parent.GetChildCount();
@@ -152,11 +152,12 @@ size_t AccessibleImpl::GetIndexInParent()
 
 Dali::Accessibility::Role AccessibleImpl::GetRole()
 {
-  return self.GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
+  return Self().GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
 }
 
 Dali::Accessibility::States AccessibleImpl::CalculateStates()
 {
+  Dali::Actor self = Self();
   Dali::Accessibility::States s;
   s[Dali::Accessibility::State::FOCUSABLE] = self.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE);
   s[Dali::Accessibility::State::FOCUSED]   = Toolkit::KeyboardFocusManager::Get().GetCurrentFocusActor() == self;
@@ -187,7 +188,7 @@ Dali::Accessibility::States AccessibleImpl::GetStates()
 Dali::Accessibility::Attributes AccessibleImpl::GetAttributes()
 {
   std::unordered_map<std::string, std::string> attribute_map;
-  auto                                         q = Dali::Toolkit::Control::DownCast(self);
+  auto                                         q = Dali::Toolkit::Control::DownCast(Self());
   auto                                         w =
     q.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
   auto z = w.GetMap();
@@ -221,6 +222,7 @@ Dali::Accessibility::ComponentLayer AccessibleImpl::GetLayer()
 
 Dali::Rect<> AccessibleImpl::GetExtents(Dali::Accessibility::CoordType ctype)
 {
+  Dali::Actor self = Self();
   Vector2 screenPosition =
     self.GetProperty(Dali::DevelActor::Property::SCREEN_POSITION)
       .Get<Vector2>();
@@ -248,7 +250,7 @@ double AccessibleImpl::GetAlpha()
 
 bool AccessibleImpl::GrabFocus()
 {
-  return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(self);
+  return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self());
 }
 
 static Dali::Actor CreateHighlightIndicatorActor()
@@ -268,6 +270,7 @@ static Dali::Actor CreateHighlightIndicatorActor()
 
 bool AccessibleImpl::GrabHighlight()
 {
+  Dali::Actor self = Self();
   auto old = GetCurrentlyHighlightedActor();
 
   if(!Dali::Accessibility::IsUp())
@@ -304,6 +307,8 @@ bool AccessibleImpl::GrabHighlight()
 
 bool AccessibleImpl::ClearHighlight()
 {
+  Dali::Actor self = Self();
+
   if(!Dali::Accessibility::IsUp())
     return false;
   if(GetCurrentlyHighlightedActor() == self)
@@ -321,7 +326,7 @@ std::string AccessibleImpl::GetActionName(size_t index)
 {
   if(index >= GetActionCount()) return "";
   Dali::TypeInfo type;
-  self.GetTypeInfo(type);
+  Self().GetTypeInfo(type);
   DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
   return type.GetActionName(index);
 }
@@ -340,7 +345,7 @@ std::string AccessibleImpl::GetActionDescription(size_t index)
 size_t AccessibleImpl::GetActionCount()
 {
   Dali::TypeInfo type;
-  self.GetTypeInfo(type);
+  Self().GetTypeInfo(type);
   DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
   return type.GetActionCount();
 }
@@ -353,17 +358,17 @@ std::string AccessibleImpl::GetActionKeyBinding(size_t index)
 bool AccessibleImpl::DoAction(size_t index)
 {
   std::string actionName = GetActionName(index);
-  return self.DoAction(actionName, {});
+  return Self().DoAction(actionName, {});
 }
 
 bool AccessibleImpl::DoAction(const std::string& name)
 {
-  return self.DoAction(name, {});
+  return Self().DoAction(name, {});
 }
 
 bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
 {
-  auto control = Dali::Toolkit::Control::DownCast(self);
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
@@ -380,7 +385,7 @@ bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureIn
 
 std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
 {
-  auto control = Dali::Toolkit::Control::DownCast(self);
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
@@ -408,7 +413,7 @@ void AccessibleImpl::EnsureSelfVisible()
   auto parent = dynamic_cast<AccessibleImpl*>(GetParent());
   if(parent)
   {
-    parent->EnsureChildVisible(self);
+    parent->EnsureChildVisible(Self());
   }
 }
 
index ff31c1e..ed09487 100644 (file)
@@ -46,10 +46,23 @@ struct DALI_TOOLKIT_API AccessibleImpl : public virtual Dali::Accessibility::Acc
                                          public virtual Dali::Accessibility::Collection,
                                          public virtual Dali::Accessibility::Action
 {
-  Dali::Actor self;
+protected:
+  Dali::WeakHandle<Dali::Actor> self;
   Dali::WeakHandle<Dali::Actor> currentHighlightActor;
   bool        modal = false, root = false;
 
+  Dali::Actor Self()
+  {
+    auto handle = self.GetHandle();
+
+    // Control::Impl holds a std::unique_ptr to the Accessible object,
+    // so that one does not outlive the other.
+    DALI_ASSERT_ALWAYS(handle);
+
+    return handle;
+  }
+
+public:
   AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
 
   /**
index abe3389..37678d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,6 +35,11 @@ MaxLengthReachedSignalType& MaxLengthReachedSignal(TextEditor textEditor)
   return GetImpl(textEditor).MaxLengthReachedSignal();
 }
 
+AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor)
+{
+  return GetImpl(textEditor).AnchorClickedSignal();
+}
+
 void SelectWholeText(TextEditor textEditor)
 {
   GetImpl(textEditor).SelectWholeText();
index 77ed805..c73c582 100644 (file)
@@ -217,6 +217,27 @@ using MaxLengthReachedSignalType = Signal<void(TextEditor)>;
 DALI_TOOLKIT_API MaxLengthReachedSignalType& MaxLengthReachedSignal(TextEditor textEditor);
 
 /**
+ * @brief Anchor clicked signal type.
+ *
+ * @note Signal
+ *  - const char* : href of clicked anchor.
+ *  - uint32_t    : length of href.
+ */
+using AnchorClickedSignalType = Signal<void(TextEditor, const char*, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the anchor is clicked.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName(TextEditor textEditor, const char* href, uint32_t hrefLength);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor);
+
+/**
  * @brief Select the whole text of TextEditor.
  *
  * @param[in] textEditor The instance of TextEditor.
index 29c3730..fdfac30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,6 +30,11 @@ InputMethodContext GetInputMethodContext(TextField textField)
   return GetImpl(textField).GetInputMethodContext();
 }
 
+AnchorClickedSignalType& AnchorClickedSignal(TextField textField)
+{
+  return GetImpl(textField).AnchorClickedSignal();
+}
+
 void SelectWholeText(TextField textField)
 {
   GetImpl(textField).SelectWholeText();
index ac239ef..3367bec 100644 (file)
@@ -185,6 +185,27 @@ enum
 DALI_TOOLKIT_API InputMethodContext GetInputMethodContext(TextField textField);
 
 /**
+ * @brief Anchor clicked signal type.
+ *
+ * @note Signal
+ *  - const char* : href of clicked anchor.
+ *  - uint32_t    : length of href.
+ */
+using AnchorClickedSignalType = Signal<void(TextField, const char*, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the anchor is clicked.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName(TextField textField, const char* href, uint32_t hrefLength);
+ * @endcode
+ * @param[in] textField The instance of TextField.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextField textField);
+
+/**
  * @brief Select the whole text of TextField.
  *
  * @param[in] textField The instance of TextField.
  *
  */
 
-// CLASS HEADER
-#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
+#include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
 
 namespace Dali
 {
 namespace Toolkit
 {
-WebFormRepostDecision::WebFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision)
-: mFormRepostDecision(std::move(decision))
+namespace DevelTextLabel
 {
-}
-
-WebFormRepostDecision::~WebFormRepostDecision()
+AnchorClickedSignalType& AnchorClickedSignal(TextLabel textLabel)
 {
+  return GetImpl(textLabel).AnchorClickedSignal();
 }
 
-void WebFormRepostDecision::Reply(bool allowed)
-{
-  if(mFormRepostDecision)
-  {
-    mFormRepostDecision->Reply(allowed);
-  }
-}
+} // namespace DevelTextLabel
 
 } // namespace Toolkit
 
index 9b3e4db..efdad10 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -158,6 +158,27 @@ enum Type
 
 } // namespace Property
 
+/**
+ * @brief Anchor clicked signal type.
+ *
+ * @note Signal
+ *  - const char* : href of clicked anchor.
+ *  - uint32_t    : length of href.
+ */
+using AnchorClickedSignalType = Signal<void(TextLabel, const char*, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the anchor is clicked.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName(TextLabel textLabel, const char* href, uint32_t hrefLength);
+ * @endcode
+ * @param[in] textLabel The instance of TextLabel.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextLabel textLabel);
+
 } // namespace DevelTextLabel
 
 } // namespace Toolkit
diff --git a/dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.cpp b/dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.cpp
deleted file mode 100644 (file)
index f50a912..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h>
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-const std::string EMPTY_STRING;
-
-WebBackForwardListItem::WebBackForwardListItem(const Dali::WebEngineBackForwardListItem* item)
-: mWebEngineBackForwardListItem(item)
-{
-}
-
-WebBackForwardListItem::~WebBackForwardListItem()
-{
-}
-
-std::string WebBackForwardListItem::GetUrl() const
-{
-  return mWebEngineBackForwardListItem ? mWebEngineBackForwardListItem->GetUrl() : EMPTY_STRING;
-}
-
-std::string WebBackForwardListItem::GetTitle() const
-{
-  return mWebEngineBackForwardListItem ? mWebEngineBackForwardListItem->GetTitle() : EMPTY_STRING;
-}
-
-std::string WebBackForwardListItem::GetOriginalUrl() const
-{
-  return mWebEngineBackForwardListItem ? mWebEngineBackForwardListItem->GetOriginalUrl() : EMPTY_STRING;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h b/dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h
deleted file mode 100644 (file)
index 2ae0e35..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_ITEM_H
-#define DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_ITEM_H
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/dali-toolkit-common.h>
-
-namespace Dali
-{
-class WebEngineBackForwardListItem;
-
-namespace Toolkit
-{
-/**
- * @addtogroup dali_toolkit_controls_web_view
- * @{
- */
-
-/**
- * @brief WebBackForwardListItem is a class for back-forward list item of WebView.
- *
- *
- * For working WebBackForwardListItem, a Dali::WebBackForwardListItem should be provided.
- *
- */
-class DALI_TOOLKIT_API WebBackForwardListItem
-{
-public:
-  /**
-   * @brief Creates a WebBackForwardListItem.
-   */
-  WebBackForwardListItem(const Dali::WebEngineBackForwardListItem* item);
-
-  /**
-   * @brief Destructor.
-   */
-  virtual ~WebBackForwardListItem() final;
-
-  /**
-   * @brief Returns the URL of the item.
-   *
-   * @details The returned URL may differ from the original URL (For example,
-   *          if the page is redirected).
-   *
-   * @return The URL of the @a item, otherwise "" in case of an error
-   */
-  std::string GetUrl() const;
-
-  /**
-   * @brief Returns the title of the item.
-   *
-   * @return The title of the @a item, otherwise "" in case of an error
-   */
-  std::string GetTitle() const;
-
-  /**
-   * @brief Returns the original URL of the item.
-   *
-   * @return The original URL of the @a item, otherwise "" in case of an error
-   */
-  std::string GetOriginalUrl() const;
-
-private:
-  const Dali::WebEngineBackForwardListItem* mWebEngineBackForwardListItem;
-};
-
-/**
- * @}
- */
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_ITEM_H
old mode 100644 (file)
new mode 100755 (executable)
index 75014f0..8b3d8e1
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
 
 namespace Dali
 {
 namespace Toolkit
 {
-WebBackForwardList::WebBackForwardList(const Dali::WebEngineBackForwardList& list)
-: mWebEngineBackForwardList(list),
-  mWebBackForwardListItem(0)
+WebBackForwardList::WebBackForwardList(Dali::WebEngineBackForwardList& list)
+: mWebEngineBackForwardList(list)
 {
 }
 
@@ -36,16 +34,24 @@ WebBackForwardList::~WebBackForwardList()
 {
 }
 
-WebBackForwardListItem* WebBackForwardList::GetCurrentItem()
+std::unique_ptr<Dali::WebEngineBackForwardListItem> WebBackForwardList::GetCurrentItem()
 {
-  mWebBackForwardListItem = WebBackForwardListItem(&mWebEngineBackForwardList.GetCurrentItem());
-  return &mWebBackForwardListItem;
+  return mWebEngineBackForwardList.GetCurrentItem();
 }
 
-WebBackForwardListItem* WebBackForwardList::GetItemAtIndex(uint32_t index)
+std::unique_ptr<Dali::WebEngineBackForwardListItem> WebBackForwardList::GetPreviousItem()
 {
-  mWebBackForwardListItem = WebBackForwardListItem(&mWebEngineBackForwardList.GetItemAtIndex(index));
-  return &mWebBackForwardListItem;
+  return mWebEngineBackForwardList.GetPreviousItem();
+}
+
+std::unique_ptr<Dali::WebEngineBackForwardListItem> WebBackForwardList::GetNextItem()
+{
+  return mWebEngineBackForwardList.GetNextItem();
+}
+
+std::unique_ptr<Dali::WebEngineBackForwardListItem> WebBackForwardList::GetItemAtIndex(uint32_t index)
+{
+  return mWebEngineBackForwardList.GetItemAtIndex(index);
 }
 
 uint32_t WebBackForwardList::GetItemCount() const
@@ -53,6 +59,16 @@ uint32_t WebBackForwardList::GetItemCount() const
   return mWebEngineBackForwardList.GetItemCount();
 }
 
+std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> WebBackForwardList::GetBackwardItems(int limit)
+{
+  return mWebEngineBackForwardList.GetBackwardItems(limit);
+}
+
+std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> WebBackForwardList::GetForwardItems(int limit)
+{
+  return mWebEngineBackForwardList.GetForwardItems(limit);
+}
+
 } // namespace Toolkit
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 9dc81fc..0b015bc
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+#include <vector>
+#include <memory>
+
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h>
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
 
 namespace Dali
@@ -48,7 +52,7 @@ public:
   /**
    * @brief Creates a WebBackForwardList.
    */
-  WebBackForwardList(const Dali::WebEngineBackForwardList& list);
+  WebBackForwardList(Dali::WebEngineBackForwardList& list);
 
   /**
    * @brief Destructor.
@@ -59,14 +63,26 @@ public:
    * @brief Returns the current item in the @a list.
    * @return The current item in list.
    */
-  WebBackForwardListItem* GetCurrentItem();
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem();
+
+  /**
+   * @brief Returns the previous item in the @a list.
+   * @return The previous item in list.
+   */
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem();
+
+  /**
+   * @brief Returns the next item in the @a list.
+   * @return The next item in list.
+   */
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem();
 
   /**
    * @brief Returns the item at a given @a index relative to the current item.
    * @param[in] index The index of the item
    * @return The current item in list.
    */
-  WebBackForwardListItem* GetItemAtIndex(uint32_t index);
+  std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex(uint32_t index);
 
   /**
    * @brief Returns the length of the back-forward list including the current
@@ -76,9 +92,38 @@ public:
    */
   uint32_t GetItemCount() const;
 
+  /**
+   * @brief Creates a list containing the items preceding the current item limited
+   *        by @a limit.
+   *
+   * @details The WebEngineBackForwardListItem elements are located in the result
+              list starting with the oldest one.\n
+   *          If @a limit is equal to @c -1 all the items preceding the current
+   *          item are returned.
+   *
+   * @param[in] limit The number of items to retrieve
+   *
+   * @return @c vector containing @c WebEngineBackForwardListItem elements,\n
+   */
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit);
+
+  /**
+   * @brief Creates the list containing the items following the current item
+   *        limited by @a limit.
+   *
+   * @details The @c WebEngineBackForwardListItem elements are located in the result
+   *          list starting with the oldest one.\n
+   *          If @a limit is equal to @c -1 all the items preceding the current
+   *          item are returned.
+   *
+   * @param[in] limit The number of items to retrieve
+   *
+   * @return @c vector containing @c WebEngineBackForwardListItem elements,\n
+   */
+  std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit);
+
 private:
-  const Dali::WebEngineBackForwardList& mWebEngineBackForwardList;
-  Dali::Toolkit::WebBackForwardListItem mWebBackForwardListItem;
+  Dali::WebEngineBackForwardList& mWebEngineBackForwardList;
 };
 
 /**
index c72012c..413f5ca 100644 (file)
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
+
 namespace Dali
 {
 namespace Toolkit
@@ -61,14 +64,39 @@ void WebContext::SetDefaultProxyAuth(const std::string& username, const std::str
   mWebEngineContext.SetDefaultProxyAuth(username, password);
 }
 
-void WebContext::DeleteWebDatabase()
+void WebContext::DeleteAllWebDatabase()
+{
+  mWebEngineContext.DeleteAllWebDatabase();
+}
+
+bool WebContext::GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
 {
-  mWebEngineContext.DeleteWebDatabase();
+  return mWebEngineContext.GetWebDatabaseOrigins(callback);
 }
 
-void WebContext::DeleteWebStorage()
+bool WebContext::DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
 {
-  mWebEngineContext.DeleteWebStorage();
+  return mWebEngineContext.DeleteWebDatabase(origin);
+}
+
+bool WebContext::GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
+{
+  return mWebEngineContext.GetWebStorageOrigins(callback);
+}
+
+bool WebContext::GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback)
+{
+  return mWebEngineContext.GetWebStorageUsageForOrigin(origin, callback);
+}
+
+void WebContext::DeleteAllWebStorage()
+{
+  mWebEngineContext.DeleteAllWebStorage();
+}
+
+bool WebContext::DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin)
+{
+  return mWebEngineContext.DeleteWebStorageOrigin(origin);
 }
 
 void WebContext::DeleteLocalFileSystem()
@@ -81,6 +109,25 @@ void WebContext::ClearCache()
   mWebEngineContext.ClearCache();
 }
 
-} // namespace Toolkit
+bool WebContext::DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
+{
+  return mWebEngineContext.DeleteApplicationCache(origin);
+}
+
+void WebContext::GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
+{
+  mWebEngineContext.GetFormPasswordList(callback);
+}
 
+void WebContext::RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
+{
+  mWebEngineContext.RegisterDownloadStartedCallback(callback);
+}
+
+void WebContext::RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
+{
+  mWebEngineContext.RegisterMimeOverriddenCallback(callback);
+}
+
+} // namespace Toolkit
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index ead4efd..cdf7f0e
@@ -27,6 +27,8 @@
 
 namespace Dali
 {
+class WebEngineSecurityOrigin;
+
 namespace Toolkit
 {
 /**
@@ -35,16 +37,16 @@ namespace Toolkit
  */
 
 /**
- * @brief WebContext is a control for settings of WebView.
+ * @brief WebContext is a control for context of WebView.
  *
- * For working WebContext, a WebView should be provided.
+ * For working WebContext, a WebEngineContext should be provided.
  *
  */
 class DALI_TOOLKIT_API WebContext
 {
 public:
   /**
-   * @brief Creates a WebContext.
+   * @brief Create a WebContext.
    *
    * @param[in] context The context of web engine.
    */
@@ -56,28 +58,28 @@ public:
   virtual ~WebContext() final;
 
   /**
-   * @brief Returns the cache model type.
+   * @brief Return the cache model type.
    *
    * @return #Dali::WebEngineContext::CacheModel
    */
   Dali::WebEngineContext::CacheModel GetCacheModel() const;
 
   /**
-   * @brief Requests to set the cache model.
+   * @brief Request to set the cache model.
    *
    * @param[in] cacheModel The cache model
    */
   void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel);
 
   /**
-   * @brief Sets the given proxy URI to network backend of specific context.
+   * @brief Set the given proxy URI to network backend of specific context.
    *
    * @param[in] uri The proxy URI to set
    */
   void SetProxyUri(const std::string& uri);
 
   /**
-   * Adds CA certificates to persistent NSS certificate database
+   * @brief Add CA certificates to persistent NSS certificate database
    *
    * Function accepts a path to a CA certificate file, a path to a directory
    * containing CA certificate files, or a colon-seprarated list of those.
@@ -89,7 +91,7 @@ public:
   void SetCertificateFilePath(const std::string& certificatePath);
 
   /**
-   * Toggles the cache to be enabled or disabled
+   * @brief Toggle the cache to be enabled or disabled
    *
    * Function works asynchronously.
    * By default the cache is disabled resulting in not storing network data on disk.
@@ -99,7 +101,7 @@ public:
   void DisableCache(bool cacheDisabled);
 
   /**
-   * @brief Sets a proxy auth credential to network backend of specific context.
+   * @brief Set a proxy auth credential to network backend of specific context.
    *
    * @param[in] username username to set
    * @param[in] password password to set
@@ -107,20 +109,66 @@ public:
   void SetDefaultProxyAuth(const std::string& username, const std::string& password);
 
   /**
-   * Requests for deleting all web databases.
+   * @brief Requests for deleting all web databases.
+   */
+  void DeleteAllWebDatabase();
+
+  /**
+   * @brief Request for getting web database origins.
+   *
+   * @param[in] callback callback called after getting web database origins
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback);
+
+  /**
+   * @brief Request for deleting web databases for origin.
+   *
+   * @param[in] origin database origin
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Gets list of origins that is stored in web storage db.
+   *
+   * @param[in] callback callback called after getting web storage origins
+   *
+   * @return true if succeeded, false otherwise
    */
-  void DeleteWebDatabase();
+  bool GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback);
 
   /**
-   * @brief Deletes web storage.
+   * @brief Get list of origins that is stored in web storage db.
+   *
+   * @param[in] origin storage origin
+   * @param[in] callback callback called after getting web storage origins
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback);
+
+  /**
+   * @brief Delete all web storage.
    *
    * @details This function does not ensure that all data will be removed.
    *          Should be used to extend free physical memory.
    */
-  void DeleteWebStorage();
+  void DeleteAllWebStorage();
 
   /**
-   * @brief Requests for deleting all local file systems.
+   * @brief Delete origin that is stored in web storage db.
+   *
+   * @param[in] origin origin of db
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteWebStorageOrigin(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Request for deleting all local file systems.
    */
   void DeleteLocalFileSystem();
 
@@ -129,6 +177,36 @@ public:
    */
   void ClearCache();
 
+  /**
+   * @brief Request for deleting web application cache for origin.
+   *
+   * @param[in] origin application cache origin
+   *
+   * @return true if succeeded, false otherwise
+   */
+  bool DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin);
+
+  /**
+   * @brief Asynchronous request to get list of all password data.
+   *
+   * @param[in] callback callback called after getting form password
+   */
+  void GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback);
+
+  /**
+   * @brief Register callback for download started.
+   *
+   * @param[in] callback callback for download started
+   */
+  void RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback);
+
+  /**
+   * @brief Register callback for mime overridden.
+   *
+   * @param[in] callback callback for mime overridden
+   */
+  void RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback);
+
 private:
   Dali::WebEngineContext& mWebEngineContext;
 };
diff --git a/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h b/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h
deleted file mode 100755 (executable)
index 755fe57..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
-#define DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/dali-toolkit-common.h>
-
-namespace Dali
-{
-class WebEngineFormRepostDecision;
-
-namespace Toolkit
-{
-/**
- * @addtogroup dali_toolkit_controls_web_view
- * @{
- */
-
-/**
- * @brief WebFormRepostDecision is a class for form repost decision of WebView.
- *
- *
- * For working WebFormRepostDecision, a Dali::WebEngineFormRepostDecision should be provided.
- *
- */
-class DALI_TOOLKIT_API WebFormRepostDecision
-{
-public:
-  /**
-   * @brief Creates a WebFormRepostDecision.
-   */
-  WebFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision);
-
-  /**
-   * @brief Destructor.
-   */
-  virtual ~WebFormRepostDecision() final;
-
-  /**
-   * @brief Reply the result about form repost decision.
-   *
-   * @param[in] allowed Whether allow form repost decision request or not
-   */
-  void Reply(bool allowed);
-
-private:
-  std::shared_ptr<Dali::WebEngineFormRepostDecision> mFormRepostDecision;
-};
-
-/**
- * @}
- */
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
index d39a93e..b17f48d 100755 (executable)
@@ -234,6 +234,42 @@ void WebSettings::SetDefaultTextEncodingName(const std::string& defaultTextEncod
   mWebEngineSettings.SetDefaultTextEncodingName(defaultTextEncodingName);
 }
 
+bool WebSettings::SetViewportMetaTag(bool enable)
+{
+  return mWebEngineSettings.SetViewportMetaTag(enable);
+}
+
+bool WebSettings::SetForceZoom(bool enable)
+{
+  return mWebEngineSettings.SetForceZoom(enable);
+}
+
+bool WebSettings::IsZoomForced() const
+{
+  return mWebEngineSettings.IsZoomForced();
+}
+
+bool WebSettings::SetTextZoomEnabled(bool enable)
+{
+  return mWebEngineSettings.SetTextZoomEnabled(enable);
+}
+
+bool WebSettings::IsTextZoomEnabled() const
+{
+  return mWebEngineSettings.IsTextZoomEnabled();
+}
+
+void WebSettings::SetExtraFeature(const std::string& feature, bool enable)
+{
+  mWebEngineSettings.SetExtraFeature(feature, enable);
+}
+
+bool WebSettings::IsExtraFeatureEnabled(const std::string& feature) const
+{
+  return mWebEngineSettings.IsExtraFeatureEnabled(feature);
+}
+
+
 } // namespace Toolkit
 
 } // namespace Dali
index ba8b1fa..de42833 100755 (executable)
@@ -344,6 +344,69 @@ public:
    */
   void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
 
+  /**
+   * @brief Enables/disables the viewport meta tag.
+   *
+   * By default, the viewport meta tag is enabled on mobile and wearable,
+   * but it is disabled on TV.
+   *
+   * @param[in] enable @c true to enable the viewport meta tag
+   *               @c false to disable
+   *
+   * @return @c true on success or @c false on failure
+   */
+  bool SetViewportMetaTag(bool enable);
+
+  /**
+   * @brief Requests setting of force zoom.
+   *
+   * @param[in] enable to force zoom
+   *
+   * @return @c true on success or @c false on failure
+   */
+  bool SetForceZoom(bool enable);
+
+  /**
+   * @brief Returns the force zoom status.
+   *
+   * @return @c true if enable force zoom or @c false.
+   */
+  bool IsZoomForced() const;
+
+  /**
+   * @brief Requests setting use of text zoom.
+   *
+   * @param[in] enable to text zoom.
+   *
+   * @return @c true on success or @c false on failure
+   */
+  bool SetTextZoomEnabled(bool enable);
+
+  /**
+   * @brief Returns whether text zoom is enabled or not.
+   *
+   * @return @c true if enable text zoom or @c false.
+   */
+  bool IsTextZoomEnabled() const;
+
+  /**
+   * @brief Requests enables/disables to the specific extra feature
+   *
+   * @param[in] feature feature name
+   * @param[in] enable @c true to enable the specific extra feature
+   *        @c false to disable
+   */
+  void SetExtraFeature(const std::string& feature, bool enable);
+
+  /**
+   * @brief Returns enable/disable to the specific extra feature
+   *
+   * @param[in] feature feature name
+   *
+   * @return @c true on enable or @c false on disable
+   */
+  bool IsExtraFeatureEnabled(const std::string& feature) const;
+
 private:
   Dali::WebEngineSettings& mWebEngineSettings;
 };
index 504cabb..d3c201a 100755 (executable)
@@ -59,7 +59,7 @@ WebView WebView::New(const std::string& locale, const std::string& timezoneId)
   return Internal::WebView::New(locale, timezoneId);
 }
 
-WebView WebView::New(int argc, char** argv)
+WebView WebView::New(uint32_t argc, char** argv)
 {
   return Internal::WebView::New(argc, argv);
 }
@@ -169,12 +169,12 @@ bool WebView::StopInspectorServer()
   return Dali::Toolkit::GetImpl(*this).StopInspectorServer();
 }
 
-void WebView::ScrollBy(int deltaX, int deltaY)
+void WebView::ScrollBy(int32_t deltaX, int32_t deltaY)
 {
   Dali::Toolkit::GetImpl(*this).ScrollBy(deltaX, deltaY);
 }
 
-bool WebView::ScrollEdgeBy(int deltaX, int deltaY)
+bool WebView::ScrollEdgeBy(int32_t deltaX, int32_t deltaY)
 {
   return Dali::Toolkit::GetImpl(*this).ScrollEdgeBy(deltaX, deltaY);
 }
@@ -244,6 +244,16 @@ void WebView::JavaScriptPromptReply(const std::string& result)
   Dali::Toolkit::GetImpl(*this).JavaScriptPromptReply(result);
 }
 
+std::unique_ptr<Dali::WebEngineHitTest> WebView::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
+{
+  return Dali::Toolkit::GetImpl(*this).CreateHitTest(x, y, mode);
+}
+
+bool WebView::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
+{
+  return Dali::Toolkit::GetImpl(*this).CreateHitTestAsynchronously(x, y, mode, callback);
+}
+
 void WebView::ClearHistory()
 {
   Dali::Toolkit::GetImpl(*this).ClearHistory();
@@ -279,12 +289,12 @@ void WebView::AddDynamicCertificatePath(const std::string& host, const std::stri
   Dali::Toolkit::GetImpl(*this).AddDynamicCertificatePath(host, certPath);
 }
 
-Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor)
+Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
 {
   return Dali::Toolkit::GetImpl(*this).GetScreenshot(viewArea, scaleFactor);
 }
 
-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)
 {
   return Dali::Toolkit::GetImpl(*this).GetScreenshotAsynchronously(viewArea, scaleFactor, callback);
 }
@@ -344,6 +354,41 @@ WebView::WebViewRequestInterceptorSignalType& WebView::RequestInterceptorSignal(
   return Dali::Toolkit::GetImpl(*this).RequestInterceptorSignal();
 }
 
+WebView::WebViewConsoleMessageSignalType& WebView::ConsoleMessageSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).ConsoleMessageSignal();
+}
+
+WebView::WebViewPolicyDecisionSignalType& WebView::PolicyDecisionSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).PolicyDecisionSignal();
+}
+
+WebView::WebViewCertificateSignalType& WebView::CertificateConfirmSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).CertificateConfirmSignal();
+}
+
+WebView::WebViewCertificateSignalType& WebView::SslCertificateChangedSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).SslCertificateChangedSignal();
+}
+
+WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandlerSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).HttpAuthHandlerSignal();
+}
+
+WebView::WebViewContextMenuCustomizedSignalType& WebView::ContextMenuCustomizedSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).ContextMenuCustomizedSignal();
+}
+
+WebView::WebViewContextMenuItemSelectedSignalType& WebView::ContextMenuItemSelectedSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).ContextMenuItemSelectedSignal();
+}
+
 WebView::WebView(Internal::WebView& implementation)
 : Control(implementation)
 {
index a64e1ca..4f9159d 100755 (executable)
@@ -33,6 +33,8 @@ namespace Toolkit
 class ImageView;
 class WebBackForwardList;
 class WebContext;
+class WebContextMenu;
+class WebContextMenuItem;
 class WebCookieManager;
 class WebFormRepostDecision;
 class WebSettings;
@@ -187,28 +189,6 @@ public:
   };
 
   /**
-   * @brief Enumeration for indicating error code of page loading.
-   */
-  enum class LoadErrorCode
-  {
-    UNKNOWN = 0,           ///< Unknown.
-    CANCELED,              ///< User canceled.
-    CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type.
-    FAILED_FILE_IO,        ///< File IO error.
-    CANT_CONNECT,          ///< Cannot connect to the network.
-    CANT_LOOKUP_HOST,      ///< Fail to look up host from the DNS.
-    FAILED_TLS_HANDSHAKE,  ///< Fail to SSL/TLS handshake.
-    INVALID_CERTIFICATE,   ///< Received certificate is invalid.
-    REQUEST_TIMEOUT,       ///< Connection timeout.
-    TOO_MANY_REDIRECTS,    ///< Too many redirects.
-    TOO_MANY_REQUESTS,     ///< Too many requests during this load.
-    BAD_URL,               ///< Malformed URL.
-    UNSUPPORTED_SCHEME,    ///< Unsupported scheme.
-    AUTHENTICATION,        ///< User authentication failed on the server.
-    INTERNAL_SERVER        ///< Web server has an internal server error.
-  };
-
-  /**
    * @brief WebView callback related with screen-shot captured.
    */
   using WebViewScreenshotCapturedCallback = std::function<void(Dali::Toolkit::ImageView)>;
@@ -221,7 +201,7 @@ public:
   /**
    * @brief WebView signal type related with page loading error.
    */
-  using WebViewPageLoadErrorSignalType = Signal<void(WebView, const std::string&, LoadErrorCode)>;
+  using WebViewPageLoadErrorSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineLoadError>)>;
 
   /**
    * @brief WebView signal type related with scroll edge reached.
@@ -236,7 +216,7 @@ public:
   /**
    * @brief WebView signal type related with form repost decision.
    */
-  using WebViewFormRepostDecisionSignalType = Signal<void(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision>)>;
+  using WebViewFormRepostDecisionSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineFormRepostDecision>)>;
 
   /**
    * @brief WebView signal type related with frame rendered.
@@ -248,9 +228,39 @@ public:
    */
   using WebViewRequestInterceptorSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineRequestInterceptor>)>;
 
+  /**
+   * @brief WebView signal type related with console message.
+   */
+  using WebViewConsoleMessageSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineConsoleMessage>)>;
+
+  /**
+   * @brief WebView signal type related with policy decision.
+   */
+  using WebViewPolicyDecisionSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEnginePolicyDecision>)>;
+
+  /**
+   * @brief WebView signal type related with certificate changed.
+   */
+  using WebViewCertificateSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineCertificate>)>;
+
+  /**
+   * @brief WebView signal type related with http authentication.
+   */
+  using WebViewHttpAuthHandlerSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
+
+  /**
+   * @brief WebView signal type related with context menu customized.
+   */
+  using WebViewContextMenuCustomizedSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenu>)>;
+
+  /**
+   * @brief WebView signal type related with context menu item selected.
+   */
+  using WebViewContextMenuItemSelectedSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenuItem>)>;
+
 public:
   /**
-   * @brief Creates an initialized WebView.
+   * @brief Create an initialized WebView.
    * @return A handle to a newly allocated Dali WebView
    *
    * @note WebView will not display anything
@@ -258,7 +268,7 @@ public:
   static WebView New();
 
   /**
-   * @brief Creates an initialized WebView.
+   * @brief Create an initialized WebView.
    *
    * @param [in] locale The locale of Web
    * @param [in] timezoneId The timezoneId of Web
@@ -266,15 +276,15 @@ public:
   static WebView New(const std::string& locale, const std::string& timezoneId);
 
   /**
-   * @brief Creates an initialized WebView.
+   * @brief Create an initialized WebView.
    *
    * @param [in] argc The count of arguments of Applications
    * @param [in] argv The string array of arguments of Applications
    */
-  static WebView New(int argc, char** argv);
+  static WebView New(uint32_t argc, char** argv);
 
   /**
-   * @brief Creates an uninitialized WebView.
+   * @brief Create an uninitialized WebView.
    */
   WebView();
 
@@ -301,7 +311,7 @@ public:
   WebView& operator=(const WebView& WebView);
 
   /**
-   * @brief Downcasts a handle to WebView handle.
+   * @brief Downcast a handle to WebView handle.
    *
    * If handle points to a WebView, the downcast produces valid handle.
    * If not, the returned handle is left uninitialized.
@@ -339,14 +349,14 @@ public:
   Dali::Toolkit::ImageView& GetFavicon();
 
   /**
-   * @brief Loads a web page based on a given URL.
+   * @brief Load a web page based on a given URL.
    *
    * @param [in] url The URL of the resource to load
    */
   void LoadUrl(const std::string& url);
 
   /**
-   * @brief Loads a given string as web contents.
+   * @brief Load a given string as web contents.
    *
    * @param [in] htmlString The string to use as the contents of the web page
    */
@@ -364,7 +374,7 @@ public:
   bool LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl);
 
   /**
-   * @brief Requests loading the given contents by MIME type into the view object
+   * @brief Request loading the given contents by MIME type into the view object
    *
    * @param[in] contents The content to load
    * @param[in] contentSize The size of contents (in bytes)
@@ -377,27 +387,27 @@ public:
   bool LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
 
   /**
-   * @brief Reloads the Web.
+   * @brief Reload the Web.
    */
   void Reload();
 
   /**
-   * @brief Reloads the current page's document without cache
+   * @brief Reload the current page's document without cache
    */
   bool ReloadWithoutCache();
 
   /**
-   * @brief Stops loading web contents on the current page.
+   * @brief Stop loading web contents on the current page.
    */
   void StopLoading();
 
   /**
-   * @brief Suspends the operation associated with the view.
+   * @brief Suspend the operation associated with the view.
    */
   void Suspend();
 
   /**
-   * @brief Resumes the operation associated with the view object after calling Suspend().
+   * @brief Resume the operation associated with the view object after calling Suspend().
    */
   void Resume();
 
@@ -447,48 +457,48 @@ public:
   bool StopInspectorServer();
 
   /**
-   * @brief Scrolls web page of view by deltaX and deltaY.
+   * @brief Scroll web page of view by deltaX and deltaY.
    * @param[in] deltaX The delta x of scroll
    * @param[in] deltaY The delta y of scroll
    */
-  void ScrollBy(int deltaX, int deltaY);
+  void ScrollBy(int32_t deltaX, int32_t deltaY);
 
   /**
-   * @brief Scrolls edge of view by deltaX and deltaY.
+   * @brief Scroll edge of view by deltaX and deltaY.
    *
    * @param[in] deltaX horizontal offset to scroll
    * @param[in] deltaY vertical offset to scroll
    *
    * @return true if succeeded, false otherwise
    */
-  bool ScrollEdgeBy(int deltaX, int deltaY);
+  bool ScrollEdgeBy(int32_t deltaX, int32_t deltaY);
 
   /**
-   * @brief Returns whether forward is possible.
+   * @brief Return whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
    */
   bool CanGoForward();
 
   /**
-   * @brief Goes forward in the navigation history.
+   * @brief Go forward in the navigation history.
    */
   void GoForward();
 
   /**
-   * @brief Returns whether backward is possible.
+   * @brief Return whether backward is possible.
    *
    * @return True if backward is possible, false otherwise
    */
   bool CanGoBack();
 
   /**
-   * @brief Goes back in the navigation history.
+   * @brief Go back in the navigation history.
    */
   void GoBack();
 
   /**
-   * @brief Evaluates JavaScript code represented as a string.
+   * @brief Evaluate JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
    * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result
@@ -496,7 +506,7 @@ public:
   void EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler);
 
   /**
-   * @brief Evaluates JavaScript code represented as a string.
+   * @brief Evaluate JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
    */
@@ -567,24 +577,47 @@ public:
   void JavaScriptPromptReply(const std::string& result);
 
   /**
-   * @brief Clears the history of Web.
+   * @brief Create a new hit test.
+   *
+   * @param[in] x the horizontal position to query
+   * @param[in] y the vertical position to query
+   * @param[in] mode the mode of hit test
+   *
+   * @return a new hit test object.
+   */
+  std::unique_ptr<Dali::WebEngineHitTest> CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode);
+
+  /**
+   * @brief Create a hit test asynchronously.
+   *
+   * @param[in] x the horizontal position to query
+   * @param[in] y the vertical position to query
+   * @param[in] mode the mode of hit test
+   * @param[in] callback The callback function
+   *
+   * @return true if succeeded, false otherwise.
+   */
+  bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback);
+
+  /**
+   * @brief Clear the history of Web.
    */
   void ClearHistory();
 
   /**
-   * @brief Clears all tiles resources of Web.
+   * @brief Clear all tiles resources of Web.
    */
   void ClearAllTilesResources();
 
   /**
-   * @brief Scales the current page, centered at the given point.
+   * @brief Scale the current page, centered at the given point.
    * @param[in] scaleFactor a new factor to be scaled.
    * @param[in] point a center coordinate.
    */
   void SetScaleFactor(float scaleFactor, Dali::Vector2 point);
 
   /**
-   * @brief Gets the current scale factor of the page.
+   * @brief Get the current scale factor of the page.
    * @return The current scale factor.
    */
   float GetScaleFactor() const;
@@ -596,7 +629,7 @@ public:
   void ActivateAccessibility(bool activated);
 
   /**
-   * @brief Searches and highlights the given string in the document.
+   * @brief Search and highlights the given string in the document.
    * @param[in] text The text to find
    * @param[in] options The options to find
    * @param[in] maxMatchCount The maximum match count to find
@@ -620,7 +653,7 @@ public:
    *
    * @return image view of screen shot
    */
-  Dali::Toolkit::ImageView GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor);
+  Dali::Toolkit::ImageView GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor);
 
   /**
    * @brief Request to get snapshot of the specified viewArea of page asynchronously.
@@ -631,7 +664,7 @@ public:
    *
    * @return true if requested successfully, false otherwise
    */
-  bool GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, WebViewScreenshotCapturedCallback callback);
+  bool GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, WebViewScreenshotCapturedCallback callback);
 
   /**
    * @brief Asynchronous request to check if there is a video playing in the given view.
@@ -643,86 +676,135 @@ public:
   bool CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback);
 
   /**
-   * @brief Sets callback which will be called upon geolocation permission request.
+   * @brief Set callback which will be called upon geolocation permission request.
    *
    * @param[in] callback The callback for requesting geolocation permission
    */
   void RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback);
 
   /**
-   * @brief Connects to this signal to be notified when page loading is started.
+   * @brief Connect to this signal to be notified when page loading is started.
    *
    * @return A signal object to connect with
    */
   WebViewPageLoadSignalType& PageLoadStartedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when page loading is in progress.
+   * @brief Connect to this signal to be notified when page loading is in progress.
    *
    * @return A signal object to connect with
    */
   WebViewPageLoadSignalType& PageLoadInProgressSignal();
 
   /**
-   * @brief Connects to this signal to be notified when page loading is finished.
+   * @brief Connect to this signal to be notified when page loading is finished.
    *
    * @return A signal object to connect with
    */
   WebViewPageLoadSignalType& PageLoadFinishedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when an error occurs in page loading.
+   * @brief Connect to this signal to be notified when an error occurs in page loading.
    *
    * @return A signal object to connect with
    */
   WebViewPageLoadErrorSignalType& PageLoadErrorSignal();
 
   /**
-   * @brief Connects to this signal to be notified when scroll edge is reached.
+   * @brief Connect to this signal to be notified when scroll edge is reached.
    *
    * @return A signal object to connect with
    */
   WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when url is changed.
+   * @brief Connect to this signal to be notified when url is changed.
    *
    * @return A signal object to connect with
    */
   WebViewUrlChangedSignalType& UrlChangedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when form repost decision is requested.
+   * @brief Connect to this signal to be notified when form repost decision is requested.
    *
    * @return A signal object to connect with.
    */
   WebViewFormRepostDecisionSignalType& FormRepostDecisionSignal();
 
   /**
-   * @brief Connects to this signal to be notified when frame is rendered.
+   * @brief Connect to this signal to be notified when frame is rendered.
    *
    * @return A signal object to connect with.
    */
   WebViewFrameRenderedSignalType& FrameRenderedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when http request need be intercepted.
+   * @brief Connect to this signal to be notified when http request need be intercepted.
    *
    * @return A signal object to connect with.
    */
   WebViewRequestInterceptorSignalType& RequestInterceptorSignal();
 
+  /**
+   * @brief Connect to this signal to be notified when console message will be logged.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewConsoleMessageSignalType& ConsoleMessageSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when new policy would be decided.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewPolicyDecisionSignalType& PolicyDecisionSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when certificate need be confirmed.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewCertificateSignalType& CertificateConfirmSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when ssl certificate is changed.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewCertificateSignalType& SslCertificateChangedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when http authentication need be confirmed.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when context menu would be customized.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when context menu item is selected.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+
 public: // Not intended for application developers
   /// @cond internal
   /**
-   * @brief Creates a handle using the Toolkit::Internal implementation.
+   * @brief Create a handle using the Toolkit::Internal implementation.
    *
    * @param[in] implementation The WebView implementation
    */
   DALI_INTERNAL WebView(Internal::WebView& implementation);
 
   /**
-   * @brief Allows the creation of this WebView from an Internal::CustomActor pointer.
+   * @brief Allow the creation of this WebView from an Internal::CustomActor pointer.
    *
    * @param[in] internal A pointer to the internal CustomActor
    */
index cc7dd45..f583d3c 100755 (executable)
@@ -34,15 +34,14 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/controls/table-view/table-view.cpp
   ${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp
   ${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp
+  ${devel_api_src_dir}/controls/text-controls/text-label-devel.cpp
   ${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp
   ${devel_api_src_dir}/controls/text-controls/text-selection-toolbar.cpp
   ${devel_api_src_dir}/controls/tool-bar/tool-bar.cpp
   ${devel_api_src_dir}/controls/video-view/video-view-devel.cpp
   ${devel_api_src_dir}/controls/web-view/web-back-forward-list.cpp
-  ${devel_api_src_dir}/controls/web-view/web-back-forward-list-item.cpp
   ${devel_api_src_dir}/controls/web-view/web-context.cpp
   ${devel_api_src_dir}/controls/web-view/web-cookie-manager.cpp
-  ${devel_api_src_dir}/controls/web-view/web-form-repost-decision.cpp
   ${devel_api_src_dir}/controls/web-view/web-settings.cpp
   ${devel_api_src_dir}/controls/web-view/web-view.cpp
   ${devel_api_src_dir}/focus-manager/keyinput-focus-manager.cpp
@@ -256,10 +255,8 @@ SET( devel_api_video_view_header_files
 
 SET( devel_api_web_view_header_files
   ${devel_api_src_dir}/controls/web-view/web-back-forward-list.h
-  ${devel_api_src_dir}/controls/web-view/web-back-forward-list-item.h
   ${devel_api_src_dir}/controls/web-view/web-context.h
   ${devel_api_src_dir}/controls/web-view/web-cookie-manager.h
-  ${devel_api_src_dir}/controls/web-view/web-form-repost-decision.h
   ${devel_api_src_dir}/controls/web-view/web-settings.h
   ${devel_api_src_dir}/controls/web-view/web-view.h
 )
index 0112e32..1441dc4 100644 (file)
@@ -172,7 +172,8 @@ void ShapeTextPreprocess(const RendererParameters& textParameters, TextAbstracti
 
   MarkupProcessData markupProcessData(colorRuns,
                                       fontDescriptionRuns,
-                                      textModel->mLogicalModel->mEmbeddedItems);
+                                      textModel->mLogicalModel->mEmbeddedItems,
+                                      textModel->mLogicalModel->mAnchors);
 
   if(textParameters.markupEnabled)
   {
index 6a5f51d..1098b7d 100644 (file)
@@ -73,8 +73,16 @@ enum Type
 
   /**
    * @brief The radius for the rounded corners of the visual
-   * @details Name "cornerRadius", type Property::FLOAT, animatable
-   * @note Optional.
+   * @details Name "cornerRadius", type Property::FLOAT or Prooperty::VECTOR4, animatable
+   * @note By default, it is Vector::ZERO.
+   * @note Only Property::Vector4 can be animated.
+   * @note Radius value are used in clockwise order from top-left-corner to bottom-left-corner.
+   *       When radius is Vector4(x, y, z, w)
+   *       x    y
+   *        +--+
+   *        |  |
+   *        +--+
+   *       w    z
    */
   CORNER_RADIUS = OPACITY + 2,
 
index 2b830fa..54cf75f 100644 (file)
@@ -1306,7 +1306,7 @@ Padding Button::GetForegroundPadding()
 std::string Button::AccessibleImpl::GetNameRaw()
 {
   std::string   labelText;
-  auto          slf      = Toolkit::Button::DownCast(self);
+  auto          slf      = Toolkit::Button::DownCast(Self());
   Property::Map labelMap = slf.GetProperty<Property::Map>(Toolkit::Button::Property::LABEL);
 
   Property::Value* textPropertyPtr = labelMap.Find(Toolkit::TextVisual::Property::TEXT);
@@ -1321,7 +1321,7 @@ std::string Button::AccessibleImpl::GetNameRaw()
 Property::Index Button::AccessibleImpl::GetNamePropertyIndex()
 {
   Property::Index label    = Toolkit::Button::Property::LABEL;
-  Property::Map   labelMap = self.GetProperty<Property::Map>(label);
+  Property::Map   labelMap = Self().GetProperty<Property::Map>(label);
 
   if(MapContainsTextString(labelMap))
     return label;
@@ -1333,7 +1333,7 @@ Dali::Accessibility::States Button::AccessibleImpl::CalculateStates()
 {
   auto tmp                                    = DevelControl::AccessibleImpl::CalculateStates();
   tmp[Dali::Accessibility::State::SELECTABLE] = true;
-  auto slf                                    = Toolkit::Button::DownCast(self);
+  auto slf                                    = Toolkit::Button::DownCast(Self());
   tmp[Dali::Accessibility::State::ENABLED]    = !slf.GetProperty<bool>(Toolkit::Button::Property::DISABLED);
   tmp[Dali::Accessibility::State::CHECKED]    = slf.GetProperty<bool>(Toolkit::Button::Property::SELECTED);
   return tmp;
index c01b2f2..8308ce1 100644 (file)
@@ -86,7 +86,7 @@ void CheckBoxButton::OnInitialize()
 Dali::Accessibility::States CheckBoxButton::AccessibleImpl::CalculateStates()
 {
   auto tmp = Button::AccessibleImpl::CalculateStates();
-  auto slf = Toolkit::Button::DownCast(self);
+  auto slf = Toolkit::Button::DownCast(Self());
   if(slf.GetProperty<bool>(Toolkit::Button::Property::SELECTED))
     tmp[Dali::Accessibility::State::CHECKED] = true;
   return tmp;
index ee9f9f1..2dc4385 100644 (file)
@@ -197,7 +197,7 @@ Property::Value PushButton::GetProperty(BaseObject* object, Property::Index prop
 Dali::Accessibility::States PushButton::AccessibleImpl::CalculateStates()
 {
   auto tmp                                 = Button::AccessibleImpl::CalculateStates();
-  auto slf                                 = Toolkit::Button::DownCast(self);
+  auto slf                                 = Toolkit::Button::DownCast(Self());
   tmp[Dali::Accessibility::State::PRESSED] = slf.GetProperty<bool>(Toolkit::Button::Property::SELECTED);
   return tmp;
 }
index aae430b..f17a8c9 100644 (file)
@@ -115,7 +115,7 @@ void RadioButton::OnStateChange(State newState)
 Dali::Accessibility::States RadioButton::AccessibleImpl::CalculateStates()
 {
   auto tmp = Button::AccessibleImpl::CalculateStates();
-  auto slf = Toolkit::Button::DownCast(self);
+  auto slf = Toolkit::Button::DownCast(Self());
   if(slf.GetProperty<bool>(Toolkit::Button::Property::SELECTED))
     tmp[Dali::Accessibility::State::CHECKED] = true;
   tmp[Dali::Accessibility::State::SELECTABLE] = true;
index 8ec931f..311f6b3 100644 (file)
@@ -375,7 +375,7 @@ void ToggleButton::OnPressed()
 Dali::Accessibility::States ToggleButton::AccessibleImpl::CalculateStates()
 {
   auto states = Button::AccessibleImpl::CalculateStates();
-  auto button = Toolkit::ToggleButton::DownCast(self);
+  auto button = Toolkit::ToggleButton::DownCast(Self());
   if(button.GetProperty<int>(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX))
     states[Dali::Accessibility::State::CHECKED] = true;
   return states;
@@ -383,7 +383,7 @@ Dali::Accessibility::States ToggleButton::AccessibleImpl::CalculateStates()
 
 std::string ToggleButton::AccessibleImpl::GetDescriptionRaw()
 {
-  auto button   = Toolkit::ToggleButton::DownCast(self);
+  auto button   = Toolkit::ToggleButton::DownCast(Self());
   auto index    = button.GetProperty<int>(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX);
   auto tooltips = button.GetProperty<Property::Array>(Toolkit::ToggleButton::Property::TOOLTIPS);
 
index 1c48bc1..070fa82 100644 (file)
@@ -487,7 +487,7 @@ Control::Impl::~Impl()
     StopObservingVisual(iter->visual);
   }
 
-  AccessibilityDeregister();
+  AccessibilityDeregister(false);
   // All gesture detectors will be destroyed so no need to disconnect.
   delete mStartingPinchScale;
 
@@ -1942,12 +1942,32 @@ void Control::Impl::AccessibilityRegister()
   }
 }
 
-void Control::Impl::AccessibilityDeregister()
+void Control::Impl::AccessibilityDeregister(bool remove)
 {
   if(accessibilityNotificationSet)
   {
+    accessibilityNotificationPosition.NotifySignal().Disconnect(&Control::Impl::PositionOrSizeChangedCallback);
+    if(remove)
+    {
+      mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationPosition);
+    }
+    accessibilityNotificationPosition.Reset();
     accessibilityNotificationPosition = {};
+
+    accessibilityNotificationSize.NotifySignal().Disconnect(&Control::Impl::PositionOrSizeChangedCallback);
+    if(remove)
+    {
+      mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationSize);
+    }
+    accessibilityNotificationSize.Reset();
     accessibilityNotificationSize     = {};
+
+    accessibilityNotificationCulled.NotifySignal().Disconnect(&Control::Impl::CulledChangedCallback);
+    if(remove)
+    {
+      mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationCulled);
+    }
+    accessibilityNotificationCulled.Reset();
     accessibilityNotificationCulled   = {};
     accessibilityNotificationSet      = false;
   }
index 492461e..a3ab6c0 100644 (file)
@@ -544,7 +544,7 @@ public:
   Dali::Accessibility::Accessible*        GetAccessibilityObject();
 
   void AccessibilityRegister();
-  void AccessibilityDeregister();
+  void AccessibilityDeregister(bool remove);
 
   std::function<std::unique_ptr<Dali::Accessibility::Accessible>(Actor)> accessibilityConstructor;
   std::unique_ptr<Dali::Accessibility::Accessible>                       accessibilityObject;
index edb0929..cc65de9 100644 (file)
@@ -2004,7 +2004,7 @@ void Popup::SetupTouch()
 
 std::string Popup::AccessibleImpl::GetNameRaw()
 {
-  auto        popup = Toolkit::Popup::DownCast(self);
+  auto        popup = Toolkit::Popup::DownCast(Self());
   std::string title;
   Actor       popupTitle = popup.GetTitle();
   if(popupTitle)
@@ -2027,7 +2027,7 @@ std::string Popup::AccessibleImpl::GetNameRaw()
 Dali::Accessibility::States Popup::AccessibleImpl::CalculateStates()
 {
   auto states       = DevelControl::AccessibleImpl::CalculateStates();
-  auto popup        = Toolkit::Popup::DownCast(self);
+  auto popup        = Toolkit::Popup::DownCast(Self());
   auto displayState = popup.GetProperty<std::string>(Toolkit::Popup::Property::DISPLAY_STATE);
 
   states[Dali::Accessibility::State::SHOWING] = (displayState == "SHOWN" || displayState == "SHOWING");
index 2df2b77..48dfaad 100644 (file)
@@ -683,7 +683,7 @@ double ProgressBar::AccessibleImpl::GetMinimum()
 
 double ProgressBar::AccessibleImpl::GetCurrent()
 {
-  auto p = Toolkit::ProgressBar::DownCast(self);
+  auto p = Toolkit::ProgressBar::DownCast(Self());
   return p.GetProperty(Toolkit::ProgressBar::Property::PROGRESS_VALUE)
     .Get<float>();
 }
@@ -697,7 +697,7 @@ bool ProgressBar::AccessibleImpl::SetCurrent(double current)
 {
   if(current < GetMinimum() || current > GetMaximum())
     return false;
-  auto p = Toolkit::ProgressBar::DownCast(self);
+  auto p = Toolkit::ProgressBar::DownCast(Self());
   p.SetProperty(Toolkit::ProgressBar::Property::PROGRESS_VALUE,
                 static_cast<float>(current));
   return true;
index 5716c5e..fcf0b91 100644 (file)
@@ -863,21 +863,21 @@ Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
 
 double ScrollBar::AccessibleImpl::GetMinimum()
 {
-  auto   p                = Toolkit::ScrollBar::DownCast(self);
+  auto   p                = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(p).mPropertyMinScrollPosition) : 0.0f;
 }
 
 double ScrollBar::AccessibleImpl::GetCurrent()
 {
-  auto   p                = Toolkit::ScrollBar::DownCast(self);
+  auto   p                = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(p).mPropertyScrollPosition) : 0.0f;
 }
 
 double ScrollBar::AccessibleImpl::GetMaximum()
 {
-  auto   p                = Toolkit::ScrollBar::DownCast(self);
+  auto   p                = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(p).mPropertyMaxScrollPosition) : 1.0f;
 }
@@ -889,7 +889,7 @@ bool ScrollBar::AccessibleImpl::SetCurrent(double current)
 
   auto value_before = GetCurrent();
 
-  auto   p                = Toolkit::ScrollBar::DownCast(self);
+  auto   p                = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle();
   if(!scrollableHandle)
     return false;
index 699aee4..ecc25b2 100644 (file)
@@ -1348,7 +1348,7 @@ void ItemView::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
 void ItemView::AccessibleImpl::EnsureChildVisible(Actor child)
 {
   EnsureSelfVisible();
-  auto itemView = Dali::Toolkit::ItemView::DownCast(self);
+  auto itemView = Dali::Toolkit::ItemView::DownCast(Self());
   Toolkit::GetImpl(itemView).OnKeyboardFocusChangeCommitted(child);
 }
 
index a318c6d..ac062ff 100644 (file)
@@ -1825,7 +1825,7 @@ Toolkit::ScrollView::SnapStartedSignalType& ScrollView::SnapStartedSignal()
 
 void ScrollView::AccessibleImpl::EnsureChildVisible(Actor child)
 {
-  auto scrollView = Dali::Toolkit::ScrollView::DownCast(self);
+  auto scrollView = Dali::Toolkit::ScrollView::DownCast(Self());
   scrollView.ScrollTo(child);
 }
 
index 34da9ff..fdbbbd9 100644 (file)
@@ -1413,19 +1413,19 @@ Property::Value Slider::GetProperty(BaseObject* object, Property::Index property
 
 double Slider::AccessibleImpl::GetMinimum()
 {
-  auto p = Toolkit::Slider::DownCast(self);
+  auto p = Toolkit::Slider::DownCast(Self());
   return p.GetProperty(Toolkit::Slider::Property::LOWER_BOUND).Get<float>();
 }
 
 double Slider::AccessibleImpl::GetCurrent()
 {
-  auto p = Toolkit::Slider::DownCast(self);
+  auto p = Toolkit::Slider::DownCast(Self());
   return p.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
 }
 
 double Slider::AccessibleImpl::GetMaximum()
 {
-  auto p = Toolkit::Slider::DownCast(self);
+  auto p = Toolkit::Slider::DownCast(Self());
   return p.GetProperty(Toolkit::Slider::Property::UPPER_BOUND).Get<float>();
 }
 
@@ -1434,7 +1434,7 @@ bool Slider::AccessibleImpl::SetCurrent(double current)
   if(current < GetMinimum() || current > GetMaximum())
     return false;
 
-  auto  p    = Toolkit::Slider::DownCast(self);
+  auto  p    = Toolkit::Slider::DownCast(Self());
   auto& impl = Toolkit::GetImpl(p);
 
   const float prev = p.GetProperty<float>(Toolkit::Slider::Property::VALUE);
@@ -1477,7 +1477,7 @@ bool Slider::AccessibleImpl::SetCurrent(double current)
 
 double Slider::AccessibleImpl::GetMinimumIncrement()
 {
-  auto p = Toolkit::Slider::DownCast(self);
+  auto p = Toolkit::Slider::DownCast(Self());
 
   bool  hasMarks  = !p.GetProperty<Property::Array>(Toolkit::Slider::Property::MARKS).Empty();
   float tolerance = p.GetProperty<float>(Toolkit::Slider::Property::MARK_TOLERANCE);
index 82f6975..7347c00 100644 (file)
@@ -151,6 +151,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "grabHandleColor
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED       )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED)
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
+DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "anchorClicked",      SIGNAL_ANCHOR_CLICKED     )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -1204,6 +1205,11 @@ DevelTextEditor::MaxLengthReachedSignalType& TextEditor::MaxLengthReachedSignal(
   return mMaxLengthReachedSignal;
 }
 
+DevelTextEditor::AnchorClickedSignalType& TextEditor::AnchorClickedSignal()
+{
+  return mAnchorClickedSignal;
+}
+
 Text::ControllerPtr TextEditor::getController()
 {
   return mController;
@@ -1232,6 +1238,14 @@ bool TextEditor::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface*
       editorImpl.MaxLengthReachedSignal().Connect(tracker, functor);
     }
   }
+  else if(0 == strcmp(signalName.c_str(), SIGNAL_ANCHOR_CLICKED))
+  {
+    if(editor)
+    {
+      Internal::TextEditor& editorImpl(GetImpl(editor));
+      editorImpl.AnchorClickedSignal().Connect(tracker, functor);
+    }
+  }
   else
   {
     // signalName does not match any signal
@@ -1260,7 +1274,7 @@ void TextEditor::OnInitialize()
 {
   Actor self = Self();
 
-  mController = Text::Controller::New(this, this, this);
+  mController = Text::Controller::New(this, this, this, this);
 
   mDecorator = Text::Decorator::New(*mController,
                                     *mController);
@@ -1610,6 +1624,7 @@ void TextEditor::OnTap(const TapGesture& gesture)
   padding                   = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
   const Vector2& localPoint = gesture.GetLocalPoint();
   mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top);
+  mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
 
   SetKeyInputFocus();
 }
@@ -1759,6 +1774,12 @@ void TextEditor::InputStyleChanged(Text::InputStyle::Mask inputStyleMask)
   mInputStyleChangedSignal.Emit(handle, editorInputStyleMask);
 }
 
+void TextEditor::AnchorClicked(const std::string& href)
+{
+  Dali::Toolkit::TextEditor handle(GetOwner());
+  mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
+}
+
 void TextEditor::AddDecoration(Actor& actor, bool needsClipping)
 {
   if(actor)
@@ -2036,7 +2057,7 @@ TextEditor::~TextEditor()
 
 std::string TextEditor::AccessibleImpl::GetName()
 {
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   return slf.GetProperty(Toolkit::TextEditor::Property::TEXT)
     .Get<std::string>();
 }
@@ -2047,7 +2068,7 @@ std::string TextEditor::AccessibleImpl::GetText(size_t startOffset,
   if(endOffset <= startOffset)
     return {};
 
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
 
@@ -2059,7 +2080,7 @@ std::string TextEditor::AccessibleImpl::GetText(size_t startOffset,
 
 size_t TextEditor::AccessibleImpl::GetCharacterCount()
 {
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
 
@@ -2068,13 +2089,13 @@ size_t TextEditor::AccessibleImpl::GetCharacterCount()
 
 size_t TextEditor::AccessibleImpl::GetCaretOffset()
 {
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   return Dali::Toolkit::GetImpl(slf).getController()->GetCursorPosition();
 }
 
 bool TextEditor::AccessibleImpl::SetCaretOffset(size_t offset)
 {
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
   if(offset > txt.size())
     return false;
@@ -2088,7 +2109,7 @@ bool TextEditor::AccessibleImpl::SetCaretOffset(size_t offset)
 Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(
   size_t offset, Dali::Accessibility::TextBoundary boundary)
 {
-  auto slf      = Toolkit::TextEditor::DownCast(self);
+  auto slf      = Toolkit::TextEditor::DownCast(Self());
   auto txt      = slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
   auto txt_size = txt.size();
 
@@ -2168,7 +2189,7 @@ TextEditor::AccessibleImpl::GetSelection(size_t selectionNum)
   if(selectionNum > 0)
     return {};
 
-  auto        slf  = Toolkit::TextEditor::DownCast(self);
+  auto        slf  = Toolkit::TextEditor::DownCast(Self());
   auto        ctrl = Dali::Toolkit::GetImpl(slf).getController();
   std::string ret;
   ctrl->RetrieveSelection(ret);
@@ -2183,7 +2204,7 @@ bool TextEditor::AccessibleImpl::RemoveSelection(size_t selectionNum)
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(0, 0);
   return true;
 }
@@ -2196,7 +2217,7 @@ bool TextEditor::AccessibleImpl::SetSelection(size_t selectionNum,
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(startOffset,
                                                             endOffset);
   return true;
@@ -2208,7 +2229,7 @@ bool TextEditor::AccessibleImpl::CopyText(size_t startPosition,
   if(endPosition <= startPosition)
     return false;
 
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
   Dali::Toolkit::GetImpl(slf).getController()->CopyStringToClipboard(txt.substr(startPosition, endPosition - startPosition));
 
@@ -2221,7 +2242,7 @@ bool TextEditor::AccessibleImpl::CutText(size_t startPosition,
   if(endPosition <= startPosition)
     return false;
 
-  auto slf = Toolkit::TextEditor::DownCast(self);
+  auto slf = Toolkit::TextEditor::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
   Dali::Toolkit::GetImpl(slf).getController()->CopyStringToClipboard(txt.substr(startPosition, endPosition - startPosition));
 
index a8b9a0c..d0609b6 100644 (file)
@@ -31,6 +31,7 @@
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
+#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
@@ -48,7 +49,7 @@ namespace Internal
 /**
  * @brief A control which renders a long text string with styles.
  */
-class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface, public Text::SelectableControlInterface
+class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface, public Text::SelectableControlInterface, public Text::AnchorControlInterface
 {
 public:
   /**
@@ -87,6 +88,11 @@ public:
   DevelTextEditor::MaxLengthReachedSignalType& MaxLengthReachedSignal();
 
   /**
+   * @copydoc Dali::Toollkit::TextEditor::AnchorClickedSignal()
+   */
+  DevelTextEditor::AnchorClickedSignalType& AnchorClickedSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -276,7 +282,15 @@ public:
   /**
    * @copydoc Text::EditableControlInterface::SetEditable()
    */
-  void                SetEditable(bool editable) override;
+  void SetEditable(bool editable) override;
+
+  // From AnchorControlInterface
+
+  /**
+   * @copydoc Text::AnchorControlInterface::AnchorClicked()
+   */
+  void AnchorClicked(const std::string& href) override;
+
   Text::ControllerPtr getController();
 
 private: // Implementation
@@ -383,6 +397,7 @@ private: // Data
   Toolkit::TextEditor::InputStyleChangedSignalType     mInputStyleChangedSignal;
   Toolkit::TextEditor::ScrollStateChangedSignalType    mScrollStateChangedSignal;
   Toolkit::DevelTextEditor::MaxLengthReachedSignalType mMaxLengthReachedSignal;
+  Toolkit::DevelTextEditor::AnchorClickedSignalType    mAnchorClickedSignal;
 
   InputMethodContext            mInputMethodContext;
   Text::ControllerPtr           mController;
index d12a708..7fc3eca 100644 (file)
@@ -142,6 +142,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "grabHandleColor"
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged",       SIGNAL_TEXT_CHANGED       )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached",  SIGNAL_MAX_LENGTH_REACHED )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
+DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "anchorClicked",     SIGNAL_ANCHOR_CLICKED     )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -1195,6 +1196,14 @@ bool TextField::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface*
   {
     field.InputStyleChangedSignal().Connect(tracker, functor);
   }
+  else if(0 == strcmp(signalName.c_str(), SIGNAL_ANCHOR_CLICKED))
+  {
+    if(field)
+    {
+      Internal::TextField& fieldImpl(GetImpl(field));
+      fieldImpl.AnchorClickedSignal().Connect(tracker, functor);
+    }
+  }
   else
   {
     // signalName does not match any signal
@@ -1219,11 +1228,16 @@ Toolkit::TextField::InputStyleChangedSignalType& TextField::InputStyleChangedSig
   return mInputStyleChangedSignal;
 }
 
+DevelTextField::AnchorClickedSignalType& TextField::AnchorClickedSignal()
+{
+  return mAnchorClickedSignal;
+}
+
 void TextField::OnInitialize()
 {
   Actor self = Self();
 
-  mController = Text::Controller::New(this, this, this);
+  mController = Text::Controller::New(this, this, this, this);
 
   // When using the vector-based rendering, the size of the GLyphs are different
   TextAbstraction::GlyphType glyphType = (DevelText::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
@@ -1619,6 +1633,7 @@ void TextField::OnTap(const TapGesture& gesture)
   padding                   = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
   const Vector2& localPoint = gesture.GetLocalPoint();
   mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top);
+  mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
 
   SetKeyInputFocus();
 }
@@ -1783,6 +1798,12 @@ void TextField::InputStyleChanged(Text::InputStyle::Mask inputStyleMask)
   mInputStyleChangedSignal.Emit(handle, fieldInputStyleMask);
 }
 
+void TextField::AnchorClicked(const std::string& href)
+{
+  Dali::Toolkit::TextField handle(GetOwner());
+  mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
+}
+
 void TextField::AddDecoration(Actor& actor, bool needsClipping)
 {
   if(actor)
@@ -1918,7 +1939,7 @@ TextField::~TextField()
 
 std::string TextField::AccessibleImpl::GetName()
 {
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   return slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
 }
 
@@ -1928,7 +1949,7 @@ std::string TextField::AccessibleImpl::GetText(size_t startOffset,
   if(endOffset <= startOffset)
     return {};
 
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
 
@@ -1940,7 +1961,7 @@ std::string TextField::AccessibleImpl::GetText(size_t startOffset,
 
 size_t TextField::AccessibleImpl::GetCharacterCount()
 {
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
 
@@ -1949,13 +1970,13 @@ size_t TextField::AccessibleImpl::GetCharacterCount()
 
 size_t TextField::AccessibleImpl::GetCaretOffset()
 {
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   return Dali::Toolkit::GetImpl(slf).getController()->GetCursorPosition();
 }
 
 bool TextField::AccessibleImpl::SetCaretOffset(size_t offset)
 {
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
   if(offset > txt.size())
     return false;
@@ -1969,7 +1990,7 @@ bool TextField::AccessibleImpl::SetCaretOffset(size_t offset)
 Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset(
   size_t offset, Dali::Accessibility::TextBoundary boundary)
 {
-  auto slf      = Toolkit::TextField::DownCast(self);
+  auto slf      = Toolkit::TextField::DownCast(Self());
   auto txt      = slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
   auto txt_size = txt.size();
 
@@ -2049,7 +2070,7 @@ TextField::AccessibleImpl::GetSelection(size_t selectionNum)
   if(selectionNum > 0)
     return {};
 
-  auto        slf  = Toolkit::TextField::DownCast(self);
+  auto        slf  = Toolkit::TextField::DownCast(Self());
   auto        ctrl = Dali::Toolkit::GetImpl(slf).getController();
   std::string ret;
   ctrl->RetrieveSelection(ret);
@@ -2064,7 +2085,7 @@ bool TextField::AccessibleImpl::RemoveSelection(size_t selectionNum)
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(0, 0);
   return true;
 }
@@ -2077,7 +2098,7 @@ bool TextField::AccessibleImpl::SetSelection(size_t selectionNum,
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(startOffset,
                                                             endOffset);
   return true;
@@ -2089,7 +2110,7 @@ bool TextField::AccessibleImpl::CopyText(size_t startPosition,
   if(endPosition <= startPosition)
     return false;
 
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
   Dali::Toolkit::GetImpl(slf).getController()->CopyStringToClipboard(txt.substr(startPosition, endPosition - startPosition));
 
@@ -2102,7 +2123,7 @@ bool TextField::AccessibleImpl::CutText(size_t startPosition,
   if(endPosition <= startPosition)
     return false;
 
-  auto slf = Toolkit::TextField::DownCast(self);
+  auto slf = Toolkit::TextField::DownCast(Self());
   auto txt = slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
   Dali::Toolkit::GetImpl(slf).getController()->CopyStringToClipboard(txt.substr(startPosition, endPosition - startPosition));
 
index 8ddc227..670b81c 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
+#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
@@ -43,7 +45,7 @@ namespace Internal
 /**
  * @brief A control which renders a short text string.
  */
-class TextField : public Control, public Text::ControlInterface, public Text::EditableControlInterface, public Text::SelectableControlInterface
+class TextField : public Control, public Text::ControlInterface, public Text::EditableControlInterface, public Text::SelectableControlInterface, public Text::AnchorControlInterface
 {
 public:
   /**
@@ -102,6 +104,11 @@ public:
    */
   Toolkit::TextField::InputStyleChangedSignalType& InputStyleChangedSignal();
 
+  /**
+   * @copydoc TextField::AnchorClickedSignal()
+   */
+  DevelTextField::AnchorClickedSignalType& AnchorClickedSignal();
+
   Text::ControllerPtr getController();
 
 private: // From Control
@@ -251,6 +258,13 @@ public:
    */
   void SetEditable(bool editable) override;
 
+  // From AnchorControlInterface
+
+  /**
+   * @copydoc Text::AnchorControlInterface::AnchorClicked()
+   */
+  void AnchorClicked(const std::string& href) override;
+
 private: // Implementation
   /**
    * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
@@ -341,9 +355,10 @@ public: // For UTC only
 
 private: // Data
   // Signals
-  Toolkit::TextField::TextChangedSignalType       mTextChangedSignal;
-  Toolkit::TextField::MaxLengthReachedSignalType  mMaxLengthReachedSignal;
-  Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal;
+  Toolkit::TextField::TextChangedSignalType        mTextChangedSignal;
+  Toolkit::TextField::MaxLengthReachedSignalType   mMaxLengthReachedSignal;
+  Toolkit::TextField::InputStyleChangedSignalType  mInputStyleChangedSignal;
+  Toolkit::DevelTextField::AnchorClickedSignalType mAnchorClickedSignal;
 
   InputMethodContext       mInputMethodContext;
   Text::ControllerPtr      mController;
index 3ee507d..1beb1c2 100644 (file)
@@ -139,6 +139,9 @@ DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColo
 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1)
 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColorBlue",  TEXT_COLOR_BLUE,  TEXT_COLOR, 2)
 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColorAlpha", TEXT_COLOR_ALPHA, TEXT_COLOR, 3)
+
+DALI_SIGNAL_REGISTRATION(Toolkit, TextLabel, "anchorClicked", SIGNAL_ANCHOR_CLICKED)
+
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
 
@@ -720,6 +723,35 @@ Property::Value TextLabel::GetProperty(BaseObject* object, Property::Index index
   return value;
 }
 
+bool TextLabel::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
+{
+  Dali::BaseHandle handle(object);
+
+  bool               connected(true);
+  Toolkit::TextLabel label = Toolkit::TextLabel::DownCast(handle);
+
+  if(0 == strcmp(signalName.c_str(), SIGNAL_ANCHOR_CLICKED))
+  {
+    if(label)
+    {
+      Internal::TextLabel& labelImpl(GetImpl(label));
+      labelImpl.AnchorClickedSignal().Connect(tracker, functor);
+    }
+  }
+  else
+  {
+    // signalName does not match any signal
+    connected = false;
+  }
+
+  return connected;
+}
+
+DevelTextLabel::AnchorClickedSignalType& TextLabel::AnchorClickedSignal()
+{
+  return mAnchorClickedSignal;
+}
+
 void TextLabel::OnInitialize()
 {
   Actor self = Self();
@@ -736,6 +768,7 @@ void TextLabel::OnInitialize()
   DALI_ASSERT_DEBUG(mController && "Invalid Text Controller")
 
   mController->SetControlInterface(this);
+  mController->SetAnchorControlInterface(this);
 
   // Use height-for-width negotiation by default
   self.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
@@ -752,6 +785,10 @@ void TextLabel::OnInitialize()
   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
   mController->SetLayoutDirection(layoutDirection);
 
+  // Forward input events to controller
+  EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP));
+  GetTapGestureDetector().SetMaximumTapsRequired(1);
+
   Layout::Engine& engine = mController->GetLayoutEngine();
   engine.SetCursorWidth(0u); // Do not layout space for the cursor.
 
@@ -793,6 +830,23 @@ void TextLabel::OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::T
   Control::OnStyleChange(styleManager, change);
 }
 
+void TextLabel::OnTap(const TapGesture& gesture)
+{
+  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextLabel::OnTap %p\n", mController.Get());
+
+  // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
+  Extents padding;
+  padding                   = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
+  const Vector2& localPoint = gesture.GetLocalPoint();
+  mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
+}
+
+void TextLabel::AnchorClicked(const std::string& href)
+{
+  Dali::Toolkit::TextLabel handle(GetOwner());
+  mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
+}
+
 Vector3 TextLabel::GetNaturalSize()
 {
   Extents padding;
@@ -1003,7 +1057,7 @@ TextLabel::~TextLabel()
 
 std::string TextLabel::AccessibleImpl::GetNameRaw()
 {
-  auto slf = Toolkit::TextLabel::DownCast(self);
+  auto slf = Toolkit::TextLabel::DownCast(Self());
   return slf.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
 }
 
@@ -1018,7 +1072,7 @@ std::string TextLabel::AccessibleImpl::GetText(size_t startOffset,
   if(endOffset <= startOffset)
     return {};
 
-  auto slf = Toolkit::TextLabel::DownCast(self);
+  auto slf = Toolkit::TextLabel::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
 
@@ -1030,7 +1084,7 @@ std::string TextLabel::AccessibleImpl::GetText(size_t startOffset,
 
 size_t TextLabel::AccessibleImpl::GetCharacterCount()
 {
-  auto slf = Toolkit::TextLabel::DownCast(self);
+  auto slf = Toolkit::TextLabel::DownCast(Self());
   auto txt =
     slf.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
 
@@ -1050,7 +1104,7 @@ bool TextLabel::AccessibleImpl::SetCaretOffset(size_t offset)
 Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(
   size_t offset, Dali::Accessibility::TextBoundary boundary)
 {
-  auto slf      = Toolkit::TextLabel::DownCast(self);
+  auto slf      = Toolkit::TextLabel::DownCast(Self());
   auto txt      = slf.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
   auto txt_size = txt.size();
 
@@ -1130,7 +1184,7 @@ TextLabel::AccessibleImpl::GetSelection(size_t selectionNum)
   if(selectionNum > 0)
     return {};
 
-  auto        slf  = Toolkit::TextLabel::DownCast(self);
+  auto        slf  = Toolkit::TextLabel::DownCast(Self());
   auto        ctrl = Dali::Toolkit::GetImpl(slf).getController();
   std::string ret;
   ctrl->RetrieveSelection(ret);
@@ -1145,7 +1199,7 @@ bool TextLabel::AccessibleImpl::RemoveSelection(size_t selectionNum)
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextLabel::DownCast(self);
+  auto slf = Toolkit::TextLabel::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(0, 0);
   return true;
 }
@@ -1158,7 +1212,7 @@ bool TextLabel::AccessibleImpl::SetSelection(size_t selectionNum,
   if(selectionNum > 0)
     return false;
 
-  auto slf = Toolkit::TextLabel::DownCast(self);
+  auto slf = Toolkit::TextLabel::DownCast(Self());
   Dali::Toolkit::GetImpl(slf).getController()->SetSelection(startOffset,
                                                             endOffset);
   return true;
index e9ad7a7..a204be6 100644 (file)
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
+#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
 #include <dali-toolkit/internal/text/text-control-interface.h>
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-scroller-interface.h>
@@ -41,7 +42,7 @@ namespace Internal
 /**
  * @brief A control which renders a short text string.
  */
-class TextLabel : public Control, public Text::ControlInterface, public Text::ScrollerInterface
+class TextLabel : public Control, public Text::ControlInterface, public Text::ScrollerInterface, public Text::AnchorControlInterface
 {
 public:
   /**
@@ -69,6 +70,22 @@ public:
    */
   static Property::Value GetProperty(BaseObject* object, Property::Index index);
 
+  /**
+   * @copydoc Dali::Toollkit::TextLabel::AnchorClickedSignal()
+   */
+  DevelTextLabel::AnchorClickedSignalType& AnchorClickedSignal();
+
+  /**
+   * Connects a callback function with the object's signals.
+   * @param[in] object The object providing the signal.
+   * @param[in] tracker Used to disconnect the signal.
+   * @param[in] signalName The signal to connect to.
+   * @param[in] functor A newly allocated FunctorDelegate.
+   * @return True if the signal was connected.
+   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+   */
+  static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
+
   Text::ControllerPtr getController();
 
 private: // From Control
@@ -88,6 +105,11 @@ private: // From Control
   void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
 
   /**
+   * @copydoc Control::OnTap()
+   */
+  void OnTap(const TapGesture& tap) override;
+
+  /**
    * @copydoc Control::GetNaturalSize()
    */
   Vector3 GetNaturalSize() override;
@@ -115,6 +137,12 @@ private: // from TextScroller
    */
   void ScrollingFinished() override;
 
+public: // From AnchorControlInterface
+  /**
+   * @copydoc Text::AnchorControlInterface::AnchorClicked()
+   */
+  void AnchorClicked(const std::string& href) override;
+
 private: // Implementation
   /**
    * Construct a new TextLabel.
@@ -155,6 +183,9 @@ private: // Data
 
   Toolkit::Visual::Base mVisual;
 
+  // Signals
+  Toolkit::DevelTextLabel::AnchorClickedSignalType mAnchorClickedSignal;
+
   int  mRenderingBackend;
   bool mTextUpdateNeeded : 1;
 
index 4b7ea13..e2d9f91 100644 (file)
@@ -284,7 +284,7 @@ Property::Value TextSelectionPopup::GetProperty(BaseObject* object, Property::In
       case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
       {
         Padding padding = impl.GetOptionDividerPadding();
-        value           = Vector4(padding.x, padding.y, padding.top, padding.bottom);
+        value           = Vector4(padding.left, padding.right, padding.top, padding.bottom);
         break;
       }
       case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
@@ -643,8 +643,8 @@ std::string TextSelectionPopup::GetPressedImage() const
 
 void TextSelectionPopup::SetOptionDividerPadding(const Padding& padding)
 {
-  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextSelectionPopup::SetOptionDividerPadding padding(%f,%f,%f,%f)\n", padding.left, padding.right, padding.bottom, padding.top);
-  mOptionDividerPadding = Padding(padding.left, padding.right, padding.bottom, padding.top);
+  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextSelectionPopup::SetOptionDividerPadding padding(%f,%f,%f,%f)\n", padding.left, padding.right, padding.top, padding.bottom);
+  mOptionDividerPadding = Padding(padding.left, padding.right, padding.top, padding.bottom);
 }
 
 Padding TextSelectionPopup::GetOptionDividerPadding() const
index 74e498b..6a3af8d 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
 #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/devel-api/adaptor-framework/web-engine-request-interceptor.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/devel-api/common/stage.h>
@@ -39,7 +47,6 @@
 #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>
@@ -80,15 +87,22 @@ DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "pageZoomFactor",          FLOAT,
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "textZoomFactor",          FLOAT,   TEXT_ZOOM_FACTOR          )
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "loadProgressPercentage",  FLOAT,   LOAD_PROGRESS_PERCENTAGE  )
 
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted",    PAGE_LOAD_STARTED_SIGNAL    )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress", PAGE_LOAD_IN_PROGRESS_SIGNAL)
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished",   PAGE_LOAD_FINISHED_SIGNAL   )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError",      PAGE_LOAD_ERROR_SIGNAL      )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached",  SCROLL_EDGE_REACHED_SIGNAL  )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged",         URL_CHANGED_SIGNAL          )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "formRepostDecision", FORM_REPOST_DECISION_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "frameRendered",      FRAME_RENDERED_SIGNAL       )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor", REQUEST_INTERCEPTOR_SIGNAL  )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted",         PAGE_LOAD_STARTED_SIGNAL         )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress",      PAGE_LOAD_IN_PROGRESS_SIGNAL     )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished",        PAGE_LOAD_FINISHED_SIGNAL        )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError",           PAGE_LOAD_ERROR_SIGNAL           )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached",       SCROLL_EDGE_REACHED_SIGNAL       )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged",              URL_CHANGED_SIGNAL               )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "formRepostDecision",      FORM_REPOST_DECISION_SIGNAL      )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "frameRendered",           FRAME_RENDERED_SIGNAL            )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor",      REQUEST_INTERCEPTOR_SIGNAL       )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "consoleMessage",          CONSOLE_MESSAGE_SIGNAL           )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "policyDecision",          POLICY_DECISION                  )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "certificateConfirm",      CERTIFICATE_CONFIRM_SIGNAL       )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "sslCertificateChanged",   SSL_CERTIFICATE_CHANGED_SIGNAL   )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "httpAuthRequest",         HTTP_AUTH_REQUEST_SIGNAL         )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuCustomized",   CONTEXT_MENU_CUSTOMIZED_SIGNAL   )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuItemSelected", CONTEXT_MENU_ITEM_SELECTED_SIGNAL)
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -113,8 +127,8 @@ WebView::WebView(const std::string& locale, const std::string& timezoneId)
   mPageLoadFinishedSignal(),
   mPageLoadErrorSignal(),
   mUrlChangedSignal(),
-  mVideoHoleEnabled(true),
   mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+  mVideoHoleEnabled(true),
   mMouseEventsEnabled(true),
   mKeyEventsEnabled(true)
 {
@@ -127,7 +141,7 @@ WebView::WebView(const std::string& locale, const std::string& timezoneId)
   }
 }
 
-WebView::WebView(int argc, char** argv)
+WebView::WebView(uint32_t argc, char** argv)
 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
   mUrl(),
   mVisual(),
@@ -137,8 +151,8 @@ WebView::WebView(int argc, char** argv)
   mPageLoadFinishedSignal(),
   mPageLoadErrorSignal(),
   mUrlChangedSignal(),
-  mVideoHoleEnabled(true),
   mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+  mVideoHoleEnabled(true),
   mMouseEventsEnabled(true),
   mKeyEventsEnabled(true)
 {
@@ -182,7 +196,7 @@ Toolkit::WebView WebView::New(const std::string& locale, const std::string& time
   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);
@@ -219,6 +233,13 @@ void WebView::OnInitialize()
     mWebEngine.FormRepostDecisionSignal().Connect(this, &WebView::OnFormRepostDecision);
     mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnFrameRendered);
     mWebEngine.RequestInterceptorSignal().Connect(this, &WebView::OnInterceptRequest);
+    mWebEngine.ConsoleMessageSignal().Connect(this, &WebView::OnConsoleMessage);
+    mWebEngine.PolicyDecisionSignal().Connect(this, &WebView::OnPolicyDecisionRequest);
+    mWebEngine.CertificateConfirmSignal().Connect(this, &WebView::OnCertificateConfirm);
+    mWebEngine.SslCertificateChangedSignal().Connect(this, &WebView::OnSslCertificateChanged);
+    mWebEngine.HttpAuthHandlerSignal().Connect(this, &WebView::OnHttpAuthenticationRequest);
+    mWebEngine.ContextMenuCustomizedSignal().Connect(this, &WebView::OnContextMenuCustomized);
+    mWebEngine.ContextMenuItemSelectedSignal().Connect(this, &WebView::OnContextMenuItemSelected);
 
     mWebContext         = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
     mWebCookieManager   = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
@@ -428,7 +449,7 @@ bool WebView::StopInspectorServer()
   return mWebEngine ? mWebEngine.StopInspectorServer() : false;
 }
 
-void WebView::ScrollBy(int deltaX, int deltaY)
+void WebView::ScrollBy(int32_t deltaX, int32_t deltaY)
 {
   if(mWebEngine)
   {
@@ -436,7 +457,7 @@ void WebView::ScrollBy(int deltaX, int deltaY)
   }
 }
 
-bool WebView::ScrollEdgeBy(int deltaX, int deltaY)
+bool WebView::ScrollEdgeBy(int32_t deltaX, int32_t deltaY)
 {
   return mWebEngine ? mWebEngine.ScrollEdgeBy(deltaX, deltaY) : false;
 }
@@ -531,6 +552,27 @@ void WebView::JavaScriptPromptReply(const std::string& result)
   }
 }
 
+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)
@@ -581,7 +623,7 @@ void WebView::AddDynamicCertificatePath(const std::string& host, const std::stri
   }
 }
 
-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)
@@ -592,7 +634,7 @@ Dali::Toolkit::ImageView WebView::GetScreenshot(Dali::Rect<int> viewArea, float
   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;
@@ -623,7 +665,7 @@ void WebView::UpdateDisplayArea(Dali::PropertyNotification& /*source*/)
   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;
@@ -717,6 +759,41 @@ Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType& WebView::RequestInt
   return mRequestInterceptorSignal;
 }
 
+Dali::Toolkit::WebView::WebViewConsoleMessageSignalType& WebView::ConsoleMessageSignal()
+{
+  return mConsoleMessageSignal;
+}
+
+Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType& WebView::PolicyDecisionSignal()
+{
+  return mPolicyDecisionSignal;
+}
+
+Dali::Toolkit::WebView::WebViewCertificateSignalType& WebView::CertificateConfirmSignal()
+{
+  return mCertificateConfirmSignal;
+}
+
+Dali::Toolkit::WebView::WebViewCertificateSignalType& WebView::SslCertificateChangedSignal()
+{
+  return mSslCertificateChangedSignal;
+}
+
+Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandlerSignal()
+{
+  return mHttpAuthHandlerSignal;
+}
+
+Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType& WebView::ContextMenuCustomizedSignal()
+{
+  return mContextMenuCustomizedSignal;
+}
+
+Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType& WebView::ContextMenuItemSelectedSignal()
+{
+  return mContextMenuItemSelectedSignal;
+}
+
 void WebView::OnPageLoadStarted(const std::string& url)
 {
   if(!mPageLoadStartedSignal.Empty())
@@ -744,12 +821,12 @@ void WebView::OnPageLoadFinished(const std::string& url)
   }
 }
 
-void WebView::OnPageLoadError(const std::string& url, int errorCode)
+void WebView::OnPageLoadError(std::shared_ptr<Dali::WebEngineLoadError> error)
 {
   if(!mPageLoadErrorSignal.Empty())
   {
     Dali::Toolkit::WebView handle(GetOwner());
-    mPageLoadErrorSignal.Emit(handle, url, static_cast<Toolkit::WebView::LoadErrorCode>(errorCode));
+    mPageLoadErrorSignal.Emit(handle, std::move(error));
   }
 }
 
@@ -775,9 +852,8 @@ void WebView::OnFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDeci
 {
   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));
   }
 }
 
@@ -816,6 +892,69 @@ void WebView::OnInterceptRequest(std::shared_ptr<Dali::WebEngineRequestIntercept
   }
 }
 
+void WebView::OnConsoleMessage(std::shared_ptr<Dali::WebEngineConsoleMessage> message)
+{
+  if(!mConsoleMessageSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mConsoleMessageSignal.Emit(handle, std::move(message));
+  }
+}
+
+void WebView::OnPolicyDecisionRequest(std::shared_ptr<Dali::WebEnginePolicyDecision> decision)
+{
+  if(!mPolicyDecisionSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mPolicyDecisionSignal.Emit(handle, std::move(decision));
+  }
+}
+
+void WebView::OnCertificateConfirm(std::shared_ptr<Dali::WebEngineCertificate> certificate)
+{
+  if(!mCertificateConfirmSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mCertificateConfirmSignal.Emit(handle, std::move(certificate));
+  }
+}
+
+void WebView::OnSslCertificateChanged(std::shared_ptr<Dali::WebEngineCertificate> certificate)
+{
+  if(!mSslCertificateChangedSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mSslCertificateChangedSignal.Emit(handle, std::move(certificate));
+  }
+}
+
+void WebView::OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler)
+{
+  if(!mHttpAuthHandlerSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mHttpAuthHandlerSignal.Emit(handle, std::move(handler));
+  }
+}
+
+void WebView::OnContextMenuCustomized(std::shared_ptr<Dali::WebEngineContextMenu> menu)
+{
+  if(!mContextMenuCustomizedSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mContextMenuCustomizedSignal.Emit(handle, std::move(menu));
+  }
+}
+
+void WebView::OnContextMenuItemSelected(std::shared_ptr<Dali::WebEngineContextMenuItem> item)
+{
+  if(!mContextMenuItemSelectedSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mContextMenuItemSelectedSignal.Emit(handle, std::move(item));
+  }
+}
+
 bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
 {
   Dali::BaseHandle handle(object);
@@ -868,6 +1007,41 @@ bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tr
     webView.RequestInterceptorSignal().Connect(tracker, functor);
     connected = true;
   }
+  else if(0 == strcmp(signalName.c_str(), CONSOLE_MESSAGE_SIGNAL))
+  {
+    webView.ConsoleMessageSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), POLICY_DECISION))
+  {
+    webView.PolicyDecisionSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), CERTIFICATE_CONFIRM_SIGNAL))
+  {
+    webView.CertificateConfirmSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), SSL_CERTIFICATE_CHANGED_SIGNAL))
+  {
+    webView.SslCertificateChangedSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), HTTP_AUTH_REQUEST_SIGNAL))
+  {
+    webView.HttpAuthHandlerSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_CUSTOMIZED_SIGNAL))
+  {
+    webView.ContextMenuCustomizedSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_ITEM_SELECTED_SIGNAL))
+  {
+    webView.ContextMenuItemSelectedSignal().Connect(tracker, functor);
+    connected = true;
+  }
 
   return connected;
 }
@@ -1123,7 +1297,7 @@ bool WebView::OnKeyEvent(const Dali::KeyEvent& event)
 bool WebView::OnHoverEvent(Actor actor, const Dali::HoverEvent& hover)
 {
   bool result = false;
-  if(mWebEngine)
+  if(mWebEngine && mMouseEventsEnabled)
   {
     result = mWebEngine.SendHoverEvent(hover);
   }
@@ -1133,7 +1307,7 @@ bool WebView::OnHoverEvent(Actor actor, const Dali::HoverEvent& hover)
 bool WebView::OnWheelEvent(Actor actor, const Dali::WheelEvent& wheel)
 {
   bool result = false;
-  if(mWebEngine)
+  if(mWebEngine && mMouseEventsEnabled)
   {
     result = mWebEngine.SendWheelEvent(wheel);
   }
@@ -1160,7 +1334,7 @@ void WebView::OnKeyInputFocusLost()
   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)
   {
index 2630e47..4031ee6 100755 (executable)
@@ -52,7 +52,7 @@ protected:
 
   WebView(const std::string& locale, const std::string& timezoneId);
 
-  WebView(int argc, char** argv);
+  WebView(uint32_t argc, char** argv);
 
   virtual ~WebView();
 
@@ -68,34 +68,32 @@ public:
   static Toolkit::WebView New(const std::string& locale, const std::string& timezoneId);
 
   /**
-   * @copydoc Dali::Toolkit::WebView::New( int, char** )
+   * @copydoc Dali::Toolkit::WebView::New( uint32_t, char** )
    */
-  static Toolkit::WebView New(int argc, char** argv);
+  static Toolkit::WebView New(uint32_t argc, char** argv);
 
   /**
-   * @brief Get settings of WebEngine.
+   * @copydoc Dali::Toolkit::WebView::GetSettings()
    */
   Dali::Toolkit::WebSettings* GetSettings() const;
 
   /**
-   * @brief Get context of WebEngine.
+   * @copydoc Dali::Toolkit::WebView::GetContext()
    */
   Dali::Toolkit::WebContext* GetContext() const;
 
   /**
-   * @brief Get cookie manager of WebEngine.
+   * @copydoc Dali::Toolkit::WebView::GetCookieManager()
    */
   Dali::Toolkit::WebCookieManager* GetCookieManager() const;
 
   /**
-   * @brief Get WebBackForwardList of WebEngine.
+   * @copydoc Dali::Toolkit::WebView::GetBackForwardList()
    */
   Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
 
   /**
-   * @brief Get Favicon of web page.
-   *
-   * @return Handle to a fav icon
+   * @copydoc Dali::Toolkit::WebView::GetFavicon()
    */
   Dali::Toolkit::ImageView& GetFavicon();
 
@@ -177,12 +175,12 @@ public:
   /**
    * @copydoc Dali::Toolkit::WebView::ScrollBy()
    */
-  void ScrollBy(int deltaX, int deltaY);
+  void ScrollBy(int32_t deltaX, int32_t deltaY);
 
   /**
    * @copydoc Dali::WebEngine::ScrollEdgeBy()
    */
-  bool ScrollEdgeBy(int deltaX, int deltaY);
+  bool ScrollEdgeBy(int32_t deltaX, int32_t deltaY);
 
   /**
    * @copydoc Dali::Toolkit::WebView::CanGoForward()
@@ -245,6 +243,16 @@ public:
   void JavaScriptPromptReply(const std::string& result);
 
   /**
+   * @copydoc Dali::Toolkit::WebView::CreateHitTest()
+   */
+  std::unique_ptr<Dali::WebEngineHitTest> CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode);
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::CreateHitTestAsynchronously()
+   */
+  bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback);
+
+  /**
    * @copydoc Dali::Toolkit::WebView::ClearHistory()
    */
   void ClearHistory();
@@ -282,12 +290,12 @@ public:
   /**
    * @copydoc Dali::Toolkit::WebView::GetScreenshot()
    */
-  Dali::Toolkit::ImageView GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor);
+  Dali::Toolkit::ImageView GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor);
 
   /**
    * @copydoc Dali::Toolkit::WebView::GetScreenshotAsynchronously()
    */
-  bool GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback);
+  bool GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback);
 
   /**
    * @copydoc Dali::Toolkit::WebView::CheckVideoPlayingAsynchronously()
@@ -344,6 +352,41 @@ public:
    */
   Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType& RequestInterceptorSignal();
 
+  /**
+   * @copydoc Dali::Toolkit::WebView::ConsoleMessageSignal()
+   */
+  Dali::Toolkit::WebView::WebViewConsoleMessageSignalType& ConsoleMessageSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::PolicyDecisionSignal()
+   */
+  Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType& PolicyDecisionSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::CertificateConfirmSignal()
+   */
+  Dali::Toolkit::WebView::WebViewCertificateSignalType& CertificateConfirmSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::SslCertificateChangedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewCertificateSignalType& SslCertificateChangedSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::HttpAuthHandlerSignal()
+   */
+  Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::ContextMenuCustomizedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::ContextMenuItemSelectedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+
 public: // Properties
   /**
    * @brief Called when a property of an object of this type is set.
@@ -412,68 +455,68 @@ private:
   WebView& operator=(const WebView& webView);
 
   /**
-   * @brief Sets an absolute scroll of the given view.
+   * @brief Set an absolute scroll of the given view.
    * @param[in] x The coordinate x of scroll
    * @param[in] y The coordinate y of scroll
    */
-  void SetScrollPosition(int x, int y);
+  void SetScrollPosition(int32_t x, int32_t y);
 
   /**
-   * @brief Gets the current scroll position of the given view.
+   * @brief Get the current scroll position of the given view.
    * @param[out] x The coordinate x of scroll
    * @param[out] y The coordinate y of scroll
    */
   Dali::Vector2 GetScrollPosition() const;
 
   /**
-   * @brief Gets the possible scroll size of the given view.
+   * @brief Get the possible scroll size of the given view.
    * @param[out] width The width of scroll size
    * @param[out] height The height of scroll size
    */
   Dali::Vector2 GetScrollSize() const;
 
   /**
-   * @brief Gets the last known content's size.
+   * @brief Get the last known content's size.
    * @param[out] width The width of content's size
    * @param[out] height The height of content's size
    */
   Dali::Vector2 GetContentSize() const;
 
   /**
-   * @brief Returns the title of the Web.
+   * @brief Return the title of the Web.
    *
    * @return The title of web page
    */
   std::string GetTitle() const;
 
   /**
-   * @brief Sets the background color of web page.
+   * @brief Set the background color of web page.
    * @param[in] color The value of background color.
    */
   void SetDocumentBackgroundColor(Dali::Vector4 color);
 
   /**
-   * @brief Clears tiles when hidden.
+   * @brief Clear tiles when hidden.
    *
    * @param[in] cleared Whether tiles are cleared or not
    */
   void ClearTilesWhenHidden(bool cleared);
 
   /**
-   * @brief Sets multiplier of cover area of tile.
+   * @brief Set multiplier of cover area of tile.
    *
    * @param[in] multiplier The multiplier of cover area
    */
   void SetTileCoverAreaMultiplier(float multiplier);
 
   /**
-   * @brief Enables cursor by client.
+   * @brief Enable cursor by client.
    * @param[in] enabled Whether cursor is enabled or not.
    */
   void EnableCursorByClient(bool enabled);
 
   /**
-   * @brief Gets the selected text.
+   * @brief Get the selected text.
    * @return The selected text
    */
   std::string GetSelectedText() const;
@@ -491,31 +534,31 @@ private:
   void SetUserAgent(const std::string& userAgent);
 
   /**
-   * @brief Sets zoom factor of the current page.
+   * @brief Set zoom factor of the current page.
    * @param[in] zoomFactor a new factor to be set.
    */
   void SetPageZoomFactor(float zoomFactor);
 
   /**
-   * @brief Queries the current zoom factor of the page。
+   * @brief Query the current zoom factor of the page。
    * @return The current page zoom factor.
    */
   float GetPageZoomFactor() const;
 
   /**
-   * @brief Sets the current text zoom level。.
+   * @brief Set the current text zoom level。.
    * @param[in] zoomFactor a new factor to be set.
    */
   void SetTextZoomFactor(float zoomFactor);
 
   /**
-   * @brief Gets the current text zoom level.
+   * @brief Get the current text zoom level.
    * @return The current text zoom factor.
    */
   float GetTextZoomFactor() const;
 
   /**
-   * @brief Gets the current load progress of the page.
+   * @brief Get the current load progress of the page.
    * @return The load progress of the page.
    */
   float GetLoadProgressPercentage() const;
@@ -529,7 +572,7 @@ private:
   bool SetVisibility(bool visible);
 
   /**
-   * @brief Updates display area of web view.
+   * @brief Update display area of web view.
    * @param[in] source The soource triggers Notification.
    */
   void UpdateDisplayArea(Dali::PropertyNotification& source);
@@ -547,14 +590,14 @@ private:
   void EnableBlendMode(bool blendEnabled);
 
   /**
-   * @brief Enables/disables mouse events. The default is enabled.
+   * @brief Enable/disable mouse events. The default is enabled.
    *
    * @param[in] enabled True if mouse events are enabled, false otherwise
    */
   void EnableMouseEvents(bool enabled);
 
   /**
-   * @brief Enables/disables key events. The default is enabled.
+   * @brief Enable/disable key events. The default is enabled.
    *
    * @param[in] enabled True if key events enabled, false otherwise
    */
@@ -590,11 +633,11 @@ private:
    * @param[in] url The url currently being loaded
    * @param[in] errorCode The error code
    */
-  void OnPageLoadError(const std::string& url, int errorCode);
+  void OnPageLoadError(std::shared_ptr<Dali::WebEngineLoadError> error);
 
   /**
    * @brief Callback function to be called when scroll edge is reached.
-   * @param[in] e The scroll edge reached.
+   * @param[in] edge The scroll edge reached.
    */
   void OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge);
 
@@ -605,7 +648,7 @@ private:
   void OnUrlChanged(const std::string& url);
 
   /**
-   * Signal occurs when the Web View has been touched.
+   * @brief Signal occurs when the Web View has been touched.
    * @param[in] actor The Actor Touched
    * @param[in] touch The Touch Data.
    * @return Whether to consume event or not.
@@ -613,7 +656,7 @@ private:
   bool OnTouchEvent(Actor actor, const Dali::TouchEvent& touch);
 
   /**
-   * Signal occurs when the Web View has been hovered.
+   * @brief Signal occurs when the Web View has been hovered.
    * @param[in] actor The Actor Hovered
    * @param[in] hover The Hover Data.
    * @return Whether to consume event or not.
@@ -621,7 +664,7 @@ private:
   bool OnHoverEvent(Actor actor, const Dali::HoverEvent& hover);
 
   /**
-   * Signal occurs when the Web View receives wheel event.
+   * @brief Signal occurs when the Web View receives wheel event.
    * @param[in] actor The Actor that receives Wheel event.
    * @param[in] wheel The Wheel Data.
    * @return Whether to consume event or not.
@@ -659,21 +702,70 @@ private:
    */
   void OnInterceptRequest(std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor);
 
+  /**
+   * @brief Callback function to be called when console message will be logged.
+   * @param[in] message The message logged.
+   */
+  void OnConsoleMessage(std::shared_ptr<Dali::WebEngineConsoleMessage> message);
+
+  /**
+   * @brief Callback function to be called when policy need be decided.
+   * @param[in] decision The policy decided.
+   */
+  void OnPolicyDecisionRequest(std::shared_ptr<Dali::WebEnginePolicyDecision> decision);
+
+  /**
+   * @brief Callback function to be called when certificate need be confirmed.
+   * @param[in] certificate The certificate policy decision.
+   */
+  void OnCertificateConfirm(std::shared_ptr<Dali::WebEngineCertificate> certificate);
+
+  /**
+   * @brief Callback function to be called when ssl certificate is changed.
+   * @param[in] certificate The certificate information received.
+   */
+  void OnSslCertificateChanged(std::shared_ptr<Dali::WebEngineCertificate> certificate);
+
+  /**
+   * @brief Callback function to be called when http authentication need be confirmed.
+   * @param[in] handler The handler for http authentication
+   */
+  void OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler);
+
+  /**
+   * @brief Callback function to be called when context menu would be customized.
+   * @param[in] e The scroll edge reached.
+   */
+  void OnContextMenuCustomized(std::shared_ptr<Dali::WebEngineContextMenu> menu);
+
+  /**
+   * @brief Callback function to be called when context menu item is selected.
+   * @param[in] url The url currently being loaded
+   */
+  void OnContextMenuItemSelected(std::shared_ptr<Dali::WebEngineContextMenuItem> item);
+
 private:
   std::string                 mUrl;
   Dali::Toolkit::Visual::Base mVisual;
   Dali::Size                  mWebViewSize;
   Dali::WebEngine             mWebEngine;
 
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType           mPageLoadStartedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType           mPageLoadInProgressSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType           mPageLoadFinishedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType      mPageLoadErrorSignal;
-  Dali::Toolkit::WebView::WebViewUrlChangedSignalType         mUrlChangedSignal;
-  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType  mScrollEdgeReachedSignal;
-  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType mFormRepostDecisionSignal;
-  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType      mFrameRenderedSignal;
-  Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType mRequestInterceptorSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadStartedSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadInProgressSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadFinishedSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType           mPageLoadErrorSignal;
+  Dali::Toolkit::WebView::WebViewUrlChangedSignalType              mUrlChangedSignal;
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
+  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType      mFormRepostDecisionSignal;
+  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType           mFrameRenderedSignal;
+  Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType      mRequestInterceptorSignal;
+  Dali::Toolkit::WebView::WebViewConsoleMessageSignalType          mConsoleMessageSignal;
+  Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType          mPolicyDecisionSignal;
+  Dali::Toolkit::WebView::WebViewCertificateSignalType             mCertificateConfirmSignal;
+  Dali::Toolkit::WebView::WebViewCertificateSignalType             mSslCertificateChangedSignal;
+  Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
+  Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
+  Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
 
   std::unique_ptr<Dali::Toolkit::WebContext>         mWebContext;
   std::unique_ptr<Dali::Toolkit::WebCookieManager>   mWebCookieManager;
@@ -685,8 +777,8 @@ private:
   Dali::PropertyNotification mPositionUpdateNotification;
   Dali::PropertyNotification mSizeUpdateNotification;
   Dali::PropertyNotification mScaleUpdateNotification;
+  Dali::Rect<int32_t>        mWebViewArea;
   bool                       mVideoHoleEnabled;
-  Dali::Rect<int>            mWebViewArea;
   bool                       mMouseEventsEnabled;
   bool                       mKeyEventsEnabled;
 
index 4ac8dea..ede26c1 100644 (file)
@@ -134,6 +134,7 @@ SET( toolkit_src_files
    ${toolkit_src_dir}/text/markup-processor.cpp
    ${toolkit_src_dir}/text/markup-processor-color.cpp
    ${toolkit_src_dir}/text/markup-processor-embedded-item.cpp
+   ${toolkit_src_dir}/text/markup-processor-anchor.cpp
    ${toolkit_src_dir}/text/markup-processor-font.cpp
    ${toolkit_src_dir}/text/markup-processor-helper-functions.cpp
    ${toolkit_src_dir}/text/multi-language-support.cpp
index df817b2..a3bb80a 100644 (file)
@@ -1,6 +1,7 @@
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
-INPUT mediump float vCornerRadius;
+INPUT mediump vec2 vOptRectSize;
+INPUT mediump vec4 vCornerRadius;
 
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
@@ -9,20 +10,31 @@ uniform mediump float blurRadius;
 void main()
 {
   OUT_COLOR = vec4(mixColor, 1.0) * uColor;
+  if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
+  {
+    return;
+  }
+
+  mediump float radius =
+  mix(
+    mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
+    mix(vCornerRadius.w, vCornerRadius.z, sign(vPosition.x) * 0.5 + 0.5),
+    sign(vPosition.y) * 0.5 + 0.5
+  );
 
-  mediump vec2 v = abs(vPosition) - vRectSize;
-  mediump float cy = vCornerRadius + blurRadius;
-  mediump float cr = vCornerRadius + blurRadius;
+  mediump vec2 v = abs(vPosition) - vRectSize + radius;
+  mediump float cy = radius + blurRadius;
+  mediump float cr = radius + blurRadius;
 
-  cy = min(cy, min(vRectSize.x, vRectSize.y));
+  cy = min(cy, min(vRectSize.x, vRectSize.y) - radius);
   v = vec2(min(v.x, v.y), max(v.x, v.y));
   v = v + cy;
 
   mediump float blur = 1.0;
   mediump float potential = 0.0;
-  mediump float alias = min(vCornerRadius, 1.0);
-  mediump float potentialMin = cy + vCornerRadius - blurRadius - alias;
-  mediump float potentialMax = cy + vCornerRadius + blurRadius + alias;
+  mediump float alias = min(radius, 1.0);
+  mediump float potentialMin = cy + radius - blurRadius - alias;
+  mediump float potentialMax = cy + radius + blurRadius + alias;
 
   // move center of circles for reduce defact
   mediump float cyDiff = min(cy, 0.2 * blurRadius);
index e20110b..5306aef 100644 (file)
@@ -1,7 +1,8 @@
 INPUT mediump vec2 aPosition;
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
-OUTPUT mediump float vCornerRadius;
+OUTPUT mediump vec2 vOptRectSize;
+OUTPUT mediump vec4 vCornerRadius;
 
 uniform highp mat4 uMvpMatrix;
 uniform highp vec3 uSize;
@@ -14,7 +15,7 @@ uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
 uniform mediump float blurRadius;
-uniform mediump float cornerRadius;
+uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 
 vec4 ComputeVertexPosition()
@@ -24,7 +25,11 @@ vec4 ComputeVertexPosition()
   mediump float minSize = min( visualSize.x, visualSize.y );
   vCornerRadius = mix( cornerRadius * minSize, cornerRadius, cornerRadiusPolicy );
   vCornerRadius = min( vCornerRadius, minSize * 0.5 );
-  vRectSize = visualSize / 2.0 - vec2( vCornerRadius );
+  vRectSize = visualSize / 2.0;
+  // optimize fragment shader
+  mediump float maxRadius = max(max(vCornerRadius.x, vCornerRadius.y), max(vCornerRadius.z, vCornerRadius.w));
+  vOptRectSize = vRectSize - 0.2929 * maxRadius - 1.0 - blurRadius;
+
   vPosition = aPosition * (visualSize + 2.0 * blurRadius);
   return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
 }
index 4654ab4..811dc1d 100644 (file)
@@ -1,6 +1,7 @@
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
-INPUT mediump float vCornerRadius;
+INPUT mediump vec2 vOptRectSize;
+INPUT mediump vec4 vCornerRadius;
 
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
@@ -8,18 +9,29 @@ uniform lowp vec3 mixColor;
 void main()
 {
   OUT_COLOR = vec4(mixColor, 1.0) * uColor;
-  mediump vec2 diff = abs( vPosition ) - vRectSize;
-  mediump float dist = length( max( diff, vec2( 0.0 ) ) ) - vCornerRadius;
-  if( dist > 1.0 )
+  if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
+  {
+    return;
+  }
+  mediump float radius =
+  mix(
+    mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
+    mix(vCornerRadius.w, vCornerRadius.z, sign(vPosition.x) * 0.5 + 0.5),
+    sign(vPosition.y) * 0.5 + 0.5
+  );
+
+  mediump vec2 diff = abs(vPosition) - vRectSize + radius;
+  mediump float dist = length(max(diff, vec2(0.0))) - radius;
+  if(dist > 1.0)
   {
     OUT_COLOR.a = 0.0;
   }
-  else if( dist > -1.0 )
+  else if(dist > -1.0)
   {
-    if( min( diff.x, diff.y ) < 0.0)
+    if(min(diff.x, diff.y) < 0.0)
     {
-      dist += min( diff.x, diff.y ) / vCornerRadius;
+      dist += min(diff.x, diff.y) / max(radius, 1.0);
     }
-    OUT_COLOR.a *= 1.0 - smoothstep( -1.0, 1.0, dist );
+    OUT_COLOR.a *= 1.0 - smoothstep(-1.0, 1.0, dist);
   }
 }
index 33216e5..0a6a257 100644 (file)
@@ -1,7 +1,8 @@
 INPUT mediump vec2 aPosition;
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
-OUTPUT mediump float vCornerRadius;
+OUTPUT mediump vec2 vOptRectSize;
+OUTPUT mediump vec4 vCornerRadius;
 
 uniform highp mat4 uMvpMatrix;
 uniform highp vec3 uSize;
@@ -13,7 +14,7 @@ uniform mediump vec2 extraSize;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-uniform mediump float cornerRadius;
+uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 
 vec4 ComputeVertexPosition()
@@ -23,8 +24,10 @@ vec4 ComputeVertexPosition()
   mediump float minSize = min( visualSize.x, visualSize.y );
   vCornerRadius = mix( cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
   vCornerRadius = min( vCornerRadius, minSize * 0.5 );
-  vRectSize = visualSize / 2.0 - vCornerRadius;
-  vCornerRadius = max( vCornerRadius, 1.0 );
+  vRectSize = visualSize / 2.0;
+  // optimize fragment shader
+  mediump float maxRadius = max(max(vCornerRadius.x, vCornerRadius.y), max(vCornerRadius.z, vCornerRadius.w));
+  vOptRectSize = vRectSize - 0.2929 * maxRadius - 1.0;
   vPosition = aPosition* visualSize;
   return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
 }
index 144fa81..bd08a63 100644 (file)
@@ -5,7 +5,8 @@ uniform mediump mat3 uAlignmentMatrix;
 varying mediump vec2 vTexCoord;
 varying mediump vec2 vPosition;
 varying mediump vec2 vRectSize;
-varying mediump float vCornerRadius;
+varying mediump vec2 vOptRectSize;
+varying mediump vec4 vCornerRadius;
 
 //Visual size and offset
 uniform mediump vec2 offset;
@@ -13,20 +14,22 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-uniform mediump float cornerRadius;
+uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  mediump float minSize = min( visualSize.x, visualSize.y );
-  vCornerRadius = mix( cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
-  vCornerRadius = min( vCornerRadius, minSize * 0.5 );
-  vRectSize = visualSize * 0.5 - vCornerRadius;
-  vCornerRadius = max( vCornerRadius, 1.0 );
+  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw);
+  vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy);
+  mediump float minSize = min(visualSize.x, visualSize.y);
+  vCornerRadius = mix(cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
+  vCornerRadius = min(vCornerRadius, minSize * 0.5);
+  vRectSize = visualSize * 0.5;
+  // Optimize fragment shader
+  mediump float maxRadius = max(max(vCornerRadius.x, vCornerRadius.y), max(vCornerRadius.z, vCornerRadius.w));
+  vOptRectSize = vRectSize - 0.2929 * maxRadius - 1.0;
   vPosition = aPosition * visualSize;
-  return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  return vec4((aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0);
 }
 
 void main()
index 548367c..1b29ae0 100644 (file)
@@ -4,23 +4,35 @@ uniform lowp vec3 mixColor;
 varying mediump vec2 vTexCoord;
 varying mediump vec2 vPosition;
 varying mediump vec2 vRectSize;
-varying mediump float vCornerRadius;
+varying mediump vec2 vOptRectSize;
+varying mediump vec4 vCornerRadius;
 
 void main()
 {
   gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor, 1.0) * uColor;
-  mediump vec2 diff = abs( vPosition ) - vRectSize;
-  mediump float dist = length( max( diff, vec2( 0.0 ) ) ) - vCornerRadius;
-  if( dist > 1.0 )
+  if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
-    gl_FragColor = vec4( 0.0 );
+    return;
   }
-  else if( dist > -1.0 )
+  mediump float radius =
+  mix(
+    mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
+    mix(vCornerRadius.w, vCornerRadius.z, sign(vPosition.x) * 0.5 + 0.5),
+    sign(vPosition.y) * 0.5 + 0.5
+  );
+
+  mediump vec2 diff = abs(vPosition) - vRectSize + radius;
+  mediump float dist = length(max(diff, vec2(0.0))) - radius;
+  if(dist > 1.0)
+  {
+    gl_FragColor = vec4(0.0);
+  }
+  else if(dist > -1.0)
   {
-    if( min( diff.x, diff.y ) < 0.0 )
+    if(min(diff.x, diff.y) < 0.0)
     {
-      dist += min( diff.x, diff.y ) / vCornerRadius;
+      dist += min(diff.x, diff.y) / max(radius, 1.0);
     }
-    gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );
+    gl_FragColor *= 1.0 - smoothstep(-1.0, 1.0, dist);
   }
 }
index 10bf0fe..68df0c5 100644 (file)
@@ -4,23 +4,35 @@ uniform lowp vec3 mixColor;
 varying mediump vec2 vTexCoord;
 varying mediump vec2 vPosition;
 varying mediump vec2 vRectSize;
-varying mediump float vCornerRadius;
+varying mediump vec2 vOptRectSize;
+varying mediump vec4 vCornerRadius;
 
 void main()
 {
   gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor, 1.0) * uColor;
-  mediump vec2 diff = abs( vPosition ) - vRectSize;
-  mediump float dist = length( max( diff, vec2( 0.0 ) ) ) - vCornerRadius;
-  if( dist > 1.0 )
+  if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
-    gl_FragColor = vec4( 0.0 );
+    return;
   }
-  else if( dist > -1.0 )
+  mediump float radius =
+  mix(
+    mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
+    mix(vCornerRadius.w, vCornerRadius.z, sign(vPosition.x) * 0.5 + 0.5),
+    sign(vPosition.y) * 0.5 + 0.5
+  );
+
+  mediump vec2 diff = abs(vPosition) - vRectSize + radius;
+  mediump float dist = length(max(diff, vec2(0.0))) - radius;
+  if(dist > 1.0)
+  {
+    gl_FragColor = vec4(0.0);
+  }
+  else if(dist > -1.0)
   {
-    if( min( diff.x, diff.y ) < 0.0)
+    if(min(diff.x, diff.y) < 0.0)
     {
-      dist += min( diff.x, diff.y ) / vCornerRadius;
+      dist += min(diff.x, diff.y) / max(radius, 1.0);
     }
-    gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );
+    gl_FragColor *= 1.0 - smoothstep(-1.0, 1.0, dist);
   }
 }
index f383185..23ded26 100644 (file)
@@ -5,7 +5,8 @@ uniform mediump mat3 uAlignmentMatrix;
 varying mediump vec2 vTexCoord;
 varying mediump vec2 vPosition;
 varying mediump vec2 vRectSize;
-varying mediump float vCornerRadius;
+varying mediump vec2 vOptRectSize;
+varying mediump vec4 vCornerRadius;
 
 //Visual size and offset
 uniform mediump vec2 offset;
@@ -13,20 +14,23 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-uniform mediump float cornerRadius;
+uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  mediump float minSize = min( visualSize.x, visualSize.y );
-  vCornerRadius = mix( cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
-  vCornerRadius = min( vCornerRadius, minSize * 0.5 );
-  vRectSize = visualSize * 0.5 - vCornerRadius;
-  vCornerRadius = max( vCornerRadius, 1.0 );
+  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw);
+  vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy);
+  mediump float minSize = min(visualSize.x, visualSize.y);
+  vCornerRadius = mix(cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
+  vCornerRadius = min(vCornerRadius, minSize * 0.5);
+  vRectSize = visualSize * 0.5;
+  // Optimze fragment shader
+  mediump float maxRadius = max(max(vCornerRadius.x, vCornerRadius.y), max(vCornerRadius.z, vCornerRadius.w));
+  vOptRectSize = vRectSize - 0.2929 * maxRadius - 1.0;
+  vCornerRadius = max(vCornerRadius, 1.0);
   vPosition = aPosition * visualSize;
-  return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  return vec4((aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0);
 }
 
 void main()
index 0e2c1d8..6eacb93 100644 (file)
@@ -1,7 +1,8 @@
 INPUT mediump vec2 vTexCoord;
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
-INPUT mediump float vCornerRadius;
+INPUT mediump vec2 vOptRectSize;
+INPUT mediump vec4 vCornerRadius;
 
 uniform sampler2D sTexture;
 uniform lowp vec4 uColor;
@@ -10,23 +11,35 @@ uniform lowp float preMultipliedAlpha;
 
 void main()
 {
-  mediump vec2 diff = abs( vPosition ) - vRectSize;
-  mediump float dist = length( max( diff, vec2( 0.0 ) ) ) - vCornerRadius;
+  if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
+  {
+    OUT_COLOR = TEXTURE(sTexture, vTexCoord) * uColor * vec4(mixColor, 1.0);
+    return;
+  }
+  mediump float radius =
+  mix(
+    mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
+    mix(vCornerRadius.w, vCornerRadius.z, sign(vPosition.x) * 0.5 + 0.5),
+    sign(vPosition.y) * 0.5 + 0.5
+  );
+
+  mediump vec2 diff = abs(vPosition) - vRectSize + radius;
+  mediump float dist = length(max(diff, vec2(0.0))) - radius;
   mediump float opacity = 1.0;
-  if( dist > 1.0 )
+  if(dist > 1.0)
   {
     opacity = 0.0;
   }
-  else if( dist > -1.0 )
+  else if(dist > -1.0)
   {
-    if( min( diff.x, diff.y ) < 0.0 )
+    if(min(diff.x, diff.y) < 0.0)
     {
-      dist += min( diff.x, diff.y ) / vCornerRadius;
+      dist += min(diff.x, diff.y) / max(radius, 1.0);
     }
-    opacity = 1.0 - smoothstep( -1.0, 1.0, dist );
+    opacity = 1.0 - smoothstep(-1.0, 1.0, dist);
   }
 
-  OUT_COLOR = TEXTURE( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );
+  OUT_COLOR = TEXTURE(sTexture, vTexCoord) * uColor * vec4(mixColor, 1.0);
   OUT_COLOR.a *= opacity;
-  OUT_COLOR.rgb *= mix( 1.0, opacity, preMultipliedAlpha );
+  OUT_COLOR.rgb *= mix(1.0, opacity, preMultipliedAlpha);
 }
index 0bd3530..c35b1b6 100644 (file)
@@ -2,7 +2,8 @@ INPUT mediump vec2 aPosition;
 OUTPUT mediump vec2 vTexCoord;
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
-OUTPUT mediump float vCornerRadius;
+OUTPUT mediump vec2 vOptRectSize;
+OUTPUT mediump vec4 vCornerRadius;
 
 uniform highp mat4 uMvpMatrix;
 uniform highp vec3 uSize;
@@ -14,25 +15,27 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-uniform mediump float cornerRadius;
+uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 uniform mediump vec2 extraSize;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize;
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  mediump float minSize = min( visualSize.x, visualSize.y );
-  vCornerRadius = mix( cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
-  vCornerRadius = min( vCornerRadius, minSize * 0.5 );
-  vRectSize = visualSize * 0.5 - vCornerRadius;
-  vCornerRadius = max( vCornerRadius, 1.0 );
+  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw) + extraSize;
+  vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy);
+  mediump float minSize = min(visualSize.x, visualSize.y);
+  vCornerRadius = mix(cornerRadius * minSize, cornerRadius, cornerRadiusPolicy);
+  vCornerRadius = min(vCornerRadius, minSize * 0.5);
+  vRectSize = visualSize * 0.5;
+  // Optimize fragment shader
+  mediump float maxRadius = max(max(vCornerRadius.x, vCornerRadius.y), max(vCornerRadius.z, vCornerRadius.w));
+  vOptRectSize = vRectSize - 0.2929 * maxRadius - 1.0;
   vPosition = aPosition* visualSize;
-  return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  return vec4(vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0);
 }
 
 void main()
 {
   gl_Position = uMvpMatrix * ComputeVertexPosition();
-  vTexCoord = pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5) );
+  vTexCoord = pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5));
 }
diff --git a/dali-toolkit/internal/text/anchor.h b/dali-toolkit/internal/text/anchor.h
new file mode 100644 (file)
index 0000000..d2c7384
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef DALI_TOOLKIT_TEXT_ANCHOR_H
+#define DALI_TOOLKIT_TEXT_ANCHOR_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/text-definitions.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+/**
+ * @brief An anchor within the text.
+ */
+struct Anchor
+{
+  CharacterIndex startIndex; ///< The character's start index of the anchor within the string.
+  CharacterIndex endIndex;   ///< The character's end index of the anchor within the string.
+  char*          href;       ///< The url path
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_ANCHOR_H
\ No newline at end of file
index 8ecab1f..12929fc 100644 (file)
@@ -55,6 +55,16 @@ void FreeEmbeddedItems(Vector<EmbeddedItem>& embeddedItem)
   embeddedItem.Clear();
 }
 
+void FreeAnchors(Vector<Anchor>& anchors)
+{
+  for(auto&& anchor : anchors)
+  {
+    delete[] anchor.href;
+  }
+
+  anchors.Clear();
+}
+
 LogicalModelPtr LogicalModel::New()
 {
   return LogicalModelPtr(new LogicalModel());
@@ -573,6 +583,11 @@ void LogicalModel::ClearEmbeddedImages()
   FreeEmbeddedItems(mEmbeddedItems);
 }
 
+void LogicalModel::ClearAnchors()
+{
+  FreeAnchors(mAnchors);
+}
+
 LogicalModel::~LogicalModel()
 {
   ClearFontDescriptionRuns();
index 4702c38..921d911 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/object/ref-object.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/anchor.h>
 #include <dali-toolkit/internal/text/bidirectional-line-info-run.h>
 #include <dali-toolkit/internal/text/bidirectional-paragraph-info-run.h>
 #include <dali-toolkit/internal/text/color-run.h>
@@ -181,6 +182,11 @@ public:
    */
   void ClearEmbeddedImages();
 
+  /**
+   * @brief Clears the anchors.
+   */
+  void ClearAnchors();
+
 protected:
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -212,6 +218,7 @@ public:
   Vector<CharacterDirection>            mCharacterDirections; ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ).
   Vector<BidirectionalLineInfoRun>      mBidirectionalLineInfo;
   Vector<EmbeddedItem>                  mEmbeddedItems;
+  Vector<Anchor>                        mAnchors;
 
   BidirectionalLineRunIndex mBidirectionalLineIndex; ///< The last fetched bidirectional line info.
 };
diff --git a/dali-toolkit/internal/text/markup-processor-anchor.cpp b/dali-toolkit/internal/text/markup-processor-anchor.cpp
new file mode 100644 (file)
index 0000000..4c4bb29
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// FILE HEADER
+#include <dali-toolkit/internal/text/markup-processor-anchor.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <memory.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/anchor.h>
+#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace
+{
+const std::string XHTML_HREF_ATTRIBUTE("href");
+} // namespace
+
+void ProcessAnchor(const Tag& tag, Anchor& anchor)
+{
+  anchor.href = nullptr;
+
+  for(auto&& attribute : tag.attributes)
+  {
+    if(TokenComparison(XHTML_HREF_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength))
+    {
+      Length hrefLength = attribute.valueLength + 1;
+      anchor.href       = new char[hrefLength];
+      memcpy(anchor.href, attribute.valueBuffer, hrefLength);
+      anchor.href[hrefLength - 1] = '\0';
+      // The memory is freed when the font run is removed from the logical model.
+    }
+  }
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
diff --git a/dali-toolkit/internal/text/markup-processor-anchor.h b/dali-toolkit/internal/text/markup-processor-anchor.h
new file mode 100644 (file)
index 0000000..7c1d181
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_ANCHOR_H
+#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_ANCHOR_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+struct Tag;
+struct Anchor;
+
+/**
+ * @brief Retrieves the @e anchor from the @p tag.
+ *
+ * @param[in] tag The anchor tag and its attributes.
+ * @param[in,out] anchor The anchor.
+ */
+void ProcessAnchor( const Tag& tag, Anchor& anchor );
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_ANCHOR_H
\ No newline at end of file
index 20a5825..a8a6ecc 100644 (file)
@@ -25,6 +25,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/character-set-conversion.h>
+#include <dali-toolkit/internal/text/markup-processor-anchor.h>
 #include <dali-toolkit/internal/text/markup-processor-color.h>
 #include <dali-toolkit/internal/text/markup-processor-embedded-item.h>
 #include <dali-toolkit/internal/text/markup-processor-font.h>
@@ -51,6 +52,7 @@ const std::string XHTML_SHADOW_TAG("shadow");
 const std::string XHTML_GLOW_TAG("glow");
 const std::string XHTML_OUTLINE_TAG("outline");
 const std::string XHTML_ITEM_TAG("item");
+const std::string XHTML_ANCHOR_TAG("a");
 
 const char LESS_THAN      = '<';
 const char GREATER_THAN   = '>';
@@ -580,6 +582,38 @@ void ProcessItemTag(
 }
 
 /**
+ * @brief Processes the anchor tag
+ *
+ * @param[in/out] markupProcessData The markup process data
+ * @param[in] tag The current tag
+ * @param[in/out] characterIndex The current character index
+ */
+void ProcessAnchorTag(
+  MarkupProcessData& markupProcessData,
+  const Tag          tag,
+  CharacterIndex&    characterIndex)
+{
+  if(!tag.isEndTag)
+  {
+    // Create an anchor instance.
+    Anchor anchor;
+    anchor.startIndex = characterIndex;
+    anchor.endIndex   = 0u;
+    ProcessAnchor(tag, anchor);
+    markupProcessData.anchors.PushBack(anchor);
+  }
+  else
+  {
+    // Update end index.
+    unsigned int count = markupProcessData.anchors.Count();
+    if(count > 0)
+    {
+      markupProcessData.anchors[count - 1].endIndex = characterIndex;
+    }
+  }
+}
+
+/**
  * @brief Resizes the model's vectors
  *
  * @param[in/out] markupProcessData The markup process data
@@ -763,6 +797,18 @@ void ProcessMarkupString(const std::string& markupString, MarkupProcessData& mar
         ProcessTagForRun<FontDescriptionRun>(
           markupProcessData.fontRuns, styleStack, tag, characterIndex, fontRunIndex, fontTagReference, [](const Tag& tag, FontDescriptionRun& fontRun) { ProcessFontTag(tag, fontRun); });
       } // <font></font>
+      else if(TokenComparison(XHTML_ANCHOR_TAG, tag.buffer, tag.length))
+      {
+        /* Anchor */
+        ProcessAnchorTag(markupProcessData, tag, characterIndex);
+        /* Color */
+        ProcessTagForRun<ColorRun>(
+          markupProcessData.colorRuns, styleStack, tag, characterIndex, colorRunIndex, colorTagReference, [](const Tag& tag, ColorRun& run) {
+            run.color = Color::BLUE;
+            ProcessColorTag(tag, run);
+          });
+        /* TODO - underline */
+      } // <a href=https://www.tizen.org>tizen</a>
       else if(TokenComparison(XHTML_SHADOW_TAG, tag.buffer, tag.length))
       {
         // TODO: If !tag.isEndTag, then create a new shadow run.
index fee7ae1..c75ca0c 100644 (file)
@@ -23,6 +23,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/anchor.h>
 #include <dali-toolkit/internal/text/color-run.h>
 #include <dali-toolkit/internal/text/embedded-item.h>
 #include <dali-toolkit/internal/text/font-description-run.h>
@@ -40,10 +41,12 @@ struct MarkupProcessData
 {
   MarkupProcessData(Vector<ColorRun>&           colorRuns,
                     Vector<FontDescriptionRun>& fontRuns,
-                    Vector<EmbeddedItem>&       items)
+                    Vector<EmbeddedItem>&       items,
+                    Vector<Anchor>&             anchors)
   : colorRuns(colorRuns),
     fontRuns(fontRuns),
     items(items),
+    anchors(anchors),
     markupProcessedText()
   {
   }
@@ -51,6 +54,7 @@ struct MarkupProcessData
   Vector<ColorRun>&           colorRuns;           ///< The color runs.
   Vector<FontDescriptionRun>& fontRuns;            ///< The font description runs.
   Vector<EmbeddedItem>&       items;               ///< The embedded items.
+  Vector<Anchor>&             anchors;             ///< The anchors.
   std::string                 markupProcessedText; ///< The mark-up string.
 };
 
index 6b1d82b..208460c 100644 (file)
@@ -48,6 +48,9 @@ const float    HALF(0.5f);
 const float    ONE(1.0f);
 const uint32_t DEFAULT_ATLAS_WIDTH  = 512u;
 const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;
+const uint32_t MAX_ATLAS_WIDTH  = 1024u;
+const uint32_t MAX_ATLAS_HEIGHT = 1024u;
+const uint32_t DOUBLE_PIXEL_PADDING = 4u;//Padding will be added twice to Atlas
 const uint16_t NO_OUTLINE           = 0u;
 } // namespace
 
@@ -245,8 +248,21 @@ struct AtlasRenderer::Impl
           // If CheckAtlas in AtlasManager::Add can't fit the bitmap in the current atlas it will create a new atlas
 
           // Setting the block size and size of new atlas does not mean a new one will be created. An existing atlas may still surffice.
-          mGlyphManager.SetNewAtlasSize(DEFAULT_ATLAS_WIDTH,
-                                        DEFAULT_ATLAS_HEIGHT,
+          uint32_t default_width = DEFAULT_ATLAS_WIDTH;
+          uint32_t default_height = DEFAULT_ATLAS_HEIGHT;
+
+          while (
+            (blockSize.mNeededBlockWidth >= (default_width - (DOUBLE_PIXEL_PADDING + 1u)) ||
+             blockSize.mNeededBlockHeight >= (default_height - (DOUBLE_PIXEL_PADDING + 1u)))
+            &&
+            (default_width < MAX_ATLAS_WIDTH &&
+             default_height < MAX_ATLAS_HEIGHT))
+          {
+            default_width <<= 1u;
+            default_height <<= 1u;
+          }
+          mGlyphManager.SetNewAtlasSize(default_width,
+                                        default_height,
                                         blockSize.mNeededBlockWidth,
                                         blockSize.mNeededBlockHeight);
 
diff --git a/dali-toolkit/internal/text/text-anchor-control-interface.h b/dali-toolkit/internal/text/text-anchor-control-interface.h
new file mode 100644 (file)
index 0000000..5c6a84f
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef DALI_TOOLKIT_TEXT_ANCHOR_CONTROL_INTERFACE_H
+#define DALI_TOOLKIT_TEXT_ANCHOR_CONTROL_INTERFACE_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+/**
+ * @brief An interface that the Text::Controller used for anchor functionality.
+ */
+class AnchorControlInterface
+{
+public:
+  /**
+   * @brief Virtual destructor.
+   */
+  virtual ~AnchorControlInterface() = default;
+
+  /**
+   * @brief Called to signal that anchor has been clicked.
+   */
+  virtual void AnchorClicked(const std::string& href) = 0;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_ANCHOR_CONTROL_INTERFACE_H
index ce0bf59..c17c820 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/cursor-helper-functions.h>
 #include <dali-toolkit/internal/text/text-controller-impl.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
 
@@ -293,6 +294,46 @@ bool Controller::EventHandler::KeyEvent(Controller& controller, const Dali::KeyE
   return true;
 }
 
+void Controller::EventHandler::AnchorEvent(Controller& controller, float x, float y)
+{
+  if(!controller.mImpl->mMarkupProcessorEnabled ||
+     !controller.mImpl->mModel->mLogicalModel->mAnchors.Count() ||
+     !controller.mImpl->IsShowingRealText())
+  {
+    return;
+  }
+
+  CharacterIndex cursorPosition = 0u;
+
+  // Convert from control's coords to text's coords.
+  const float xPosition = x - controller.mImpl->mModel->mScrollPosition.x;
+  const float yPosition = y - controller.mImpl->mModel->mScrollPosition.y;
+
+  // Whether to touch point hits on a glyph.
+  bool matchedCharacter = false;
+  cursorPosition        = Text::GetClosestCursorIndex(controller.mImpl->mModel->mVisualModel,
+                                               controller.mImpl->mModel->mLogicalModel,
+                                               controller.mImpl->mMetrics,
+                                               xPosition,
+                                               yPosition,
+                                               CharacterHitTest::TAP,
+                                               matchedCharacter);
+
+  for(const auto& anchor : controller.mImpl->mModel->mLogicalModel->mAnchors)
+  {
+    // Anchor clicked if the calculated cursor position is within the range of anchor.
+    if(cursorPosition >= anchor.startIndex && cursorPosition < anchor.endIndex)
+    {
+      if(controller.mImpl->mAnchorControlInterface && anchor.href)
+      {
+        std::string href(anchor.href);
+        controller.mImpl->mAnchorControlInterface->AnchorClicked(href);
+        break;
+      }
+    }
+  }
+}
+
 void Controller::EventHandler::TapEvent(Controller& controller, unsigned int tapCount, float x, float y)
 {
   DALI_ASSERT_DEBUG(controller.mImpl->mEventData && "Unexpected TapEvent");
index 67902fb..092ac58 100644 (file)
@@ -40,6 +40,7 @@ struct Controller::EventHandler
   static void KeyboardFocusGainEvent(Controller& controller);
   static void KeyboardFocusLostEvent(Controller& controller);
   static bool KeyEvent(Controller& controller, const Dali::KeyEvent& keyEvent);
+  static void AnchorEvent(Controller& controller, float x, float y);
   static void TapEvent(Controller& controller, unsigned int tapCount, float x, float y);
   static void PanEvent(Controller& controller, GestureState state, const Vector2& displacement);
   static void LongPressEvent(Controller& controller, GestureState state, float x, float y);
index 414faf5..ef4bb69 100644 (file)
@@ -49,6 +49,7 @@ struct ControllerImplEventHandler;
 struct SelectionHandleController;
 
 class SelectableControlInterface;
+class AnchorControlInterface;
 
 struct Event
 {
@@ -314,10 +315,12 @@ struct Controller::Impl
 {
   Impl(ControlInterface*           controlInterface,
        EditableControlInterface*   editableControlInterface,
-       SelectableControlInterface* selectableControlInterface)
+       SelectableControlInterface* selectableControlInterface,
+       AnchorControlInterface*     anchorControlInterface)
   : mControlInterface(controlInterface),
     mEditableControlInterface(editableControlInterface),
     mSelectableControlInterface(selectableControlInterface),
+    mAnchorControlInterface(anchorControlInterface),
     mModel(),
     mFontDefaults(NULL),
     mUnderlineDefaults(NULL),
@@ -786,6 +789,7 @@ public:
   ControlInterface*           mControlInterface;           ///< Reference to the text controller.
   EditableControlInterface*   mEditableControlInterface;   ///< Reference to the editable text controller.
   SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller.
+  AnchorControlInterface*     mAnchorControlInterface;     ///< Reference to the anchor controller.
   ModelPtr                    mModel;                      ///< Pointer to the text's model.
   FontDefaults*               mFontDefaults;               ///< Avoid allocating this when the user does not specify a font.
   UnderlineDefaults*          mUnderlineDefaults;          ///< Avoid allocating this when the user does not specify underline parameters.
index a900601..227d889 100644 (file)
@@ -61,6 +61,9 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller)
   VisualModelPtr&   visualModel = model->mVisualModel;
   if(impl.mRecalculateNaturalSize)
   {
+    // Store the pending operations mask so that it can be restored later on with no modifications made on it
+    // while getting the natural size were reflected on the original mask.
+    OperationsMask operationsPendingBackUp = static_cast<OperationsMask>(impl.mOperationsPending);
     // Operations that can be done only once until the text changes.
     const OperationsMask onlyOnceOperations = static_cast<OperationsMask>(CONVERT_TO_UTF32 |
                                                                           GET_SCRIPTS |
@@ -93,15 +96,6 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller)
                                            LAYOUT | REORDER),
                naturalSize.GetVectorXY());
 
-    // Do not do again the only once operations.
-    operationsPending = static_cast<OperationsMask>(operationsPending & ~onlyOnceOperations);
-
-    // Do the size related operations again.
-    const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT |
-                                                                      ALIGN |
-                                                                      REORDER);
-    operationsPending                   = static_cast<OperationsMask>(operationsPending | sizeOperations);
-
     // Stores the natural size to avoid recalculate it again
     // unless the text/style changes.
     visualModel->SetNaturalSize(naturalSize.GetVectorXY());
@@ -114,7 +108,8 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller)
 
     // Restore the actual control's size.
     visualModel->mControlSize = actualControlSize;
-
+    // Restore the previously backed-up pending operations' mask without the only once operations.
+    impl.mOperationsPending = static_cast<OperationsMask>(operationsPendingBackUp & ~onlyOnceOperations);
     DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z);
   }
   else
@@ -244,6 +239,9 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi
      textUpdateInfo.mFullRelayoutNeeded ||
      textUpdateInfo.mClearAll)
   {
+    // Store the pending operations mask so that it can be restored later on with no modifications made on it
+    // while getting the natural size were reflected on the original mask.
+    OperationsMask operationsPendingBackUp = static_cast<OperationsMask>(impl.mOperationsPending);
     // Operations that can be done only once until the text changes.
     const OperationsMask onlyOnceOperations = static_cast<OperationsMask>(CONVERT_TO_UTF32 |
                                                                           GET_SCRIPTS |
@@ -275,23 +273,14 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi
                                            LAYOUT),
                layoutSize);
 
-    // Do not do again the only once operations.
-    operationsPending = static_cast<OperationsMask>(operationsPending & ~onlyOnceOperations);
-
-    // Do the size related operations again.
-    const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT |
-                                                                      ALIGN |
-                                                                      REORDER);
-
-    operationsPending = static_cast<OperationsMask>(operationsPending | sizeOperations);
-
     // Clear the update info. This info will be set the next time the text is updated.
     textUpdateInfo.Clear();
     textUpdateInfo.mClearAll = true;
 
     // Restore the actual control's width.
     visualModel->mControlSize.width = actualControlWidth;
-
+    // Restore the previously backed-up pending operations' mask without the only once operations.
+    impl.mOperationsPending = static_cast<OperationsMask>(operationsPendingBackUp & ~onlyOnceOperations);
     DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth calculated %f\n", layoutSize.height);
   }
   else
index 672fd8a..81adb8a 100644 (file)
@@ -81,7 +81,8 @@ void Controller::TextUpdater::SetText(Controller& controller, const std::string&
 
     MarkupProcessData markupProcessData(logicalModel->mColorRuns,
                                         logicalModel->mFontDescriptionRuns,
-                                        logicalModel->mEmbeddedItems);
+                                        logicalModel->mEmbeddedItems,
+                                        logicalModel->mAnchors);
 
     Length         textSize = 0u;
     const uint8_t* utf8     = NULL;
@@ -378,6 +379,11 @@ void Controller::TextUpdater::InsertText(Controller& controller, const std::stri
       textUpdateInfo.mNumberOfCharactersToAdd += maxSizeOfNewText;
     }
 
+    if(impl.mMarkupProcessorEnabled)
+    {
+      InsertTextAnchor(controller, maxSizeOfNewText, cursorIndex);
+    }
+
     // Update the cursor index.
     cursorIndex += maxSizeOfNewText;
 
@@ -462,8 +468,8 @@ bool Controller::TextUpdater::RemoveText(
   if(!impl.IsShowingPlaceholderText())
   {
     // Delete at current cursor position
-    Vector<Character>& currentText    = logicalModel->mText;
-    CharacterIndex&    oldCursorIndex = eventData->mPrimaryCursorPosition;
+    Vector<Character>& currentText         = logicalModel->mText;
+    CharacterIndex&    previousCursorIndex = eventData->mPrimaryCursorPosition;
 
     CharacterIndex cursorIndex = 0;
 
@@ -548,8 +554,13 @@ bool Controller::TextUpdater::RemoveText(
 
       currentText.Erase(first, last);
 
+      if(impl.mMarkupProcessorEnabled)
+      {
+        RemoveTextAnchor(controller, cursorOffset, numberOfCharacters, previousCursorIndex);
+      }
+
       // Cursor position retreat
-      oldCursorIndex = cursorIndex;
+      previousCursorIndex = cursorIndex;
 
       eventData->mScrollAfterDelete = true;
 
@@ -581,6 +592,16 @@ bool Controller::TextUpdater::RemoveSelectedText(Controller& controller)
     {
       textRemoved = true;
       impl.ChangeState(EventData::EDITING);
+
+      if(impl.mMarkupProcessorEnabled)
+      {
+        int             cursorOffset        = -1;
+        int             numberOfCharacters  = removedString.length();
+        CharacterIndex& cursorIndex         = impl.mEventData->mPrimaryCursorPosition;
+        CharacterIndex  previousCursorIndex = cursorIndex + numberOfCharacters;
+
+        RemoveTextAnchor(controller, cursorOffset, numberOfCharacters, previousCursorIndex);
+      }
     }
   }
 
@@ -598,6 +619,9 @@ void Controller::TextUpdater::ResetText(Controller& controller)
   // Reset the embedded images buffer.
   logicalModel->ClearEmbeddedImages();
 
+  // Reset the anchors buffer.
+  logicalModel->ClearAnchors();
+
   // We have cleared everything including the placeholder-text
   impl.PlaceholderCleared();
 
@@ -618,6 +642,128 @@ void Controller::TextUpdater::ResetText(Controller& controller)
   impl.mOperationsPending = ALL_OPERATIONS;
 }
 
+void Controller::TextUpdater::InsertTextAnchor(Controller& controller, int numberOfCharacters, CharacterIndex previousCursorIndex)
+{
+  Controller::Impl& impl         = *controller.mImpl;
+  ModelPtr&         model        = impl.mModel;
+  LogicalModelPtr&  logicalModel = model->mLogicalModel;
+
+  for(auto& anchor : logicalModel->mAnchors)
+  {
+    if(anchor.endIndex < previousCursorIndex) //      [anchor]  CUR
+    {
+      continue;
+    }
+    if(anchor.startIndex < previousCursorIndex) //      [anCURr]
+    {
+      anchor.endIndex += numberOfCharacters;
+    }
+    else // CUR  [anchor]
+    {
+      anchor.startIndex += numberOfCharacters;
+      anchor.endIndex += numberOfCharacters;
+    }
+    DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::InsertTextAnchor[%p] Anchor[%s] start[%d] end[%d]\n", &controller, anchor.href, anchor.startIndex, anchor.endIndex);
+  }
+}
+
+void Controller::TextUpdater::RemoveTextAnchor(Controller& controller, int cursorOffset, int numberOfCharacters, CharacterIndex previousCursorIndex)
+{
+  Controller::Impl&        impl         = *controller.mImpl;
+  ModelPtr&                model        = impl.mModel;
+  LogicalModelPtr&         logicalModel = model->mLogicalModel;
+  Vector<Anchor>::Iterator it           = logicalModel->mAnchors.Begin();
+
+  while(it != logicalModel->mAnchors.End())
+  {
+    Anchor& anchor = *it;
+
+    if(anchor.endIndex <= previousCursorIndex && cursorOffset == 0) // [anchor]    CUR >>
+    {
+      // Nothing happens.
+    }
+    else if(anchor.endIndex <= previousCursorIndex && cursorOffset == -1) // [anchor] << CUR
+    {
+      int endIndex = anchor.endIndex;
+      int offset   = previousCursorIndex - endIndex;
+      int index    = endIndex - (numberOfCharacters - offset);
+
+      if(index < endIndex)
+      {
+        endIndex = index;
+      }
+
+      if((int)anchor.startIndex >= endIndex)
+      {
+        if(anchor.href)
+        {
+          delete[] anchor.href;
+        }
+        it = logicalModel->mAnchors.Erase(it);
+        continue;
+      }
+      else
+      {
+        anchor.endIndex = endIndex;
+      }
+    }
+    else if(anchor.startIndex >= previousCursorIndex && cursorOffset == -1) // << CUR    [anchor]
+    {
+      anchor.startIndex -= numberOfCharacters;
+      anchor.endIndex -= numberOfCharacters;
+    }
+    else if(anchor.startIndex >= previousCursorIndex && cursorOffset == 0) //    CUR >> [anchor]
+    {
+      int startIndex = anchor.startIndex;
+      int endIndex   = anchor.endIndex;
+      int index      = previousCursorIndex + numberOfCharacters - 1;
+
+      if(startIndex > index)
+      {
+        anchor.startIndex -= numberOfCharacters;
+        anchor.endIndex -= numberOfCharacters;
+      }
+      else if(endIndex > index + 1)
+      {
+        anchor.endIndex -= numberOfCharacters;
+      }
+      else
+      {
+        if(anchor.href)
+        {
+          delete[] anchor.href;
+        }
+        it = logicalModel->mAnchors.Erase(it);
+        continue;
+      }
+    }
+    else if(cursorOffset == -1) // [<< CUR]
+    {
+      int startIndex = anchor.startIndex;
+      int index      = previousCursorIndex - numberOfCharacters;
+
+      if(startIndex >= index)
+      {
+        anchor.startIndex = index;
+      }
+      anchor.endIndex -= numberOfCharacters;
+    }
+    else if(cursorOffset == 0) // [CUR >>]
+    {
+      anchor.endIndex -= numberOfCharacters;
+    }
+    else
+    {
+      // When this condition is reached, someting is wrong.
+      DALI_LOG_ERROR("Controller::RemoveTextAnchor[%p] Invaild state cursorOffset[%d]\n", &controller, cursorOffset);
+    }
+
+    DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveTextAnchor[%p] Anchor[%s] start[%d] end[%d]\n", &controller, anchor.href, anchor.startIndex, anchor.endIndex);
+
+    it++;
+  }
+}
+
 } // namespace Text
 
 } // namespace Toolkit
index ba7e3b9..f512940 100644 (file)
@@ -58,6 +58,14 @@ struct Controller::TextUpdater
   /// @copydoc Text::Contoller::ResetText
   /// @param[in] controller The controller
   static void ResetText(Controller& controller);
+
+  /// @copydoc Text::Contoller::InsertTextAnchor
+  /// @param[in] controller The controller
+  static void InsertTextAnchor(Controller& controller, int numberOfCharacters, CharacterIndex previousCursorIndex);
+
+  /// @copydoc Text::Contoller::RemoveTextAnchor
+  /// @param[in] controller The controller
+  static void RemoveTextAnchor(Controller& controller, int cursorOffset, int numberOfCharacters, CharacterIndex previousCursorIndex);
 };
 
 } // namespace Text
index f29ab22..15db50b 100644 (file)
@@ -75,11 +75,13 @@ ControllerPtr Controller::New(ControlInterface* controlInterface)
 
 ControllerPtr Controller::New(ControlInterface*           controlInterface,
                               EditableControlInterface*   editableControlInterface,
-                              SelectableControlInterface* selectableControlInterface)
+                              SelectableControlInterface* selectableControlInterface,
+                              AnchorControlInterface*     anchorControlInterface)
 {
   return ControllerPtr(new Controller(controlInterface,
                                       editableControlInterface,
-                                      selectableControlInterface));
+                                      selectableControlInterface,
+                                      anchorControlInterface));
 }
 
 // public : Configure the text controller.
@@ -1722,6 +1724,11 @@ bool Controller::KeyEvent(const Dali::KeyEvent& keyEvent)
   return EventHandler::KeyEvent(*this, keyEvent);
 }
 
+void Controller::AnchorEvent(float x, float y)
+{
+  EventHandler::AnchorEvent(*this, x, y);
+}
+
 void Controller::TapEvent(unsigned int tapCount, float x, float y)
 {
   EventHandler::TapEvent(*this, tapCount, x, y);
@@ -1936,6 +1943,19 @@ bool Controller::RemoveSelectedText()
   return TextUpdater::RemoveSelectedText(*this);
 }
 
+void Controller::InsertTextAnchor(int            numberOfCharacters,
+                                  CharacterIndex previousCursorIndex)
+{
+  TextUpdater::InsertTextAnchor(*this, numberOfCharacters, previousCursorIndex);
+}
+
+void Controller::RemoveTextAnchor(int            cursorOffset,
+                                  int            numberOfCharacters,
+                                  CharacterIndex previousCursorIndex)
+{
+  TextUpdater::RemoveTextAnchor(*this, cursorOffset, numberOfCharacters, previousCursorIndex);
+}
+
 // private : Relayout.
 
 bool Controller::DoRelayout(const Size&    size,
@@ -2060,6 +2080,11 @@ void Controller::SetControlInterface(ControlInterface* controlInterface)
   mImpl->mControlInterface = controlInterface;
 }
 
+void Controller::SetAnchorControlInterface(AnchorControlInterface* anchorControlInterface)
+{
+  mImpl->mAnchorControlInterface = anchorControlInterface;
+}
+
 bool Controller::ShouldClearFocusOnEscape() const
 {
   return mImpl->mShouldClearFocusOnEscape;
@@ -2073,19 +2098,20 @@ Actor Controller::CreateBackgroundActor()
 // private : Private contructors & copy operator.
 
 Controller::Controller()
-: Controller(nullptr, nullptr, nullptr)
+: Controller(nullptr, nullptr, nullptr, nullptr)
 {
 }
 
 Controller::Controller(ControlInterface* controlInterface)
-: Controller(controlInterface, nullptr, nullptr)
+: Controller(controlInterface, nullptr, nullptr, nullptr)
 {
 }
 
 Controller::Controller(ControlInterface*           controlInterface,
                        EditableControlInterface*   editableControlInterface,
-                       SelectableControlInterface* selectableControlInterface)
-: mImpl(new Controller::Impl(controlInterface, editableControlInterface, selectableControlInterface))
+                       SelectableControlInterface* selectableControlInterface,
+                       AnchorControlInterface*     anchorControlInterface)
+: mImpl(new Controller::Impl(controlInterface, editableControlInterface, selectableControlInterface, anchorControlInterface))
 {
 }
 
index 40286ef..aaa3a66 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/hidden-text.h>
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
 #include <dali-toolkit/internal/text/text-model-interface.h>
 #include <dali-toolkit/internal/text/text-selectable-control-interface.h>
 #include <dali-toolkit/public-api/text/text-enumerations.h>
@@ -184,12 +185,14 @@ public: // Constructor.
    * @param[in] controlInterface The control's interface.
    * @param[in] editableControlInterface The editable control's interface.
    * @param[in] selectableControlInterface The selectable control's interface.
+   * @param[in] anchorControlInterface The anchor control's interface.
    *
    * @return A pointer to a new Controller.
    */
   static ControllerPtr New(ControlInterface*           controlInterface,
                            EditableControlInterface*   editableControlInterface,
-                           SelectableControlInterface* selectableControlInterface);
+                           SelectableControlInterface* selectableControlInterface,
+                           AnchorControlInterface*     anchorControlInterface);
 
 public: // Configure the text controller.
   /**
@@ -1295,6 +1298,13 @@ public: // Default style & Input style
    */
   void SetControlInterface(ControlInterface* controlInterface);
 
+  /**
+   * @brief Set the anchor control's interface.
+   *
+   * @param[in] anchorControlInterface The control's interface.
+   */
+  void SetAnchorControlInterface(AnchorControlInterface* anchorControlInterface);
+
 public: // Queries & retrieves.
   /**
    * @brief Return the layout engine.
@@ -1494,6 +1504,13 @@ public: // Text-input Event Queuing.
   bool KeyEvent(const Dali::KeyEvent& event);
 
   /**
+   * @brief Called by anchor when a tap gesture occurs.
+   * @param[in] x The x position relative to the top-left of the parent control.
+   * @param[in] y The y position relative to the top-left of the parent control.
+   */
+  void AnchorEvent(float x, float y);
+
+  /**
    * @brief Called by editable UI controls when a tap gesture occurs.
    * @param[in] tapCount The number of taps.
    * @param[in] x The x position relative to the top-left of the parent control.
@@ -1700,6 +1717,26 @@ private: // Update.
    */
   bool RemoveSelectedText();
 
+  /**
+   * @brief Update anchor position from given number of inserted characters.
+   *
+   * @param[in] numberOfCharacters The number of inserted characters.
+   * @param[in] previousCursorIndex A cursor position before event occurs.
+   */
+  void InsertTextAnchor(int            numberOfCharacters,
+                        CharacterIndex previousCursorIndex);
+
+  /**
+   * @brief Update anchor position from given number of removed characters.
+   *
+   * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
+   * @param[in] numberOfCharacters The number of removed characters.
+   * @param[in] previousCursorIndex A cursor position before event occurs.
+   */
+  void RemoveTextAnchor(int            cursorOffset,
+                        int            numberOfCharacters,
+                        CharacterIndex previousCursorIndex);
+
 private: // Relayout.
   /**
    * @brief Lays-out the text.
@@ -1792,7 +1829,8 @@ private: // Private contructors & copy operator.
    */
   Controller(ControlInterface*           controlInterface,
              EditableControlInterface*   editableControlInterface,
-             SelectableControlInterface* selectableControlInterface);
+             SelectableControlInterface* selectableControlInterface,
+             AnchorControlInterface*     anchorControlInterface);
 
   // Undefined
   Controller(const Controller& handle);
index bb3f8d0..2d42f93 100644 (file)
@@ -119,7 +119,7 @@ Internal::Visual::Base::Impl::Impl(FittingMode fittingMode, Toolkit::Visual::Typ
   mTransform(),
   mMixColor(Color::WHITE),
   mControlSize(Vector2::ZERO),
-  mCornerRadius(0.0f),
+  mCornerRadius(Vector4::ZERO),
   mCornerRadiusPolicy(1.0f),
   mDepthIndex(0.0f),
   mMixColorIndex(Property::INVALID_INDEX),
index 2967b1d..acb6805 100644 (file)
@@ -123,7 +123,7 @@ struct Base::Impl
   Transform                       mTransform;
   Vector4                         mMixColor;
   Size                            mControlSize;
-  float                           mCornerRadius;
+  Vector4                         mCornerRadius;
   float                           mCornerRadiusPolicy;
   int                             mDepthIndex;
   Property::Index                 mMixColorIndex;
index 331eaf5..528bc14 100644 (file)
@@ -219,10 +219,26 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
       }
       case Toolkit::DevelVisual::Property::CORNER_RADIUS:
       {
-        float radius;
-        if(value.Get(radius))
+        if(value.GetType() == Property::VECTOR4)
         {
-          mImpl->mCornerRadius = radius;
+          // If CORNER_RADIUS Property is Vector4,
+          // Each values mean the radius of
+          // (top-left, top-right, bottom-right, bottom-left)
+          Vector4 radius;
+          if(value.Get(radius))
+          {
+            mImpl->mCornerRadius = radius;
+          }
+        }
+        else
+        {
+          // If CORNER_RADIUS Property is float,
+          // Every corner radius have same value
+          float radius;
+          if(value.Get(radius))
+          {
+            mImpl->mCornerRadius = Vector4(radius, radius, radius, radius);
+          }
         }
         break;
       }
@@ -370,7 +386,7 @@ void Visual::Base::CreatePropertyMap(Property::Map& map) const
     }
     if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
     {
-      mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<float>(mImpl->mCornerRadiusIndex);
+      mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
     }
   }
 
@@ -449,9 +465,9 @@ bool Visual::Base::IsRoundedCornerRequired() const
   if(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
   {
     // Update values from Renderer
-    mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<float>(mImpl->mCornerRadiusIndex);
+    mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
   }
-  return !EqualsZero(mImpl->mCornerRadius) || mImpl->mNeedCornerRadius;
+  return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mNeedCornerRadius;
 }
 
 void Visual::Base::OnDoAction(const Property::Index actionId, const Property::Value& attributes)
index 2c90452..62b1079 100644 (file)
@@ -605,7 +605,7 @@ void Control::OnSceneDisconnection()
 {
   if(Accessibility::IsUp())
   {
-    mImpl->AccessibilityDeregister();
+    mImpl->AccessibilityDeregister(true);
   }
   mImpl->OnSceneDisconnection();
 }
index 6a74642..6330360 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 20;
+const unsigned int TOOLKIT_MICRO_VERSION = 21;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 3627ef4..3b5d1ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * This file is part of Dali Toolkit
  *
     },
     "TextSelectionPopup":
     {
-      "popupMaxSize":[656,72],
-      "optionDividerSize":[2,0],
-      "popupDividerColor":[0.23,0.72,0.8,0.11],
+      "popupMaxSize":[656,36],
+      "optionDividerSize":[1,0],
+      "optionDividerPadding":[0.0,0.0,6.0,6.0],
+      "popupDividerColor":[1.0,1.0,1.0,1.0],
       "popupIconColor":[1.0,1.0,1.0,1.0],
       "popupPressedColor":[0.24,0.72,0.8,0.11],
       "background": {
         "visualType": "IMAGE",
-        "url": "{DALI_IMAGE_DIR}selection-popup-background.9.png"
+        "url": "{DALI_IMAGE_DIR}IoT-selection-popup-background.9.png",
+        "mixColor":[0.0,0.05,0.17,0.9]
         },
       "backgroundBorder": {
         "visualType": "IMAGE",
         "url": "{DALI_IMAGE_DIR}selection-popup-border.9.png",
-        "mixColor":[0.24,0.72,0.8,1.0]
+        "mixColor":[0.0,0.0,0.0,0.0]
         },
       "popupFadeInDuration":0.25,
       "popupFadeOutDuration":0.25
     },
     "TextSelectionPopupButton":
     {
+      "minimumSize":[0,36],
+      "labelPadding":[0.0,0.0,0.0,0.0],
       "label":
       {
         "visualType":"TEXT",
-        "pointSize":8
+        "pointSize":18,
+        "textColor":[1.0,1.0,1.0,1.0],
+        "fontFamily":"BreezeSans",
+        "fontStyle" : {"weight":"light"}
       },
       "unselectedBackgroundVisual":
       {
     "TextSelectionToolbar":
     {
       "enableOvershoot":true,
-      "enableScrollBar":true,
+      "enableScrollBar":false,
       "scrollView":
       {
         "overshootAnimationSpeed":360.0,
diff --git a/dali-toolkit/styles/images-common/IoT-selection-popup-background.9.png b/dali-toolkit/styles/images-common/IoT-selection-popup-background.9.png
new file mode 100644 (file)
index 0000000..7903ae2
Binary files /dev/null and b/dali-toolkit/styles/images-common/IoT-selection-popup-background.9.png differ
index 4abbec0..6746d55 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.0.20
+Version:    2.0.21
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT