Merge "Use broken image when animated image loading is failed." into devel/master
authorDavid Steele <david.steele@samsung.com>
Fri, 19 Mar 2021 09:57:16 +0000 (09:57 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 19 Mar 2021 09:57:16 +0000 (09:57 +0000)
58 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.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-WebView.cpp [changed mode: 0644->0755]
build/tizen/CMakeLists.txt
build/tizen/docs-internal/dali-internal.doxy.in
build/tizen/docs/dali.doxy.in
dali-toolkit/devel-api/controls/accessible-impl.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/accessible-impl.h [new file with mode: 0644]
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/web-view/web-settings.cpp [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-settings.h [changed mode: 0644->0755]
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/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-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.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-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/text/text-controller-event-handler.cpp
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/visuals/svg/svg-rasterize-thread.cpp
dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 9aa5155..01b5ae5 100755 (executable)
@@ -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.
@@ -42,27 +42,34 @@ class WebEngine;
 
 namespace
 {
-static WebEngine* gInstance = NULL;
+
+// Generally only one WebEngine instance exists.
+// If > 1, a new web engine has been created by CreateWindowSignal.
+static WebEngine* gInstance = 0;
 static int gInstanceCount = 0;
 
 bool OnGoBack();
 bool OnGoForward();
 bool OnLoadUrl();
 bool OnEvaluteJavaScript();
+bool OnJavaScriptAlert();
+bool OnJavaScriptConfirm();
+bool OnJavaScriptPrompt();
+bool OnScrollEdge();
 bool OnClearHistory();
 
-static void ConnectToGlobalSignal( bool (*func)() )
+static void ConnectToGlobalSignal( bool ( *func )() )
 {
   Dali::Timer timer = Dali::Timer::New( 0 );
   timer.TickSignal().Connect( func );
 }
 
-static void DisconnectFromGlobalSignal( bool (*func)() )
+static void DisconnectFromGlobalSignal( bool ( *func )() )
 {
   Dali::Timer timer = Dali::Timer::New( 0 );
   timer.TickSignal().Disconnect( func );
 }
-}
+} // namespace anonymous
 
 class MockWebEngineContext : public Dali::WebEngineContext
 {
@@ -214,6 +221,18 @@ public:
   MockWebEngineSettings()
     : mockDefaultFontSize( 16 ),
       mockJavaScriptEnabled( true ),
+      mockAutoFittingEnabled ( true ),
+      mockPluginsEnabled ( true ),
+      mockPrivateBrowsingEnabled( true ),
+      mockLinkMagnifierEnabled( true ),
+      mockKeypadWithoutUserActionUsed( true ),
+      mockAutofillPasswordFormEnabled( true ),
+      mockFormCandidateDataEnabled( true ),
+      mockTextSelectionEnabled( true ),
+      mockTextAutosizingEnable( true ),
+      mockArrowScrollEnable( true ),
+      mockClipboardEnabled( true ),
+      mockImePanelEnabled( true ),
       mockImageLoadedAutomatically( true ),
       mockDefaultTextEncodingName()
   {
@@ -239,6 +258,126 @@ public:
     mockJavaScriptEnabled = enabled;
   }
 
+  bool IsAutoFittingEnabled() const override
+  {
+    return mockAutoFittingEnabled;
+  }
+
+  void EnableAutoFitting( bool enabled ) override
+  {
+    mockAutoFittingEnabled = enabled;
+  }
+
+  bool ArePluginsEnabled() const override
+  {
+    return mockPluginsEnabled;
+  }
+
+  void EnablePlugins( bool enabled ) override
+  {
+    mockPluginsEnabled = enabled;
+  }
+
+  bool IsPrivateBrowsingEnabled() const override
+  {
+    return mockPrivateBrowsingEnabled;
+  }
+
+  void EnablePrivateBrowsing( bool enabled ) override
+  {
+    mockPrivateBrowsingEnabled = enabled;
+  }
+
+  bool IsLinkMagnifierEnabled() const override
+  {
+    return mockLinkMagnifierEnabled;
+  }
+
+  void EnableLinkMagnifier( bool enabled ) override
+  {
+    mockLinkMagnifierEnabled = enabled;
+  }
+
+  bool IsKeypadWithoutUserActionUsed() const override
+  {
+    return mockKeypadWithoutUserActionUsed;
+  }
+
+  void UseKeypadWithoutUserAction( bool used ) override
+  {
+    mockKeypadWithoutUserActionUsed = used;
+  }
+
+  bool IsAutofillPasswordFormEnabled() const override
+  {
+    return mockAutofillPasswordFormEnabled;
+  }
+
+  void EnableAutofillPasswordForm( bool enabled ) override
+  {
+    mockAutofillPasswordFormEnabled = enabled;
+  }
+
+  bool IsFormCandidateDataEnabled() const override
+  {
+    return mockFormCandidateDataEnabled;
+  }
+
+  void EnableFormCandidateData( bool enabled ) override
+  {
+    mockFormCandidateDataEnabled = enabled;
+  }
+
+  bool IsTextSelectionEnabled() const override
+  {
+    return mockTextSelectionEnabled;
+  }
+
+  void EnableTextSelection( bool enabled ) override
+  {
+    mockTextSelectionEnabled = enabled;
+  }
+
+  bool IsTextAutosizingEnabled() const override
+  {
+    return mockTextAutosizingEnable;
+  }
+
+  void EnableTextAutosizing( bool enabled ) override
+  {
+    mockTextAutosizingEnable = enabled;
+  }
+
+  bool IsArrowScrollEnabled() const override
+  {
+    return mockArrowScrollEnable;
+  }
+
+  void EnableArrowScroll( bool enabled ) override
+  {
+    mockArrowScrollEnable = enabled;
+  }
+
+  bool IsClipboardEnabled() const override
+  {
+    return mockClipboardEnabled;
+  }
+
+  void EnableClipboard( bool enabled ) override
+  {
+    mockClipboardEnabled = enabled;
+  }
+
+  bool IsImePanelEnabled() const override
+  {
+    return mockImePanelEnabled;
+  }
+
+  void EnableImePanel( bool enabled ) override
+  {
+    mockImePanelEnabled = enabled;
+  }
+
   bool AreImagesLoadedAutomatically() const override
   {
     return mockImageLoadedAutomatically;
@@ -271,6 +410,18 @@ public:
   {
   }
 
+  void EnableCacheBuilder( bool enabled ) override
+  {
+  }
+
+  void UseScrollbarThumbFocusNotifications( bool used ) override
+  {
+  }
+
+  void EnableDoNotTrack( bool enabled ) override
+  {
+  }
+
   void AllowFileAccessFromExternalUrl( bool allowed ) override
   {
   }
@@ -282,6 +433,18 @@ public:
 private:
   int mockDefaultFontSize;
   bool mockJavaScriptEnabled;
+  bool mockAutoFittingEnabled;
+  bool mockPluginsEnabled;
+  bool mockPrivateBrowsingEnabled;
+  bool mockLinkMagnifierEnabled;
+  bool mockKeypadWithoutUserActionUsed;
+  bool mockAutofillPasswordFormEnabled;
+  bool mockFormCandidateDataEnabled;
+  bool mockTextSelectionEnabled;
+  bool mockTextAutosizingEnable;
+  bool mockArrowScrollEnable;
+  bool mockClipboardEnabled;
+  bool mockImePanelEnabled;
   bool mockImageLoadedAutomatically;
   std::string mockDefaultTextEncodingName;
 };
@@ -290,6 +453,11 @@ class WebEngine: public Dali::BaseObject
 {
 public:
 
+  using JavaScriptEvaluatedResultCallback = std::function<void(const std::string&)>;
+  using JavaScriptAlertCallback = std::function<bool(const std::string&)>;
+  using JavaScriptConfirmCallback = std::function<bool(const std::string&)>;
+  using JavaScriptPromptCallback = std::function<bool(const std::string&, const std::string&)>;
+
   WebEngine()
     : mUrl()
     , mCurrentPlusOnePos( 0 )
@@ -300,7 +468,10 @@ public:
     , mContentSize( 500, 500 )
   {
     gInstanceCount++;
-    gInstance = this;
+    if ( gInstanceCount == 1 ) // only first web engine need be saved.
+    {
+      gInstance = this;
+    }
 
     mockWebEngineSettings = new MockWebEngineSettings();
     mockWebEngineContext = new MockWebEngineContext();
@@ -313,7 +484,7 @@ public:
     gInstanceCount--;
     if( !gInstanceCount )
     {
-      gInstance = NULL;
+      gInstance = 0;
     }
 
     delete mockWebEngineSettings;
@@ -416,6 +587,33 @@ public:
     }
   }
 
+  void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+  {
+    if ( callback )
+    {
+      ConnectToGlobalSignal( &OnJavaScriptAlert );
+      mJavaScriptAlertCallback = callback;
+    }
+  }
+
+  void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+  {
+    if ( callback )
+    {
+      ConnectToGlobalSignal( &OnJavaScriptConfirm );
+      mJavaScriptConfirmCallback = callback;
+    }
+  }
+
+  void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+  {
+    if ( callback )
+    {
+      ConnectToGlobalSignal( &OnJavaScriptPrompt );
+      mJavaScriptPromptCallback = callback;
+    }
+  }
+
   void ClearHistory()
   {
     ConnectToGlobalSignal( &OnClearHistory );
@@ -436,7 +634,7 @@ public:
     mScrollPosition += Dali::Vector2( dx, dy );
     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
     {
-      gInstance->mScrollEdgeReachedSignal.Emit( Dali::WebEnginePlugin::ScrollEdge::BOTTOM );
+      ConnectToGlobalSignal( &OnScrollEdge );
     }
   }
 
@@ -466,6 +664,11 @@ public:
     return mPageLoadStartedSignal;
   }
 
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadInProgressSignal()
+  {
+    return mPageLoadInProgressSignal;
+  }
+
   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal()
   {
     return mPageLoadFinishedSignal;
@@ -481,14 +684,20 @@ public:
     return mScrollEdgeReachedSignal;
   }
 
+  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal()
+  {
+    return mUrlChangedSignal;
+  }
+
   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;
-  std::vector< std::function< void( const std::string& ) > > mResultCallbacks;
+  std::vector<JavaScriptEvaluatedResultCallback>             mResultCallbacks;
   bool                                                       mEvaluating;
 
   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
@@ -499,21 +708,13 @@ public:
   WebEngineContext*                                           mockWebEngineContext;
   WebEngineCookieManager*                                     mockWebEngineCookieManager;
   WebEngineSettings*                                          mockWebEngineSettings;
+  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType        mUrlChangedSignal;
+
+  JavaScriptAlertCallback                                     mJavaScriptAlertCallback;
+  JavaScriptConfirmCallback                                   mJavaScriptConfirmCallback;
+  JavaScriptPromptCallback                                    mJavaScriptPromptCallback;
 };
 
-inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
-{
-  DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
-  BaseObject& handle = webEngine.GetBaseObject();
-  return static_cast< Internal::Adaptor::WebEngine& >( handle );
-}
-
-inline const WebEngine& GetImplementation( const Dali::WebEngine& webEngine )
-{
-  DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
-  const BaseObject& handle = webEngine.GetBaseObject();
-  return static_cast< const Internal::Adaptor::WebEngine& >( handle );
-}
 
 namespace
 {
@@ -553,8 +754,22 @@ bool OnLoadUrl()
     gInstance->mHistory.push_back( gInstance->mUrl );
     gInstance->mCurrentPlusOnePos++;
     gInstance->mPageLoadStartedSignal.Emit( gInstance->mUrl );
+    gInstance->mPageLoadInProgressSignal.Emit( gInstance->mUrl );
     gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
+    gInstance->mUrlChangedSignal.Emit( "http://new-test" );
+  }
+  return false;
+}
+
+bool OnScrollEdge()
+{
+  DisconnectFromGlobalSignal( &OnScrollEdge );
+
+  if( gInstance )
+  {
+    gInstance->mScrollEdgeReachedSignal.Emit( Dali::WebEnginePlugin::ScrollEdge::BOTTOM );
   }
+
   return false;
 }
 
@@ -573,11 +788,42 @@ bool OnEvaluteJavaScript()
   return false;
 }
 
+bool OnJavaScriptAlert()
+{
+  DisconnectFromGlobalSignal( &OnJavaScriptAlert );
+  if ( gInstance )
+  {
+    gInstance->mJavaScriptAlertCallback( "this is an alert popup." );
+  }
+  return false;
+}
+
+bool OnJavaScriptConfirm()
+{
+  DisconnectFromGlobalSignal( &OnJavaScriptConfirm );
+  if ( gInstance )
+  {
+    gInstance->mJavaScriptConfirmCallback( "this is a confirm popup." );
+  }
+  return false;
+}
+
+bool OnJavaScriptPrompt()
+{
+  DisconnectFromGlobalSignal( &OnJavaScriptPrompt );
+  if ( gInstance )
+  {
+    gInstance->mJavaScriptPromptCallback( "this is a prompt pompt.", "" );
+  }
+  return false;
+}
+
 bool OnClearHistory()
 {
   DisconnectFromGlobalSignal( &OnClearHistory );
 
-  if( gInstance && gInstance->mCurrentPlusOnePos ) {
+  if( gInstance && gInstance->mCurrentPlusOnePos )
+  {
     std::string url = gInstance->mHistory[ gInstance->mCurrentPlusOnePos - 1 ];
     std::vector< std::string >().swap( gInstance->mHistory );
     gInstance->mHistory.push_back( url );
@@ -585,13 +831,27 @@ bool OnClearHistory()
   }
   return false;
 }
+
 } // namespace
 
+inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
+{
+  DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
+  BaseObject& handle = webEngine.GetBaseObject();
+  return static_cast< Internal::Adaptor::WebEngine& >( handle );
+}
+
+inline const WebEngine& GetImplementation( const Dali::WebEngine& webEngine )
+{
+  DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
+  const BaseObject& handle = webEngine.GetBaseObject();
+  return static_cast< const Internal::Adaptor::WebEngine& >( handle );
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
 
-
 // Dali::WebEngine Implementation
 WebEngine::WebEngine()
 {
@@ -737,6 +997,33 @@ void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectNam
 {
 }
 
+void WebEngine::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+{
+  Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptAlertCallback( callback );
+}
+
+void WebEngine::JavaScriptAlertReply()
+{
+}
+
+void WebEngine::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+{
+  Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptConfirmCallback( callback );
+}
+
+void WebEngine::JavaScriptConfirmReply( bool confirmed )
+{
+}
+
+void WebEngine::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+{
+  Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptPromptCallback( callback );
+}
+
+void WebEngine::JavaScriptPromptReply( const std::string& result )
+{
+}
+
 void WebEngine::ClearAllTilesResources()
 {
 }
@@ -812,6 +1099,11 @@ Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSi
   return Internal::Adaptor::GetImplementation( *this ).PageLoadStartedSignal();
 }
 
+Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadInProgressSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).PageLoadInProgressSignal();
+}
+
 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).PageLoadFinishedSignal();
@@ -827,5 +1119,10 @@ Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEd
   return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeReachedSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).UrlChangedSignal();
+}
+
 } // namespace Dali;
 
index 66f8db3..06d3307 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.
@@ -964,20 +964,113 @@ int utcDaliTextEditorTextChangedP(void)
 
   gTextChangedCallBackCalled = false;
   editor.SetProperty( TextEditor::Property::TEXT, "ABC" );
+  application.SendNotification();
+  application.Render();
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
   DALI_TEST_CHECK( textChangedSignal );
 
+  editor.SetKeyInputFocus();
+
+  gTextChangedCallBackCalled = false;
+  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();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+
+  // Remove all text
+  editor.SetProperty( TextField::Property::TEXT, "" );
+  application.SendNotification();
+  application.Render();
+
+  // Pressing backspace key: TextChangedCallback should not be called when there is no text in texteditor.
+  gTextChangedCallBackCalled = false;
+  application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  // Pressing delete key: TextChangedCallback should not be called when there is no text in texteditor.
+  gTextChangedCallBackCalled = false;
+  application.ProcessEvent( GenerateKey( "", "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
   application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  END_TEST;
+}
+
+int utcDaliTextEditorTextChangedWithInputMethodContext(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorTextChangedWithInputMethodContext");
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+
+  application.GetScene().Add( editor );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  editor.TextChangedSignal().Connect(&TestTextChangedCallback);
+  bool textChangedSignal = false;
+  editor.ConnectSignal( testTracker, "textChanged",   CallbackFunctor(&textChangedSignal) );
+
+
+  // get InputMethodContext
+  std::string text;
+  InputMethodContext::EventData imfEvent;
+  InputMethodContext inputMethodContext = DevelTextEditor::GetInputMethodContext( editor );
 
   editor.SetKeyInputFocus();
+  editor.SetProperty( DevelTextEditor::Property::ENABLE_EDITING, true );
 
+  // input text
   gTextChangedCallBackCalled = false;
-  application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "ㅎ", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("ㅎ"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "호", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("호"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "혿", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("혿"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "호", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "두", 1, 2 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string("호두"), TEST_LOCATION );
 
   END_TEST;
 }
 
+
 int utcDaliTextEditorInputStyleChanged01(void)
 {
   // The text-editor emits signals when the input style changes. These changes of style are
index 93d8f7d..0795816 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.
@@ -1034,20 +1034,113 @@ int utcDaliTextFieldTextChangedP(void)
 
   gTextChangedCallBackCalled = false;
   field.SetProperty( TextField::Property::TEXT, "ABC" );
+  application.SendNotification();
+  application.Render();
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
   DALI_TEST_CHECK( textChangedSignal );
 
+  field.SetKeyInputFocus();
+
+  gTextChangedCallBackCalled = false;
+  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();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+
+  // Remove all text
+  field.SetProperty( TextField::Property::TEXT, "" );
   application.SendNotification();
+  application.Render();
+
+  // Pressing backspace key: TextChangedCallback should not be called when there is no text in textfield.
+  gTextChangedCallBackCalled = false;
+  application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  // Pressing delete key: TextChangedCallback should not be called when there is no text in textfield.
+  gTextChangedCallBackCalled = false;
+  application.ProcessEvent( GenerateKey( "", "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  END_TEST;
+}
+
+int utcDaliTextFieldTextChangedWithInputMethodContext(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldTextChangedWithInputMethodContext");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+
+  application.GetScene().Add( field );
+
+  // connect to the text changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  field.TextChangedSignal().Connect(&TestTextChangedCallback);
+  bool textChangedSignal = false;
+  field.ConnectSignal( testTracker, "textChanged",   CallbackFunctor(&textChangedSignal) );
+
+
+  // get InputMethodContext
+  std::string text;
+  InputMethodContext::EventData imfEvent;
+  InputMethodContext inputMethodContext = DevelTextField::GetInputMethodContext( field );
 
   field.SetKeyInputFocus();
+  field.SetProperty( DevelTextField::Property::ENABLE_EDITING, true );
 
+  // input text
   gTextChangedCallBackCalled = false;
-  application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "ㅎ", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("ㅎ"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "호", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("호"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "혿", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  application.SendNotification();
+  application.Render();
   DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("혿"), TEST_LOCATION );
+
+  gTextChangedCallBackCalled = false;
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "호", 0, 1 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "두", 1, 2 );
+  inputMethodContext.EventReceivedSignal().Emit(inputMethodContext, imfEvent);
+  DALI_TEST_CHECK( !gTextChangedCallBackCalled );
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( gTextChangedCallBackCalled );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("호두"), TEST_LOCATION );
 
   END_TEST;
 }
 
+
 // Negative test for the textChanged signal.
 int utcDaliTextFieldTextChangedN(void)
 {
@@ -1066,6 +1159,8 @@ int utcDaliTextFieldTextChangedN(void)
 
   gTextChangedCallBackCalled = false;
   field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "ABC" ); // Setting placeholder, not TEXT
+  application.SendNotification();
+  application.Render();
   DALI_TEST_CHECK( !gTextChangedCallBackCalled );
   DALI_TEST_CHECK( !textChangedSignal );
 
old mode 100644 (file)
new mode 100755 (executable)
index 28863cf..7b7e397
@@ -44,9 +44,14 @@ const char* const TEST_URL1( "http://www.somewhere.valid1.com" );
 const char* const TEST_URL2( "http://www.somewhere.valid2.com" );
 
 static int gPageLoadStartedCallbackCalled = 0;
+static int gPageLoadInProgressCallbackCalled = 0;
 static int gPageLoadFinishedCallbackCalled = 0;
 static int gScrollEdgeReachedCallbackCalled = 0;
+static int gUrlChangedCallbackCalled = 0;
 static int gEvaluateJavaScriptCallbackCalled = 0;
+static int gJavaScriptAlertCallbackCalled = 0;
+static int gJavaScriptConfirmCallbackCalled = 0;
+static int gJavaScriptPromptCallbackCalled = 0;
 static bool gTouched = false;
 
 struct CallbackFunctor
@@ -68,6 +73,11 @@ static void OnPageLoadStarted( WebView view, const std::string& url )
   gPageLoadStartedCallbackCalled++;
 }
 
+static void OnPageLoadInProgress( WebView view, const std::string& url )
+{
+  gPageLoadInProgressCallbackCalled++;
+}
+
 static void OnPageLoadFinished( WebView view, const std::string& url )
 {
   gPageLoadFinishedCallbackCalled++;
@@ -78,6 +88,11 @@ static void OnScrollEdgeReached( WebView view, Dali::WebEnginePlugin::ScrollEdge
   gScrollEdgeReachedCallbackCalled++;
 }
 
+static void OnUrlChanged( WebView view, const std::string& url )
+{
+  gUrlChangedCallbackCalled++;
+}
+
 static void OnPageLoadError( WebView view, const std::string& url, WebView::LoadErrorCode errorCode )
 {
 }
@@ -87,6 +102,24 @@ static void OnEvaluateJavaScript( const std::string& result )
   gEvaluateJavaScriptCallbackCalled++;
 }
 
+static bool OnJavaScriptAlert( const std::string& result )
+{
+  gJavaScriptAlertCallbackCalled++;
+  return true;
+}
+
+static bool OnJavaScriptConfirm( const std::string& result )
+{
+  gJavaScriptConfirmCallbackCalled++;
+  return true;
+}
+
+static bool OnJavaScriptPrompt( const std::string& meesage1, const std::string& message2 )
+{
+  gJavaScriptPromptCallbackCalled++;
+  return true;
+}
+
 static bool OnTouched( Actor actor, const Dali::TouchEvent& touch )
 {
   gTouched = true;
@@ -167,26 +200,35 @@ int UtcDaliWebViewPageNavigation(void)
 
   ConnectionTracker* testTracker = new ConnectionTracker();
   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;
   bool signal3 = false;
+  bool signal4 = false;
+  bool signal5 = false;
   view.ConnectSignal( testTracker, "pageLoadStarted", CallbackFunctor(&signal1) );
-  view.ConnectSignal( testTracker, "pageLoadFinished", CallbackFunctor(&signal2) );
-  view.ConnectSignal( testTracker, "invalidname", CallbackFunctor(&signal3) );
+  view.ConnectSignal( testTracker, "pageLoadInProgress", CallbackFunctor(&signal2) );
+  view.ConnectSignal( testTracker, "pageLoadFinished", CallbackFunctor(&signal3) );
+  view.ConnectSignal( testTracker, "urlChanged", CallbackFunctor(&signal4) );
+  view.ConnectSignal( testTracker, "invalidname", CallbackFunctor(&signal5) );
   DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 0, TEST_LOCATION );
   DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 0, TEST_LOCATION );
-
+  DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 0, TEST_LOCATION );
 
   view.LoadUrl( TEST_URL1 );
   view.GetNaturalSize();
   Test::EmitGlobalTimerSignal();
   DALI_TEST_EQUALS( view.CanGoBack(), false, TEST_LOCATION );
   DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 1, TEST_LOCATION );
   DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 1, TEST_LOCATION );
-  DALI_TEST_CHECK( signal1 & signal2 );
-  DALI_TEST_CHECK( !signal3 );
+  DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 & signal2 & signal3 & signal4 );
+  DALI_TEST_CHECK( !signal5 );
 
   view.LoadUrl( TEST_URL2 );
   view.Suspend();
@@ -198,7 +240,9 @@ int UtcDaliWebViewPageNavigation(void)
   DALI_TEST_EQUALS( view.CanGoBack(), true, TEST_LOCATION );
   DALI_TEST_EQUALS( view.CanGoForward(), false, TEST_LOCATION );
   DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 2, TEST_LOCATION );
   DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 2, TEST_LOCATION );
 
   view.GoBack();
   Test::EmitGlobalTimerSignal();
@@ -518,6 +562,8 @@ int UtcDaliWebViewScrollBy(void)
 
   // scroll by and trigger scrollEdgeReached event.
   view.ScrollBy( 50, 50 );
+  Test::EmitGlobalTimerSignal();
+
   view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
   DALI_TEST_CHECK( output.x == 150 && output.y == 150 );
   DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 1, TEST_LOCATION );
@@ -542,6 +588,33 @@ int UtcDaliWebViewEvaluteJavaScript(void)
   END_TEST;
 }
 
+int UtcDaliWebViewJavaScriptAlertConfirmPrompt(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New( "ko-KR", "Asia/Seoul" );
+
+  view.RegisterJavaScriptAlertCallback( &OnJavaScriptAlert );
+  view.LoadHtmlString( "<head><script type='text/javascript'>alert('this is an alert popup.');</script></head><body>Hello World!</body>" );
+  view.JavaScriptAlertReply();
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gJavaScriptAlertCallbackCalled, 1, TEST_LOCATION );
+
+  view.RegisterJavaScriptConfirmCallback( &OnJavaScriptConfirm );
+  view.LoadHtmlString( "<head><script type='text/javascript'>confirm('this is a confirm popup.');</script></head><body>Hello World!</body>" );
+  view.JavaScriptConfirmReply( true );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gJavaScriptConfirmCallbackCalled, 1, TEST_LOCATION );
+
+  view.RegisterJavaScriptPromptCallback( &OnJavaScriptPrompt );
+  view.LoadHtmlString( "<head><script type='text/javascript'>prompt('this is a prompt popup.');</script></head><body>Hello World!</body>" );
+  view.JavaScriptPromptReply( "it is a prompt." );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gJavaScriptPromptCallbackCalled, 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliWebViewMethodsForCoverage(void)
 {
   ToolkitTestApplication application;
@@ -677,6 +750,9 @@ int UtcDaliWebSettingsGetSetDefaultFontSize(void)
   settings->AllowMixedContents( false );
   settings->EnableSpatialNavigation( false );
   settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
   settings->AllowFileAccessFromExternalUrl( false );
   settings->AllowScriptsOpenWindows( false );
 
@@ -706,6 +782,9 @@ int UtcDaliWebSettingsCheckEnableJavaScript(void)
   settings->AllowMixedContents( false );
   settings->EnableSpatialNavigation( false );
   settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
   settings->AllowFileAccessFromExternalUrl( false );
   settings->AllowScriptsOpenWindows( false );
 
@@ -721,6 +800,384 @@ int UtcDaliWebSettingsCheckEnableJavaScript(void)
   END_TEST;
 }
 
+int UtcDaliWebSettingsCheckEnableAutoFitting(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsAutoFittingEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableAutoFitting( false );
+  value = settings->IsAutoFittingEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnablePlugins(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->ArePluginsEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnablePlugins( false );
+  value = settings->ArePluginsEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnablePrivateBrowsing(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsPrivateBrowsingEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnablePrivateBrowsing( false );
+  value = settings->IsPrivateBrowsingEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableLinkMagnifier(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsLinkMagnifierEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableLinkMagnifier( false );
+  value = settings->IsLinkMagnifierEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckUseKeypadWithoutUserAction(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsKeypadWithoutUserActionUsed();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->UseKeypadWithoutUserAction( false );
+  value = settings->IsKeypadWithoutUserActionUsed();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableAutofillPasswordForm(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 )
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsAutofillPasswordFormEnabled();
+  DALI_TEST_CHECK( value );
+  settings->EnableAutofillPasswordForm( false );
+  value = settings->IsAutofillPasswordFormEnabled();
+  DALI_TEST_CHECK( !value );
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableFormCandidateData(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsFormCandidateDataEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableFormCandidateData( false );
+  value = settings->IsFormCandidateDataEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableTextSelection(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsTextSelectionEnabled();
+  DALI_TEST_CHECK( value );
+
+  //Check Set/GetProperty
+  settings->EnableTextSelection(false);
+  value = settings->IsTextSelectionEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableTextAutosizing(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsTextAutosizingEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableTextAutosizing(false);
+  value = settings->IsTextAutosizingEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableArrowScroll(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsArrowScrollEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableArrowScroll(false);
+  value = settings->IsArrowScrollEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableClipboard(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsClipboardEnabled();
+  DALI_TEST_CHECK( value );
+  settings->EnableClipboard(false);
+  value = settings->IsClipboardEnabled();
+  DALI_TEST_CHECK( !value );
+  END_TEST;
+}
+
+int UtcDaliWebSettingsCheckEnableImePanel(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK( view );
+
+  Dali::Toolkit::WebSettings* settings = view.GetSettings();
+  DALI_TEST_CHECK( settings != 0 );
+
+  // Reset something
+  settings->AllowMixedContents( false );
+  settings->EnableSpatialNavigation( false );
+  settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
+  settings->AllowFileAccessFromExternalUrl( false );
+  settings->AllowScriptsOpenWindows( false );
+
+  // Check default value is true or not
+  bool value = settings->IsImePanelEnabled();
+  DALI_TEST_CHECK( value );
+
+  // Check Set/GetProperty
+  settings->EnableImePanel(false);
+  value = settings->IsImePanelEnabled();
+  DALI_TEST_CHECK( !value );
+
+  END_TEST;
+}
+
 int UtcDaliWebSettingsCheckAllowImagesLoadAutomatically(void)
 {
   ToolkitTestApplication application;
@@ -735,6 +1192,9 @@ int UtcDaliWebSettingsCheckAllowImagesLoadAutomatically(void)
   settings->AllowMixedContents( false );
   settings->EnableSpatialNavigation( false );
   settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
   settings->AllowFileAccessFromExternalUrl( false );
   settings->AllowScriptsOpenWindows( false );
 
@@ -767,6 +1227,9 @@ int UtcDaliWebSettingsGetSetDefaultTextEncodingName(void)
   settings->AllowMixedContents( false );
   settings->EnableSpatialNavigation( false );
   settings->EnableWebSecurity( false );
+  settings->EnableCacheBuilder( false );
+  settings->EnableDoNotTrack( false );
+  settings->UseScrollbarThumbFocusNotifications( false );
   settings->AllowFileAccessFromExternalUrl( false );
   settings->AllowScriptsOpenWindows( false );
 
index 840ff92..a7bc0e6 100644 (file)
@@ -515,6 +515,11 @@ IF( ENABLE_COVERAGE )
   ENDIF( LCOV_BIN )
 ENDIF()
 
+IF ( BUILD_SCENE_LOADER )
+  ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/dali-scene-loader )
+ENDIF()
+
+
 # Build documentation if doxygen tool is available
 SET( doxygenEnabled OFF )
 IF( DOXYGEN_FOUND )
@@ -527,14 +532,29 @@ IF( DOXYGEN_FOUND )
   SET( DOXYGEN_INTERNAL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs-internal )
   CONFIGURE_FILE( ${DOXYGEN_SRC_DIR}/dali.doxy.in ${DOXYGEN_SRC_DIR}/dali.doxy @ONLY )
   CONFIGURE_FILE( ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy.in ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy @ONLY )
-  ADD_CUSTOM_TARGET( doc_doxygen ALL
-                     DEPENDS ${name}
-                     COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
-                     COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
-                     COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
-                     COMMENT "Generating API documentation with Doxygen"
-                     WORKING_DIRECTORY ${DOXYGEN_SRC_DIR}
-                     VERBATIM )
+
+  IF ( BUILD_SCENE_LOADER )
+    ADD_CUSTOM_TARGET( doc_doxygen ALL
+      DEPENDS ${name} dali2-scene-loader
+      COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
+      COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
+      COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
+      COMMENT "Generating API documentation with Doxygen"
+      WORKING_DIRECTORY ${DOXYGEN_SRC_DIR}
+      VERBATIM )
+  ELSE()
+    ADD_CUSTOM_TARGET( doc_doxygen ALL
+      DEPENDS ${name}
+      COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
+      COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
+      COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
+      COMMENT "Generating API documentation with Doxygen"
+      WORKING_DIRECTORY ${DOXYGEN_SRC_DIR}
+      VERBATIM )
+  ENDIF()
+
+  # Following target is optional - it doesn't run by default
+  # Build using "make doc_doxygen_internal".
   ADD_CUSTOM_TARGET( doc_doxygen_internal
                      COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy
                      COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy
@@ -549,9 +569,6 @@ IF( CONFIGURE_AUTOMATED_TESTS )
                   ${ROOT_SRC_DIR}/automated-tests/CMakeLists.txt @ONLY )
 ENDIF()
 
-IF ( BUILD_SCENE_LOADER )
-  ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/dali-scene-loader )
-ENDIF()
 
 # Configuration Messages
 MESSAGE( STATUS "Configuration:\n" )
index 1d6036f..5364753 100644 (file)
@@ -2368,7 +2368,7 @@ EXTERNAL_PAGES         = YES
 # interpreter (i.e. the result of 'which perl').
 # The default file (with absolute path) is: /usr/bin/perl.
 
-PERL_PATH              = /usr/bin/perl
+#PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
 # Configuration options related to the dot tool
@@ -2390,7 +2390,7 @@ CLASS_DIAGRAMS         = YES
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
 # default search path.
 
-MSCGEN_PATH            =
+#MSCGEN_PATH            =
 
 # You can include diagrams made with dia in doxygen documentation. Doxygen will
 # then run dia to produce the diagram and insert it in the documentation. The
index 0a9d553..8ef9112 100644 (file)
@@ -2348,7 +2348,7 @@ EXTERNAL_PAGES         = YES
 # interpreter (i.e. the result of 'which perl').
 # The default file (with absolute path) is: /usr/bin/perl.
 
-PERL_PATH              = /usr/bin/perl
+#PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
 # Configuration options related to the dot tool
@@ -2370,7 +2370,7 @@ CLASS_DIAGRAMS         = YES
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
 # default search path.
 
-MSCGEN_PATH            =
+#MSCGEN_PATH            =
 
 # You can include diagrams made with dia in doxygen documentation. Doxygen will
 # then run dia to produce the diagram and insert it in the documentation. The
diff --git a/dali-toolkit/devel-api/controls/accessible-impl.cpp b/dali-toolkit/devel-api/controls/accessible-impl.cpp
new file mode 100644 (file)
index 0000000..f986bd4
--- /dev/null
@@ -0,0 +1,421 @@
+/*
+ * 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 "accessible-impl.h"
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
+
+namespace Dali::Toolkit::DevelControl {
+
+AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
+: self(self),
+  modal(modal)
+{
+  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())
+    {
+      return;
+    }
+
+    if(index == DevelControl::Property::ACCESSIBILITY_NAME || (index == GetNamePropertyIndex() && !controlImpl.mAccessibilityNameSet))
+    {
+      if(controlImpl.mAccessibilityGetNameSignal.Empty())
+      {
+        Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
+      }
+    }
+
+    if(index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION || (index == GetDescriptionPropertyIndex() && !controlImpl.mAccessibilityDescriptionSet))
+    {
+      if(controlImpl.mAccessibilityGetDescriptionSignal.Empty())
+      {
+        Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
+      }
+    }
+  });
+}
+
+std::string AccessibleImpl::GetName()
+{
+  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.mAccessibilityGetNameSignal.Empty())
+  {
+    std::string ret;
+    controlImpl.mAccessibilityGetNameSignal.Emit(ret);
+    return ret;
+  }
+
+  if(controlImpl.mAccessibilityNameSet)
+    return controlImpl.mAccessibilityName;
+
+  if(auto raw = GetNameRaw(); !raw.empty())
+    return raw;
+
+  return self.GetProperty<std::string>(Actor::Property::NAME);
+}
+
+std::string AccessibleImpl::GetNameRaw()
+{
+  return {};
+}
+
+std::string AccessibleImpl::GetDescription()
+{
+  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.mAccessibilityGetDescriptionSignal.Empty())
+  {
+    std::string ret;
+    controlImpl.mAccessibilityGetDescriptionSignal.Emit(ret);
+    return ret;
+  }
+
+  if(controlImpl.mAccessibilityDescriptionSet)
+    return controlImpl.mAccessibilityDescription;
+
+  return GetDescriptionRaw();
+}
+
+std::string AccessibleImpl::GetDescriptionRaw()
+{
+  return "";
+}
+
+Dali::Accessibility::Accessible* AccessibleImpl::GetParent()
+{
+  return Dali::Accessibility::Accessible::Get(self.GetParent());
+}
+
+size_t AccessibleImpl::GetChildCount()
+{
+  return self.GetChildCount();
+}
+
+Dali::Accessibility::Accessible* AccessibleImpl::GetChildAtIndex(size_t index)
+{
+  return Dali::Accessibility::Accessible::Get(self.GetChildAt(static_cast<unsigned int>(index)));
+}
+
+size_t AccessibleImpl::GetIndexInParent()
+{
+  auto s      = self;
+  auto parent = s.GetParent();
+  DALI_ASSERT_ALWAYS(parent && "can't call GetIndexInParent on object without parent");
+  auto count = parent.GetChildCount();
+  for(auto i = 0u; i < count; ++i)
+  {
+    auto c = parent.GetChildAt(i);
+    if(c == s)
+      return i;
+  }
+  DALI_ASSERT_ALWAYS(false && "object isn't child of it's parent");
+  return static_cast<size_t>(-1);
+}
+
+Dali::Accessibility::Role AccessibleImpl::GetRole()
+{
+  return self.GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
+}
+
+Dali::Accessibility::States AccessibleImpl::CalculateStates()
+{
+  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;
+  if(self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE).GetType() == Dali::Property::NONE)
+    s[Dali::Accessibility::State::HIGHLIGHTABLE] = false;
+  else
+    s[Dali::Accessibility::State::HIGHLIGHTABLE] = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE).Get<bool>();
+  s[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self;
+  s[Dali::Accessibility::State::ENABLED]     = true;
+  s[Dali::Accessibility::State::SENSITIVE]   = true;
+  s[Dali::Accessibility::State::ANIMATED]    = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED).Get<bool>();
+  s[Dali::Accessibility::State::VISIBLE]     = true;
+  if(modal)
+  {
+    s[Dali::Accessibility::State::MODAL] = true;
+  }
+  s[Dali::Accessibility::State::SHOWING] = !self.GetProperty(Dali::DevelActor::Property::CULLED).Get<bool>() && self.GetCurrentProperty<bool>(Actor::Property::VISIBLE);
+
+  s[Dali::Accessibility::State::DEFUNCT] = !self.GetProperty(Dali::DevelActor::Property::CONNECTED_TO_SCENE).Get<bool>();
+  return s;
+}
+
+Dali::Accessibility::States AccessibleImpl::GetStates()
+{
+  return CalculateStates();
+}
+
+Dali::Accessibility::Attributes AccessibleImpl::GetAttributes()
+{
+  std::unordered_map<std::string, std::string> attribute_map;
+  auto                                         q = Dali::Toolkit::Control::DownCast(self);
+  auto                                         w =
+    q.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
+  auto z = w.GetMap();
+
+  if(z)
+  {
+    auto map_size = z->Count();
+
+    for(unsigned int i = 0; i < map_size; i++)
+    {
+      auto map_key = z->GetKeyAt(i);
+      if(map_key.type == Dali::Property::Key::STRING)
+      {
+        std::string map_value;
+        if(z->GetValue(i).Get(map_value))
+        {
+          attribute_map.emplace(std::move(map_key.stringKey),
+                                std::move(map_value));
+        }
+      }
+    }
+  }
+
+  return attribute_map;
+}
+
+Dali::Accessibility::ComponentLayer AccessibleImpl::GetLayer()
+{
+  return Dali::Accessibility::ComponentLayer::WINDOW;
+}
+
+Dali::Rect<> AccessibleImpl::GetExtents(Dali::Accessibility::CoordType ctype)
+{
+  Vector2 screenPosition =
+    self.GetProperty(Dali::DevelActor::Property::SCREEN_POSITION)
+      .Get<Vector2>();
+  auto size = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
+  bool positionUsesAnchorPoint =
+    self.GetProperty(Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT)
+      .Get<bool>();
+  Vector3 anchorPointOffSet =
+    size * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT)
+                                    : AnchorPoint::TOP_LEFT);
+  Vector2 position = Vector2(screenPosition.x - anchorPointOffSet.x,
+                             screenPosition.y - anchorPointOffSet.y);
+
+  return {position.x, position.y, size.x, size.y};
+}
+
+int16_t AccessibleImpl::GetMdiZOrder()
+{
+  return 0;
+}
+double AccessibleImpl::GetAlpha()
+{
+  return 0;
+}
+
+bool AccessibleImpl::GrabFocus()
+{
+  return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(self);
+}
+
+static Dali::Actor CreateHighlightIndicatorActor()
+{
+  std::string focusBorderImagePath(AssetManager::GetDaliImagePath());
+  focusBorderImagePath += "/keyboard_focus.9.png";
+  // Create the default if it hasn't been set and one that's shared by all the
+  // keyboard focusable actors
+  auto actor = Toolkit::ImageView::New(focusBorderImagePath);
+  actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+  DevelControl::AppendAccessibilityAttribute(actor, "highlight", "");
+  actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED, true);
+  actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false);
+
+  return actor;
+}
+
+bool AccessibleImpl::GrabHighlight()
+{
+  auto old = GetCurrentlyHighlightedActor();
+
+  if(!Dali::Accessibility::IsUp())
+    return false;
+  if(self == old)
+    return true;
+  if(old)
+  {
+    auto c = dynamic_cast<Dali::Accessibility::Component*>(Internal::Control::Impl::GetAccessibilityObject(old));
+    if(c)
+      c->ClearHighlight();
+  }
+  auto highlight = GetHighlightActor();
+  if(!highlight)
+  {
+    highlight = CreateHighlightIndicatorActor();
+    SetHighlightActor(highlight);
+  }
+  highlight.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  highlight.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  highlight.SetProperty(Actor::Property::POSITION_Z, 1.0f);
+  highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+
+  EnsureSelfVisible();
+  self.Add(highlight);
+  SetCurrentlyHighlightedActor(self);
+  EmitHighlighted(true);
+
+  return true;
+}
+
+bool AccessibleImpl::ClearHighlight()
+{
+  if(!Dali::Accessibility::IsUp())
+    return false;
+  if(GetCurrentlyHighlightedActor() == self)
+  {
+    self.Remove(GetHighlightActor());
+    SetCurrentlyHighlightedActor({});
+    EmitHighlighted(false);
+    return true;
+  }
+  return false;
+}
+
+std::string AccessibleImpl::GetActionName(size_t index)
+{
+  if(index >= GetActionCount()) return "";
+  Dali::TypeInfo type;
+  self.GetTypeInfo(type);
+  DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
+  return type.GetActionName(index);
+}
+
+std::string AccessibleImpl::GetLocalizedActionName(size_t index)
+{
+  // TODO: add localization
+  return GetActionName(index);
+}
+
+std::string AccessibleImpl::GetActionDescription(size_t index)
+{
+  return "";
+}
+
+size_t AccessibleImpl::GetActionCount()
+{
+  Dali::TypeInfo type;
+  self.GetTypeInfo(type);
+  DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
+  return type.GetActionCount();
+}
+
+std::string AccessibleImpl::GetActionKeyBinding(size_t index)
+{
+  return "";
+}
+
+bool AccessibleImpl::DoAction(size_t index)
+{
+  std::string actionName = GetActionName(index);
+  return self.DoAction(actionName, {});
+}
+
+bool AccessibleImpl::DoAction(const std::string& name)
+{
+  return self.DoAction(name, {});
+}
+
+bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
+{
+  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.mAccessibilityDoGestureSignal.Empty())
+  {
+    auto ret = std::make_pair(gestureInfo, false);
+    controlImpl.mAccessibilityDoGestureSignal.Emit(ret);
+    return ret.second;
+  }
+
+  return false;
+}
+
+std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
+{
+  auto control = Dali::Toolkit::Control::DownCast(self);
+
+  Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
+  Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
+
+  std::vector<Dali::Accessibility::Relation> ret;
+
+  auto& v = controlImpl.mAccessibilityRelations;
+  for(auto i = 0u; i < v.size(); ++i)
+  {
+    if(v[i].empty())
+      continue;
+
+    ret.emplace_back(Accessibility::Relation{static_cast<Accessibility::RelationType>(i), v[i]});
+  }
+
+  return ret;
+}
+
+void AccessibleImpl::EnsureChildVisible(Actor child)
+{
+}
+
+void AccessibleImpl::EnsureSelfVisible()
+{
+  auto parent = dynamic_cast<AccessibleImpl*>(GetParent());
+  if(parent)
+  {
+    parent->EnsureChildVisible(self);
+  }
+}
+
+Dali::Property::Index AccessibleImpl::GetNamePropertyIndex()
+{
+  return Actor::Property::NAME;
+}
+
+Dali::Property::Index AccessibleImpl::GetDescriptionPropertyIndex()
+{
+  return Dali::Property::INVALID_INDEX;
+}
+
+} // namespace Dali::Toolkit::DevelControl
diff --git a/dali-toolkit/devel-api/controls/accessible-impl.h b/dali-toolkit/devel-api/controls/accessible-impl.h
new file mode 100644 (file)
index 0000000..feffe75
--- /dev/null
@@ -0,0 +1,217 @@
+#ifndef DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#define DALI_TOOLKIT_ACCESSIBLE_IMPL_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 <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+
+namespace Dali::Toolkit::DevelControl {
+
+/**
+ * @brief Represents the Accessible object for Dali::Toolkit::Control and derived classes
+ *
+ * You can create a derived class (and register it using SetAccessibilityConstructor)
+ * in order to customize Accessibility for a given control.
+ *
+ * @see Dali::Toolkit::DevelControl::SetAccessibilityConstructor
+ * @see Dali::Accessibility::Accessible
+ * @see Dali::Accessibility::Component
+ * @see Dali::Accessibility::Collection
+ * @see Dali::Accessibility::Action
+ * @see Dali::Accessibility::Value
+ * @see Dali::Accessibility::Text
+ * @see Dali::Accessibility::EditableText
+ */
+struct DALI_TOOLKIT_API AccessibleImpl : public virtual Dali::Accessibility::Accessible,
+                                         public virtual Dali::Accessibility::Component,
+                                         public virtual Dali::Accessibility::Collection,
+                                         public virtual Dali::Accessibility::Action
+{
+  Dali::Actor self;
+  bool        modal = false, root = false;
+
+  AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetName()
+   */
+  std::string GetName() override;
+
+  /**
+   * @brief Returns the actor's name in the absence of ACCESSIBILITY_NAME property
+   */
+  virtual std::string GetNameRaw();
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetDescription()
+   */
+  std::string GetDescription() override;
+
+  /**
+   * @brief Returns the actor's description in the absence of ACCESSIBILITY_DESCRIPTION property
+   */
+  virtual std::string GetDescriptionRaw();
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetParent()
+   */
+  Dali::Accessibility::Accessible* GetParent() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetChildCount()
+   */
+  size_t GetChildCount() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetChildAtIndex()
+   */
+  Dali::Accessibility::Accessible* GetChildAtIndex(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetIndexInParent()
+   */
+  size_t GetIndexInParent() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetRole()
+   */
+  Dali::Accessibility::Role GetRole() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetStates()
+   */
+  Dali::Accessibility::States GetStates() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetAttributes()
+   */
+  Dali::Accessibility::Attributes GetAttributes() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetExtents()
+   */
+  Dali::Rect<> GetExtents(Dali::Accessibility::CoordType ctype) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetLayer()
+   */
+  Dali::Accessibility::ComponentLayer GetLayer() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetMdiZOrder()
+   */
+  int16_t GetMdiZOrder() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GrabFocus()
+   */
+  bool GrabFocus() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetAlpha()
+   */
+  double GetAlpha() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GrabHighlight()
+   */
+  bool GrabHighlight() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::ClearHighlight()
+   */
+  bool ClearHighlight() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::GetActionName()
+   */
+  std::string GetActionName(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::GetLocalizedActionName()
+   */
+  std::string GetLocalizedActionName(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::GetActionDescription()
+   */
+  std::string GetActionDescription(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::GetActionCount()
+   */
+  size_t GetActionCount() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::GetActionKeyBinding()
+   */
+  std::string GetActionKeyBinding(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::DoAction(size_t)
+   */
+  bool DoAction(size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Action::DoAction(const std::string&)
+   */
+  bool DoAction(const std::string& name) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::DoGesture()
+   */
+  bool DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetRelationSet()
+   */
+  std::vector<Dali::Accessibility::Relation> GetRelationSet() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetStates()
+   */
+  virtual Dali::Accessibility::States CalculateStates();
+
+  /**
+   * @brief Makes sure that a given child of this container (e.g. ItemView) is visible
+   */
+  virtual void EnsureChildVisible(Actor child);
+
+  /**
+   * @brief Makes sure this actor is visible (when moving the highlight frame to an
+   * actor that is scrolled out of the viewport)
+   */
+  virtual void EnsureSelfVisible();
+
+  /**
+   * @brief Returns the index of the property that represents this actor's name
+   */
+  virtual Dali::Property::Index GetNamePropertyIndex();
+
+  /**
+   * @brief Returns the index of the property that represents this actor's description
+   */
+  virtual Dali::Property::Index GetDescriptionPropertyIndex();
+};
+
+} // namespace Dali::Toolkit::DevelControl
+
+#endif // DALI_TOOLKIT_ACCESSIBLE_IMPL_H
index c9d13f2..3d340ec 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/accessible-impl.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 #include <dali-toolkit/public-api/controls/control.h>
 
old mode 100644 (file)
new mode 100755 (executable)
index bdd191a..d39a93e
@@ -59,6 +59,21 @@ void WebSettings::EnableWebSecurity(bool enabled)
   mWebEngineSettings.EnableWebSecurity(enabled);
 }
 
+void WebSettings::EnableCacheBuilder(bool enabled)
+{
+  mWebEngineSettings.EnableCacheBuilder(enabled);
+}
+
+void WebSettings::UseScrollbarThumbFocusNotifications(bool used)
+{
+  mWebEngineSettings.UseScrollbarThumbFocusNotifications(used);
+}
+
+void WebSettings::EnableDoNotTrack( bool enabled )
+{
+  mWebEngineSettings.EnableDoNotTrack(enabled);
+}
+
 void WebSettings::AllowFileAccessFromExternalUrl(bool allowed)
 {
   mWebEngineSettings.AllowFileAccessFromExternalUrl(allowed);
@@ -74,6 +89,126 @@ void WebSettings::EnableJavaScript(bool enabled)
   mWebEngineSettings.EnableJavaScript(enabled);
 }
 
+bool WebSettings::IsAutoFittingEnabled() const
+{
+  return mWebEngineSettings.IsAutoFittingEnabled();
+}
+
+void WebSettings::EnableAutoFitting(bool enabled)
+{
+  mWebEngineSettings.EnableAutoFitting(enabled);
+}
+
+bool WebSettings::ArePluginsEnabled() const
+{
+  return mWebEngineSettings.ArePluginsEnabled();
+}
+
+void WebSettings::EnablePlugins(bool enabled)
+{
+  mWebEngineSettings.EnablePlugins(enabled);
+}
+
+bool WebSettings::IsPrivateBrowsingEnabled() const
+{
+  return mWebEngineSettings.IsPrivateBrowsingEnabled();
+}
+
+void WebSettings::EnablePrivateBrowsing(bool enabled)
+{
+  mWebEngineSettings.EnablePrivateBrowsing(enabled);
+}
+
+bool WebSettings::IsLinkMagnifierEnabled() const
+{
+  return mWebEngineSettings.IsLinkMagnifierEnabled();
+}
+
+void WebSettings::EnableLinkMagnifier(bool enabled)
+{
+  mWebEngineSettings.EnableLinkMagnifier(enabled);
+}
+
+bool WebSettings::IsKeypadWithoutUserActionUsed() const
+{
+  return mWebEngineSettings.IsKeypadWithoutUserActionUsed();
+}
+
+void WebSettings::UseKeypadWithoutUserAction(bool used)
+{
+  mWebEngineSettings.UseKeypadWithoutUserAction(used);
+}
+
+bool WebSettings::IsAutofillPasswordFormEnabled() const
+{
+  return mWebEngineSettings.IsAutofillPasswordFormEnabled();
+}
+
+void WebSettings::EnableAutofillPasswordForm(bool enabled)
+{
+  mWebEngineSettings.EnableAutofillPasswordForm(enabled);
+}
+
+bool WebSettings::IsFormCandidateDataEnabled() const
+{
+  return mWebEngineSettings.IsFormCandidateDataEnabled();
+}
+
+void WebSettings::EnableFormCandidateData( bool enabled )
+{
+  mWebEngineSettings.EnableFormCandidateData(enabled);
+}
+
+bool WebSettings::IsTextSelectionEnabled() const
+{
+  return mWebEngineSettings.IsTextSelectionEnabled();
+}
+
+void WebSettings::EnableTextSelection( bool enabled )
+{
+  return mWebEngineSettings.EnableTextSelection(enabled);
+}
+
+bool WebSettings::IsTextAutosizingEnabled() const
+{
+  return mWebEngineSettings.IsTextAutosizingEnabled();
+}
+
+void WebSettings::EnableTextAutosizing( bool enabled )
+{
+  return mWebEngineSettings.EnableTextAutosizing(enabled);
+}
+
+bool WebSettings::IsArrowScrollEnabled() const
+{
+  return mWebEngineSettings.IsArrowScrollEnabled();
+}
+
+void WebSettings::EnableArrowScroll( bool enabled )
+{
+  return mWebEngineSettings.EnableArrowScroll(enabled);
+}
+
+bool WebSettings::IsClipboardEnabled() const
+{
+  return mWebEngineSettings.IsClipboardEnabled();
+}
+
+void WebSettings::EnableClipboard( bool enabled )
+{
+  return mWebEngineSettings.EnableClipboard(enabled);
+}
+
+bool WebSettings::IsImePanelEnabled() const
+{
+  return mWebEngineSettings.IsImePanelEnabled();
+}
+
+void WebSettings::EnableImePanel( bool enabled )
+{
+  return mWebEngineSettings.EnableImePanel(enabled);
+}
+
 void WebSettings::AllowScriptsOpenWindows(bool allowed)
 {
   mWebEngineSettings.AllowScriptsOpenWindows(allowed);
old mode 100644 (file)
new mode 100755 (executable)
index 4d24b58..ba8b1fa
@@ -96,6 +96,29 @@ public:
   void EnableWebSecurity(bool enabled);
 
   /**
+   * @brief Enables/disables cache builder.
+   *
+   * @param[in] enabled if true, to enable the cache builder
+   *       otherwise to disable
+   */
+  void EnableCacheBuilder( bool enabled );
+
+  /**
+   * @brief Used/Unused uses scrollbar thumb focus notifications. The default is used.
+   *
+   * @param[in] used True if uses scrollbar thumb focus notifications, false otherwise
+   */
+  void UseScrollbarThumbFocusNotifications ( bool used );
+
+  /**
+   * @brief Enable/disables do not track executing.
+   *
+   * @param[in] enabled if true, to enable do not track
+   *        otherwise to disable
+   */
+  void EnableDoNotTrack( bool enabled );
+
+  /**
    * @brief Allow/Disallow file access from external url
    *
    * @param[in] allowed if true, to allow file access from external url
@@ -118,6 +141,174 @@ public:
   void EnableJavaScript(bool enabled);
 
   /**
+   * @brief Returns whether auto fitting can be executable. The default is true.
+   *
+   * @return true if auto fitting executing is enabled, false otherwise
+   */
+  bool IsAutoFittingEnabled() const;
+
+   /**
+   * @brief Enables/disables auto fitting executing. The default is enabled.
+   *
+   * @param[in] enabled True if auto fitting executing is enabled, false otherwise
+   */
+  void EnableAutoFitting( bool enabled );
+
+  /**
+   * @brief Returns whether plugins can be executable. The default is true.
+   *
+   * @return true if plugins executing is enabled, false otherwise
+   */
+  bool ArePluginsEnabled() const;
+
+   /**
+   * @brief Enables/disables Plugins executing. The default is enabled.
+   *
+   * @param[in] enabled True if Plugins executing is enabled, false otherwise
+   */
+  void EnablePlugins( bool enabled );
+
+  /**
+   * @brief Returns whether private browsing can be executable. The default is true.
+   *
+   * @return true if private browsing executing is enabled, false otherwise
+   */
+  bool IsPrivateBrowsingEnabled() const;
+
+  /**
+   * @brief Enables/disables private browsing executing. The default is enabled.
+   *
+   * @param[in] enabled True if private browsing executing is enabled, false otherwise
+   */
+  void EnablePrivateBrowsing( bool enabled );
+
+  /**
+   * @brief Returns whether link magnifier can be executable. The default is true.
+   *
+   * @return true if link magnifier executing is enabled, false otherwise
+   */
+  bool IsLinkMagnifierEnabled() const;
+
+  /**
+   * @brief Enables/disables link magnifier executing. The default is enabled.
+   *
+   * @param[in] enabled True if link magnifier executing is enabled, false otherwise
+   */
+  void EnableLinkMagnifier( bool enabled );
+
+  /**
+   * @brief Returns whether uses keypad without user action can be executable. The default is true.
+   *
+   * @return true if keypad without user action executing is used, false otherwise
+   */
+  bool IsKeypadWithoutUserActionUsed() const;
+
+  /**
+   * @brief Uses/Unused keypad without user action executing. The default is used.
+   *
+   * @param[in] used True if keypad without user action executing is used, false otherwise
+   */
+  void UseKeypadWithoutUserAction( bool used );
+
+  /**
+   * @brief Returns whether autofill password form can be executable. The default is true.
+   *
+   * @return true if autofill password form executing is enabled, false otherwise
+   */
+  bool IsAutofillPasswordFormEnabled() const;
+
+  /**
+   * @brief Enables/disables autofill password form executing. The default is enabled.
+   *
+   * @param[in] enabled True if autofill password form executing is enabled, false otherwise
+   */
+  void EnableAutofillPasswordForm( bool enabled );
+
+  /**
+   * @brief Returns whether form candidate data can be executable. The default is true.
+   *
+   * @return true if form candidate data executing is enabled, false otherwise
+   */
+  bool IsFormCandidateDataEnabled() const;
+
+  /**
+   * @brief Enables/disables form candidate data executing. The default is enabled.
+   *
+   * @param[in] enabled True if form candidate data executing is enabled, false otherwise
+   */
+  void EnableFormCandidateData( bool enabled );
+
+  /**
+   * @brief Returns whether text selection can be executable. The default is true.
+   *
+   * @return true if text selection executing is enabled, false otherwise
+   */
+  bool IsTextSelectionEnabled() const;
+
+  /**
+   * brief Enables/disables text selection executing. The default is enabled.
+   *
+   * @param[in] enabled True if text selection executing is enabled, false otherwise
+   */
+  void EnableTextSelection( bool enabled );
+
+  /**
+   * @brief Returns whether text autosizing can be executable. The default is true.
+   *
+   * @return true if text autosizing executing is enabled, false otherwise
+   */
+  bool IsTextAutosizingEnabled() const;
+
+  /**
+   * @brief Enables/disables text autosizing executing. The default is enabled.
+   *
+   * @param[in] enabled True if text autosizing executing is enabled, false otherwise
+   */
+  void EnableTextAutosizing( bool enabled );
+
+  /**
+   * @brief Returns whether arrow scroll can be executable. The default is true.
+   *
+   * @return true if arrow scroll executing is enabled, false otherwise
+   */
+  bool IsArrowScrollEnabled() const;
+
+  /**
+   * @brief Enables/disables arrow scroll executing. The default is enabled.
+   *
+   * @param[in] enabled True if arrow scroll executing is enabled, false otherwise
+   */
+  void EnableArrowScroll( bool enabled );
+
+  /**
+   * @brief Returns whether clipboard can be executable. The default is true.
+   *
+   * @return true if clipboard executing is enabled, false otherwise
+   */
+  bool IsClipboardEnabled() const;
+
+  /**
+   * @brief Enables/disables clipboard executing. The default is enabled.
+   *
+   * @param[in] enabled True if clipboard is enabled, false otherwise
+   */
+  void EnableClipboard( bool enabled );
+
+  /**
+   * @brief Returns whether ime panel can be executable. The default is true.
+   *
+   * @return true if ime panel executing is enabled, false otherwise
+   */
+  bool IsImePanelEnabled() const;
+
+  /**
+   * @brief Enables/disables ime panel executing. The default is enabled.
+   *
+   * @param[in] enabled True if ime panel executing is enabled, false otherwise
+   */
+  void EnableImePanel( bool enabled );
+
+  /**
    * @brief Allow if the scripts can open new windows.
    *
    * @param[in] allowed if true, the scripts can open new windows,
index c3a9d40..201f280 100644 (file)
@@ -164,9 +164,34 @@ void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName,
   Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
 }
 
-void WebView::ClearAllTilesResources()
+void WebView::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+{
+  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptAlertCallback( callback );
+}
+
+void WebView::JavaScriptAlertReply()
+{
+  Dali::Toolkit::GetImpl( *this ).JavaScriptAlertReply();
+}
+
+void WebView::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+{
+  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptConfirmCallback( callback );
+}
+
+void WebView::JavaScriptConfirmReply( bool confirmed )
+{
+  Dali::Toolkit::GetImpl( *this ).JavaScriptConfirmReply( confirmed );
+}
+
+void WebView::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
 {
-  Dali::Toolkit::GetImpl(*this).ClearAllTilesResources();
+  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptPromptCallback( callback );
+}
+
+void WebView::JavaScriptPromptReply( const std::string& result )
+{
+  Dali::Toolkit::GetImpl( *this ).JavaScriptPromptReply( result );
 }
 
 void WebView::ClearHistory()
@@ -174,11 +199,21 @@ void WebView::ClearHistory()
   Dali::Toolkit::GetImpl(*this).ClearHistory();
 }
 
+void WebView::ClearAllTilesResources()
+{
+  Dali::Toolkit::GetImpl( *this ).ClearAllTilesResources();
+}
+
 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
 {
   return Dali::Toolkit::GetImpl(*this).PageLoadStartedSignal();
 }
 
+WebView::WebViewPageLoadSignalType& WebView::PageLoadInProgressSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).PageLoadInProgressSignal();
+}
+
 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
 {
   return Dali::Toolkit::GetImpl(*this).PageLoadFinishedSignal();
@@ -194,6 +229,11 @@ WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
   return Dali::Toolkit::GetImpl(*this).ScrollEdgeReachedSignal();
 }
 
+WebView::WebViewUrlChangedSignalType& WebView::UrlChangedSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).UrlChangedSignal();
+}
+
 WebView::WebView(Internal::WebView& implementation)
 : Control(implementation)
 {
index 8c842b7..13ce3c0 100644 (file)
@@ -157,6 +157,11 @@ public:
    */
   using WebViewScrollEdgeReachedSignalType = Signal<void(WebView, Dali::WebEnginePlugin::ScrollEdge)>;
 
+  /**
+   * @brief WebView signal type related with url changed.
+   */
+  using WebViewUrlChangedSignalType = Signal<void(WebView, const std::string&)>;
+
 public:
   /**
    * @brief Creates an initialized WebView.
@@ -354,9 +359,42 @@ public:
   void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler);
 
   /**
-   * @brief Clears all tiles resources of Web.
+   * @brief Register alert callback for javascript.
+   *
+   * @param[in] callback The callback function to be called by the JavaScript runtime.
    */
-  void ClearAllTilesResources();
+  void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
+
+  /**
+   * @brief Reply for JavaScript alert.
+   */
+  void JavaScriptAlertReply();
+
+  /**
+   * @brief Register confirm callback for javascript.
+   *
+   * @param[in] callback The callback function to be called by the JavaScript runtime.
+   */
+  void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
+
+  /**
+   * @brief Reply for JavaScript confirm.
+   * @param[in] confirmed True if confirmed, false otherwise
+   */
+  void JavaScriptConfirmReply(bool confirmed);
+
+  /**
+   * @brief Register prompt callback for javascript.
+   *
+   * @param[in] callback The callback function to be called by the JavaScript runtime.
+   */
+  void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
+
+  /**
+   * @brief Reply for JavaScript prompt.
+   * @param[in] result The result from input-field of prompt popup.
+   */
+  void JavaScriptPromptReply(const std::string& result);
 
   /**
    * @brief Clears the history of Web.
@@ -364,6 +402,11 @@ public:
   void ClearHistory();
 
   /**
+   * @brief Clears all tiles resources of Web.
+   */
+  void ClearAllTilesResources();
+
+  /**
    * @brief Connects to this signal to be notified when page loading is started.
    *
    * @return A signal object to connect with
@@ -371,6 +414,13 @@ public:
   WebViewPageLoadSignalType& PageLoadStartedSignal();
 
   /**
+   * @brief Connects 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.
    *
    * @return A signal object to connect with
@@ -391,6 +441,13 @@ public:
    */
   WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
 
+  /**
+   * @brief Connects to this signal to be notified when url is changed.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewUrlChangedSignalType& UrlChangedSignal();
+
 public: // Not intended for application developers
   /// @cond internal
   /**
index f43ca09..0e1ec7d 100755 (executable)
@@ -9,6 +9,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/builder/builder.cpp
   ${devel_api_src_dir}/builder/json-parser.cpp
   ${devel_api_src_dir}/builder/tree-node.cpp
+  ${devel_api_src_dir}/controls/accessible-impl.cpp
   ${devel_api_src_dir}/controls/control-devel.cpp
   ${devel_api_src_dir}/controls/control-wrapper.cpp
   ${devel_api_src_dir}/controls/control-wrapper-impl.cpp
@@ -81,6 +82,7 @@ SET( devel_api_accessibility-manager_header_files
 )
 
 SET( devel_api_controls_header_files
+  ${devel_api_src_dir}/controls/accessible-impl.h
   ${devel_api_src_dir}/controls/control-depth-index-ranges.h
   ${devel_api_src_dir}/controls/control-devel.h
   ${devel_api_src_dir}/controls/control-wrapper.h
index ac7a72f..1c2271c 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/size-negotiation/relayout-container.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 namespace Dali
 {
@@ -189,7 +189,7 @@ void Alignment::OnInitialize()
 {
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index b685219..55259db 100644 (file)
@@ -32,8 +32,8 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h>
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
@@ -219,7 +219,7 @@ void BloomView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::ANIMATION));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::ANIMATION));
   });
 }
 
index c242bc6..2b830fa 100644 (file)
@@ -1331,7 +1331,7 @@ Property::Index Button::AccessibleImpl::GetNamePropertyIndex()
 
 Dali::Accessibility::States Button::AccessibleImpl::CalculateStates()
 {
-  auto tmp                                    = Control::Impl::AccessibleImpl::CalculateStates();
+  auto tmp                                    = DevelControl::AccessibleImpl::CalculateStates();
   tmp[Dali::Accessibility::State::SELECTABLE] = true;
   auto slf                                    = Toolkit::Button::DownCast(self);
   tmp[Dali::Accessibility::State::ENABLED]    = !slf.GetProperty<bool>(Toolkit::Button::Property::DISABLED);
index 315e4c5..ced51fd 100644 (file)
@@ -24,8 +24,8 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 
 namespace Dali
@@ -535,9 +535,9 @@ private:
   bool mClickActionPerforming; ///< Used to manage signal emissions during action
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::AccessibleImpl
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     Dali::Accessibility::States CalculateStates() override;
     std::string                 GetNameRaw() override;
index ff1ca1e..1c48bc1 100644 (file)
@@ -463,8 +463,8 @@ Control::Impl::Impl(Control& controlImpl)
     });
 
   accessibilityConstructor = [](Dali::Actor actor) -> std::unique_ptr<Dali::Accessibility::Accessible> {
-    return std::unique_ptr<Dali::Accessibility::Accessible>(new AccessibleImpl(actor,
-                                                                               Dali::Accessibility::Role::UNKNOWN));
+    return std::unique_ptr<Dali::Accessibility::Accessible>(new DevelControl::AccessibleImpl(actor,
+                                                                                             Dali::Accessibility::Role::UNKNOWN));
   };
 
   size_t len = static_cast<size_t>(Dali::Accessibility::RelationType::MAX_COUNT);
@@ -1903,387 +1903,6 @@ Dali::Accessibility::Accessible* Control::Impl::GetAccessibilityObject(Dali::Act
   return nullptr;
 }
 
-Control::Impl::AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
-: self(self),
-  modal(modal)
-{
-  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())
-    {
-      return;
-    }
-
-    if(index == DevelControl::Property::ACCESSIBILITY_NAME || (index == GetNamePropertyIndex() && !controlImpl.mAccessibilityNameSet))
-    {
-      if(controlImpl.mAccessibilityGetNameSignal.Empty())
-      {
-        Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
-      }
-    }
-
-    if(index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION || (index == GetDescriptionPropertyIndex() && !controlImpl.mAccessibilityDescriptionSet))
-    {
-      if(controlImpl.mAccessibilityGetDescriptionSignal.Empty())
-      {
-        Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
-      }
-    }
-  });
-}
-
-std::string Control::Impl::AccessibleImpl::GetName()
-{
-  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.mAccessibilityGetNameSignal.Empty())
-  {
-    std::string ret;
-    controlImpl.mAccessibilityGetNameSignal.Emit(ret);
-    return ret;
-  }
-
-  if(controlImpl.mAccessibilityNameSet)
-    return controlImpl.mAccessibilityName;
-
-  if(auto raw = GetNameRaw(); !raw.empty())
-    return raw;
-
-  return self.GetProperty<std::string>(Actor::Property::NAME);
-}
-
-std::string Control::Impl::AccessibleImpl::GetNameRaw()
-{
-  return {};
-}
-
-std::string Control::Impl::AccessibleImpl::GetDescription()
-{
-  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.mAccessibilityGetDescriptionSignal.Empty())
-  {
-    std::string ret;
-    controlImpl.mAccessibilityGetDescriptionSignal.Emit(ret);
-    return ret;
-  }
-
-  if(controlImpl.mAccessibilityDescriptionSet)
-    return controlImpl.mAccessibilityDescription;
-
-  return GetDescriptionRaw();
-}
-
-std::string Control::Impl::AccessibleImpl::GetDescriptionRaw()
-{
-  return "";
-}
-
-Dali::Accessibility::Accessible* Control::Impl::AccessibleImpl::GetParent()
-{
-  return Dali::Accessibility::Accessible::Get(self.GetParent());
-}
-
-size_t Control::Impl::AccessibleImpl::GetChildCount()
-{
-  return self.GetChildCount();
-}
-
-Dali::Accessibility::Accessible* Control::Impl::AccessibleImpl::GetChildAtIndex(size_t index)
-{
-  return Dali::Accessibility::Accessible::Get(self.GetChildAt(static_cast<unsigned int>(index)));
-}
-
-size_t Control::Impl::AccessibleImpl::GetIndexInParent()
-{
-  auto s      = self;
-  auto parent = s.GetParent();
-  DALI_ASSERT_ALWAYS(parent && "can't call GetIndexInParent on object without parent");
-  auto count = parent.GetChildCount();
-  for(auto i = 0u; i < count; ++i)
-  {
-    auto c = parent.GetChildAt(i);
-    if(c == s)
-      return i;
-  }
-  DALI_ASSERT_ALWAYS(false && "object isn't child of it's parent");
-  return static_cast<size_t>(-1);
-}
-
-Dali::Accessibility::Role Control::Impl::AccessibleImpl::GetRole()
-{
-  return self.GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
-}
-
-Dali::Accessibility::States Control::Impl::AccessibleImpl::CalculateStates()
-{
-  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;
-  if(self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE).GetType() == Property::NONE)
-    s[Dali::Accessibility::State::HIGHLIGHTABLE] = false;
-  else
-    s[Dali::Accessibility::State::HIGHLIGHTABLE] = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE).Get<bool>();
-  s[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self;
-  s[Dali::Accessibility::State::ENABLED]     = true;
-  s[Dali::Accessibility::State::SENSITIVE]   = true;
-  s[Dali::Accessibility::State::ANIMATED]    = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED).Get<bool>();
-  s[Dali::Accessibility::State::VISIBLE]     = true;
-  if(modal)
-  {
-    s[Dali::Accessibility::State::MODAL] = true;
-  }
-  s[Dali::Accessibility::State::SHOWING] = !self.GetProperty(Dali::DevelActor::Property::CULLED).Get<bool>() && self.GetCurrentProperty<bool>(Actor::Property::VISIBLE);
-
-  s[Dali::Accessibility::State::DEFUNCT] = !self.GetProperty(Dali::DevelActor::Property::CONNECTED_TO_SCENE).Get<bool>();
-  return s;
-}
-
-Dali::Accessibility::States Control::Impl::AccessibleImpl::GetStates()
-{
-  return CalculateStates();
-}
-
-Dali::Accessibility::Attributes Control::Impl::AccessibleImpl::GetAttributes()
-{
-  std::unordered_map<std::string, std::string> attribute_map;
-  auto                                         q = Dali::Toolkit::Control::DownCast(self);
-  auto                                         w =
-    q.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
-  auto z = w.GetMap();
-
-  if(z)
-  {
-    auto map_size = z->Count();
-
-    for(unsigned int i = 0; i < map_size; i++)
-    {
-      auto map_key = z->GetKeyAt(i);
-      if(map_key.type == Property::Key::STRING)
-      {
-        std::string map_value;
-        if(z->GetValue(i).Get(map_value))
-        {
-          attribute_map.emplace(std::move(map_key.stringKey),
-                                std::move(map_value));
-        }
-      }
-    }
-  }
-
-  return attribute_map;
-}
-
-Dali::Accessibility::ComponentLayer Control::Impl::AccessibleImpl::GetLayer()
-{
-  return Dali::Accessibility::ComponentLayer::WINDOW;
-}
-
-Dali::Rect<> Control::Impl::AccessibleImpl::GetExtents(Dali::Accessibility::CoordType ctype)
-{
-  Vector2 screenPosition =
-    self.GetProperty(Dali::DevelActor::Property::SCREEN_POSITION)
-      .Get<Vector2>();
-  auto size = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
-  bool positionUsesAnchorPoint =
-    self.GetProperty(Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT)
-      .Get<bool>();
-  Vector3 anchorPointOffSet =
-    size * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT)
-                                    : AnchorPoint::TOP_LEFT);
-  Vector2 position = Vector2(screenPosition.x - anchorPointOffSet.x,
-                             screenPosition.y - anchorPointOffSet.y);
-
-  return {position.x, position.y, size.x, size.y};
-}
-
-int16_t Control::Impl::AccessibleImpl::GetMdiZOrder()
-{
-  return 0;
-}
-double Control::Impl::AccessibleImpl::GetAlpha()
-{
-  return 0;
-}
-
-bool Control::Impl::AccessibleImpl::GrabFocus()
-{
-  return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(self);
-}
-
-static Dali::Actor CreateHighlightIndicatorActor()
-{
-  std::string focusBorderImagePath(AssetManager::GetDaliImagePath());
-  focusBorderImagePath += "/keyboard_focus.9.png";
-  // Create the default if it hasn't been set and one that's shared by all the
-  // keyboard focusable actors
-  auto actor = Toolkit::ImageView::New(focusBorderImagePath);
-  actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
-  DevelControl::AppendAccessibilityAttribute(actor, "highlight", "");
-  actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED, true);
-  actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false);
-
-  return actor;
-}
-
-bool Control::Impl::AccessibleImpl::GrabHighlight()
-{
-  auto old = GetCurrentlyHighlightedActor();
-
-  if(!Dali::Accessibility::IsUp())
-    return false;
-  if(self == old)
-    return true;
-  if(old)
-  {
-    auto c = dynamic_cast<Dali::Accessibility::Component*>(GetAccessibilityObject(old));
-    if(c)
-      c->ClearHighlight();
-  }
-  auto highlight = GetHighlightActor();
-  if(!highlight)
-  {
-    highlight = CreateHighlightIndicatorActor();
-    SetHighlightActor(highlight);
-  }
-  highlight.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
-  highlight.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
-  highlight.SetProperty(Actor::Property::POSITION_Z, 1.0f);
-  highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
-
-  EnsureSelfVisible();
-  self.Add(highlight);
-  SetCurrentlyHighlightedActor(self);
-  EmitHighlighted(true);
-
-  return true;
-}
-
-bool Control::Impl::AccessibleImpl::ClearHighlight()
-{
-  if(!Dali::Accessibility::IsUp())
-    return false;
-  if(GetCurrentlyHighlightedActor() == self)
-  {
-    self.Remove(GetHighlightActor());
-    SetCurrentlyHighlightedActor({});
-    EmitHighlighted(false);
-    return true;
-  }
-  return false;
-}
-
-std::string Control::Impl::AccessibleImpl::GetActionName(size_t index)
-{
-  if(index >= GetActionCount()) return "";
-  Dali::TypeInfo type;
-  self.GetTypeInfo(type);
-  DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
-  return type.GetActionName(index);
-}
-std::string Control::Impl::AccessibleImpl::GetLocalizedActionName(size_t index)
-{
-  // TODO: add localization
-  return GetActionName(index);
-}
-std::string Control::Impl::AccessibleImpl::GetActionDescription(size_t index)
-{
-  return "";
-}
-size_t Control::Impl::AccessibleImpl::GetActionCount()
-{
-  Dali::TypeInfo type;
-  self.GetTypeInfo(type);
-  DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
-  return type.GetActionCount();
-}
-std::string Control::Impl::AccessibleImpl::GetActionKeyBinding(size_t index)
-{
-  return "";
-}
-bool Control::Impl::AccessibleImpl::DoAction(size_t index)
-{
-  std::string actionName = GetActionName(index);
-  return self.DoAction(actionName, {});
-}
-bool Control::Impl::AccessibleImpl::DoAction(const std::string& name)
-{
-  return self.DoAction(name, {});
-}
-
-bool Control::Impl::AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
-{
-  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.mAccessibilityDoGestureSignal.Empty())
-  {
-    auto ret = std::make_pair(gestureInfo, false);
-    controlImpl.mAccessibilityDoGestureSignal.Emit(ret);
-    return ret.second;
-  }
-
-  return false;
-}
-
-std::vector<Dali::Accessibility::Relation> Control::Impl::AccessibleImpl::GetRelationSet()
-{
-  auto control = Dali::Toolkit::Control::DownCast(self);
-
-  Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
-  Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
-
-  std::vector<Dali::Accessibility::Relation> ret;
-
-  auto& v = controlImpl.mAccessibilityRelations;
-  for(auto i = 0u; i < v.size(); ++i)
-  {
-    if(v[i].empty())
-      continue;
-
-    ret.emplace_back(Accessibility::Relation{static_cast<Accessibility::RelationType>(i), v[i]});
-  }
-
-  return ret;
-}
-
-void Control::Impl::AccessibleImpl::EnsureChildVisible(Actor child)
-{
-}
-
-void Control::Impl::AccessibleImpl::EnsureSelfVisible()
-{
-  auto parent = dynamic_cast<Control::Impl::AccessibleImpl*>(GetParent());
-  if(parent)
-  {
-    parent->EnsureChildVisible(self);
-  }
-}
-
-Property::Index Control::Impl::AccessibleImpl::GetNamePropertyIndex()
-{
-  return Actor::Property::NAME;
-}
-
-Property::Index Control::Impl::AccessibleImpl::GetDescriptionPropertyIndex()
-{
-  return Property::INVALID_INDEX;
-}
-
 void Control::Impl::PositionOrSizeChangedCallback(PropertyNotification& p)
 {
   auto self = Dali::Actor::DownCast(p.GetTarget());
index d944114..492461e 100644 (file)
@@ -69,6 +69,8 @@ typedef Dali::OwnerContainer<RegisteredVisual*> RegisteredVisualContainer;
  */
 class Control::Impl : public ConnectionTracker, public Visual::EventObserver
 {
+  friend class Toolkit::DevelControl::AccessibleImpl;
+
 public:
   /**
    * @brief Retrieves the implementation of the internal control class.
@@ -544,52 +546,6 @@ public:
   void AccessibilityRegister();
   void AccessibilityDeregister();
 
-  struct AccessibleImpl : public virtual Dali::Accessibility::Accessible,
-                          public virtual Dali::Accessibility::Component,
-                          public virtual Dali::Accessibility::Collection,
-                          public virtual Dali::Accessibility::Action
-  {
-    Dali::Actor self;
-    bool        modal = false, root = false;
-
-    AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
-
-    std::string                         GetName() override;
-    virtual std::string                 GetNameRaw();
-    std::string                         GetDescription() override;
-    virtual std::string                 GetDescriptionRaw();
-    Dali::Accessibility::Accessible*    GetParent() override;
-    size_t                              GetChildCount() override;
-    Dali::Accessibility::Accessible*    GetChildAtIndex(size_t index) override;
-    size_t                              GetIndexInParent() override;
-    Dali::Accessibility::Role           GetRole() override;
-    Dali::Accessibility::States         GetStates() override;
-    Dali::Accessibility::Attributes     GetAttributes() override;
-    Dali::Rect<>                        GetExtents(Dali::Accessibility::CoordType ctype) override;
-    Dali::Accessibility::ComponentLayer GetLayer() override;
-    int16_t                             GetMdiZOrder() override;
-    bool                                GrabFocus() override;
-    double                              GetAlpha() override;
-    bool                                GrabHighlight() override;
-    bool                                ClearHighlight() override;
-
-    std::string                                GetActionName(size_t index) override;
-    std::string                                GetLocalizedActionName(size_t index) override;
-    std::string                                GetActionDescription(size_t index) override;
-    size_t                                     GetActionCount() override;
-    std::string                                GetActionKeyBinding(size_t index) override;
-    bool                                       DoAction(size_t index) override;
-    bool                                       DoAction(const std::string& name) override;
-    bool                                       DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo) override;
-    std::vector<Dali::Accessibility::Relation> GetRelationSet() override;
-
-    virtual Dali::Accessibility::States CalculateStates();
-    virtual void                        EnsureChildVisible(Actor child);
-    virtual void                        EnsureSelfVisible();
-    virtual Property::Index             GetNamePropertyIndex();
-    virtual Property::Index             GetDescriptionPropertyIndex();
-  };
-
   std::function<std::unique_ptr<Dali::Accessibility::Accessible>(Actor)> accessibilityConstructor;
   std::unique_ptr<Dali::Accessibility::Accessible>                       accessibilityObject;
   Dali::PropertyNotification                                             accessibilityNotificationPosition, accessibilityNotificationSize, accessibilityNotificationCulled;
index 2bc36e0..88fa83f 100644 (file)
@@ -236,7 +236,7 @@ void EffectsView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 263d0c9..111e480 100644 (file)
@@ -28,8 +28,7 @@
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <sstream>
 
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 using namespace Dali;
 
@@ -837,7 +836,7 @@ void FlexContainer::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 961ff9f..29d36b1 100644 (file)
@@ -34,6 +34,7 @@
 #include <sstream>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
@@ -296,7 +297,7 @@ void GaussianBlurView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
@@ -560,7 +561,7 @@ void GaussianBlurView::SetShaderConstants()
   uvOffsets[0].x            = 0.0f;
   uvOffsets[0].y            = 0.0f;
 
-  for(i = 0; i < mNumSamples >> 1; i++)
+  for(i = 0; i<mNumSamples >> 1; i++)
   {
     w                     = CalcGaussianWeight((float)(i + 1));
     weights[(i << 1) + 1] = w;
index 091e341..513960f 100644 (file)
@@ -95,7 +95,7 @@ void ImageView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
   });
 
   //Enable highightability
index 11fa7a7..e37a534 100644 (file)
@@ -28,6 +28,7 @@
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
@@ -219,7 +220,7 @@ void Magnifier::Initialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 492f529..f9bf491 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/object/type-registry.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/model3d-view/obj-loader.h>
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
@@ -281,7 +282,7 @@ void Model3dView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
   });
 }
 
index 47906cd..3dd6909 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 namespace Dali
 {
@@ -72,7 +72,7 @@ void NavigationView::OnInitialize()
 {
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 974dbcf..d74574c 100644 (file)
@@ -27,6 +27,7 @@
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h>
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
@@ -415,7 +416,7 @@ void PageTurnView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
   });
 }
 
index 768a978..edb0929 100644 (file)
@@ -36,6 +36,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -2025,7 +2026,7 @@ std::string Popup::AccessibleImpl::GetNameRaw()
 
 Dali::Accessibility::States Popup::AccessibleImpl::CalculateStates()
 {
-  auto states       = Control::Impl::AccessibleImpl::CalculateStates();
+  auto states       = DevelControl::AccessibleImpl::CalculateStates();
   auto popup        = Toolkit::Popup::DownCast(self);
   auto displayState = popup.GetProperty<std::string>(Toolkit::Popup::Property::DISPLAY_STATE);
 
index 5d9eae3..630caa8 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
 #include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
@@ -240,9 +241,9 @@ public:
   static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::AccessibleImpl
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     std::string                 GetNameRaw() override;
     Dali::Accessibility::States CalculateStates() override;
index 12ccab6..2df2b77 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/public-api/align-enumerations.h>
index f806926..9ff203a 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
@@ -261,10 +262,10 @@ private:
   Property::Map           mSecondaryProgressVisualMap;    ///< To backup visual properties when switching determinate/indeterminate.
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Value
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
     double GetMinimum() override;
     double GetCurrent() override;
     double GetMaximum() override;
index 4701d6c..5716c5e 100644 (file)
@@ -31,6 +31,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
index be77d6c..abb5200 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/public-api/object/weak-handle.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -312,10 +313,10 @@ private:
   bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Value
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
     double GetMinimum() override;
     double GetCurrent() override;
     double GetMaximum() override;
index 73ff256..4240a1e 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/animation/alpha-function.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
@@ -116,9 +117,9 @@ public:
   virtual void SetOvershootSize(const Vector2& size) = 0;
 
 protected: // From Control
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::AccessibleImpl
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     bool IsScrollable() override;
   };
index 6440bb0..612a9a4 100644 (file)
@@ -30,6 +30,7 @@
 #include <sstream>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
@@ -257,7 +258,7 @@ void ShadowView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 6829485..34da9ff 100644 (file)
@@ -28,6 +28,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
index 6e2a324..134b9f2 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -747,10 +748,10 @@ private:
     mSnapToMarks : 1;  ///< Turn on or off snapping to marks
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Value
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
     double GetMinimum() override;
     double GetCurrent() override;
     double GetMaximum() override;
index b1e60c7..6325e62 100644 (file)
@@ -151,7 +151,7 @@ void SuperBlurView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index f5c3cc4..4b3e019 100644 (file)
@@ -29,7 +29,7 @@
 #include <sstream>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 using namespace Dali;
 
@@ -1121,7 +1121,7 @@ void TableView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::TABLE));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TABLE));
   });
 }
 
index 22880d3..3d48333 100644 (file)
@@ -36,6 +36,7 @@
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/devel-api/text/rendering-backend.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
@@ -1381,6 +1382,14 @@ float TextEditor::GetHeightForWidth(float width)
   return mController->GetHeightForWidth(width) + padding.top + padding.bottom;
 }
 
+void TextEditor::ResizeActor(Actor& actor, const Vector2& size)
+{
+  if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+  {
+    actor.SetProperty(Actor::Property::SIZE, size);
+  }
+}
+
 void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
 {
   DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
@@ -1410,10 +1419,12 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
   if(mStencil)
   {
     mStencil.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+    ResizeActor(mStencil, contentSize);
   }
   if(mActiveLayer)
   {
     mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+    ResizeActor(mActiveLayer, contentSize);
   }
 
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
@@ -1426,7 +1437,7 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
     if(mDecorator &&
        (Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
     {
-      mDecorator->Relayout(size);
+      mDecorator->Relayout(contentSize);
     }
 
     if(!mRenderer)
@@ -1435,6 +1446,14 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
     }
 
     RenderText(updateTextType);
+
+    // If there is text changed, callback is called.
+    if(mTextChanged)
+    {
+      Dali::Toolkit::TextEditor handle(GetOwner());
+      mTextChangedSignal.Emit(handle);
+      mTextChanged = false;
+    }
   }
 
   // The text-editor emits signals when the input style changes. These changes of style are
@@ -1650,8 +1669,7 @@ void TextEditor::CaretMoved(unsigned int position)
 
 void TextEditor::TextChanged()
 {
-  Dali::Toolkit::TextEditor handle(GetOwner());
-  mTextChangedSignal.Emit(handle);
+  mTextChanged = true;
 }
 
 void TextEditor::MaxLengthReached()
@@ -1973,7 +1991,8 @@ TextEditor::TextEditor()
   mHasBeenStaged(false),
   mScrollAnimationEnabled(false),
   mScrollBarEnabled(false),
-  mScrollStarted(false)
+  mScrollStarted(false),
+  mTextChanged(false)
 {
 }
 
@@ -2189,7 +2208,7 @@ Dali::Accessibility::States TextEditor::AccessibleImpl::CalculateStates()
 {
   using namespace Dali::Accessibility;
 
-  auto states              = Control::Impl::AccessibleImpl::CalculateStates();
+  auto states              = DevelControl::AccessibleImpl::CalculateStates();
   states[State::EDITABLE]  = true;
   states[State::FOCUSABLE] = true;
 
index 6be336b..4c408ca 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
@@ -356,6 +357,14 @@ private: // Implementation
   TextEditor& operator=(const TextEditor& rhs);
 
   /**
+   * @brief Resize actor to the given size.
+   *
+   * @param[in] actor The actor to be resized.
+   * @param[in] size Size to change.
+   */
+  void ResizeActor(Actor& actor, const Vector2& size);
+
+  /**
    * @brief Render view, create and attach actor(s) to this text editor.
    */
   void RenderText(Text::Controller::UpdateTextType updateTextType);
@@ -393,12 +402,13 @@ private: // Data
   bool  mScrollAnimationEnabled : 1;
   bool  mScrollBarEnabled : 1;
   bool  mScrollStarted : 1;
+  bool  mTextChanged : 1;
 
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Text,
                           public virtual Dali::Accessibility::EditableText
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     std::string           GetName() override;
     std::string           GetText(size_t startOffset, size_t endOffset) override;
index 4cca3fd..47b32e9 100644 (file)
@@ -1333,6 +1333,14 @@ float TextField::GetHeightForWidth(float width)
   return mController->GetHeightForWidth(width) + padding.top + padding.bottom;
 }
 
+void TextField::ResizeActor(Actor& actor, const Vector2& size)
+{
+  if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+  {
+    actor.SetProperty(Actor::Property::SIZE, size);
+  }
+}
+
 void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
 {
   DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
@@ -1362,10 +1370,12 @@ void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
   if(mStencil)
   {
     mStencil.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+    ResizeActor(mStencil, contentSize);
   }
   if(mActiveLayer)
   {
     mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+    ResizeActor(mActiveLayer, contentSize);
   }
 
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
@@ -1378,7 +1388,7 @@ void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
     if(mDecorator &&
        (Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
     {
-      mDecorator->Relayout(size);
+      mDecorator->Relayout(contentSize);
     }
 
     if(!mRenderer)
@@ -1387,6 +1397,14 @@ void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
     }
 
     RenderText(updateTextType);
+
+    // If there is text changed, callback is called.
+    if(mTextChanged)
+    {
+      Dali::Toolkit::TextField handle(GetOwner());
+      mTextChangedSignal.Emit(handle);
+      mTextChanged = false;
+    }
   }
 
   // The text-field emits signals when the input style changes. These changes of style are
@@ -1679,8 +1697,7 @@ void TextField::CaretMoved(unsigned int position)
 
 void TextField::TextChanged()
 {
-  Dali::Toolkit::TextField handle(GetOwner());
-  mTextChangedSignal.Emit(handle);
+  mTextChanged = true;
 }
 
 void TextField::MaxLengthReached()
@@ -1857,7 +1874,8 @@ TextField::TextField()
   mAlignmentOffset(0.f),
   mRenderingBackend(DEFAULT_RENDERING_BACKEND),
   mExceedPolicy(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP),
-  mHasBeenStaged(false)
+  mHasBeenStaged(false),
+  mTextChanged(false)
 {
 }
 
@@ -2071,7 +2089,7 @@ Dali::Accessibility::States TextField::AccessibleImpl::CalculateStates()
 {
   using namespace Dali::Accessibility;
 
-  auto states = Control::Impl::AccessibleImpl::CalculateStates();
+  auto states = DevelControl::AccessibleImpl::CalculateStates();
 
   states[State::EDITABLE]  = true;
   states[State::FOCUSABLE] = true;
index 87f4060..07a7a37 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-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>
@@ -312,6 +313,14 @@ private: // Implementation
   TextField& operator=(const TextField& rhs);
 
   /**
+   * @brief Resize actor to the given size.
+   *
+   * @param[in] actor The actor to be resized.
+   * @param[in] size Size to change.
+   */
+  void ResizeActor(Actor& actor, const Vector2& size);
+
+  /**
    * @brief Render view, create and attach actor(s) to this Text Field.
    */
   void RenderText(Text::Controller::UpdateTextType updateTextType);
@@ -348,13 +357,14 @@ private: // Data
   int   mRenderingBackend;
   int   mExceedPolicy;
   bool  mHasBeenStaged : 1;
+  bool  mTextChanged : 1;
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Text,
                           public virtual Dali::Accessibility::EditableText
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     std::string           GetName() override;
     std::string           GetText(size_t startOffset, size_t endOffset) override;
index 87a80e0..e9ad7a7 100644 (file)
@@ -159,10 +159,10 @@ private: // Data
   bool mTextUpdateNeeded : 1;
 
 protected:
-  struct AccessibleImpl : public Control::Impl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::AccessibleImpl,
                           public virtual Dali::Accessibility::Text
   {
-    using Control::Impl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::AccessibleImpl::AccessibleImpl;
 
     std::string          GetText(size_t startOffset, size_t endOffset) override;
     size_t               GetCharacterCount() override;
index ebc01b6..bccfe84 100644 (file)
@@ -386,7 +386,7 @@ void TextSelectionPopup::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::DIALOG, true));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::DIALOG, true));
   });
 
   //Enable highightability
index 2e1251e..ba2b8d5 100644 (file)
@@ -27,7 +27,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/helpers/color-conversion.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
@@ -166,7 +166,7 @@ void TextSelectionToolbar::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
   });
 }
 
index a0cd9e4..2aefaaf 100644 (file)
@@ -25,7 +25,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/alignment/alignment.h>
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 namespace Dali
 {
@@ -313,7 +313,7 @@ void ToolBar::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
   });
 }
 
index d45b21f..5608105 100644 (file)
@@ -30,7 +30,7 @@
 #include <cstring>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
@@ -115,7 +115,7 @@ void VideoView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
+      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
   });
 }
 
index f7f1663..3595b12 100644 (file)
@@ -66,10 +66,12 @@ DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "contentSize",      VECTOR2, CONTEN
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "title",            STRING,  TITLE             )
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "videoHoleEnabled", BOOLEAN, VIDEO_HOLE_ENABLED)
 
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted",   PAGE_LOAD_STARTED_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, "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_TYPE_REGISTRATION_END()
 // clang-format on
@@ -94,7 +96,8 @@ WebView::WebView(const std::string& locale, const std::string& timezoneId)
   mPageLoadFinishedSignal(),
   mPageLoadErrorSignal(),
   mVideoHoleEnabled(true),
-  mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height)
+  mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+  mUrlChangedSignal()
 {
   mWebEngine = Dali::WebEngine::New();
 
@@ -115,7 +118,8 @@ WebView::WebView(int argc, char** argv)
   mPageLoadFinishedSignal(),
   mPageLoadErrorSignal(),
   mVideoHoleEnabled(true),
-  mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height)
+  mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+  mUrlChangedSignal()
 {
   mWebEngine = Dali::WebEngine::New();
 
@@ -182,10 +186,12 @@ void WebView::OnInitialize()
 
   if(mWebEngine)
   {
-    mWebEngine.PageLoadStartedSignal().Connect(this, &WebView::OnPageLoadStarted);
-    mWebEngine.PageLoadFinishedSignal().Connect(this, &WebView::OnPageLoadFinished);
-    mWebEngine.PageLoadErrorSignal().Connect(this, &WebView::OnPageLoadError);
-    mWebEngine.ScrollEdgeReachedSignal().Connect(this, &WebView::OnScrollEdgeReached);
+    mWebEngine.PageLoadStartedSignal().Connect( this, &WebView::OnPageLoadStarted );
+    mWebEngine.PageLoadInProgressSignal().Connect(this, &WebView::OnPageLoadInProgress);
+    mWebEngine.PageLoadFinishedSignal().Connect( this, &WebView::OnPageLoadFinished );
+    mWebEngine.PageLoadErrorSignal().Connect( this, &WebView::OnPageLoadError );
+    mWebEngine.ScrollEdgeReachedSignal().Connect( this, &WebView::OnScrollEdgeReached );
+    mWebEngine.UrlChangedSignal().Connect(this, &WebView::OnUrlChanged);
 
     mWebContext         = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
     mWebCookieManager   = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
@@ -357,11 +363,51 @@ void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName,
   }
 }
 
-void WebView::ClearAllTilesResources()
+void WebView::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
 {
   if(mWebEngine)
   {
-    mWebEngine.ClearAllTilesResources();
+    mWebEngine.RegisterJavaScriptAlertCallback( callback );
+  }
+}
+
+void WebView::JavaScriptAlertReply()
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.JavaScriptAlertReply();
+  }
+}
+
+void WebView::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.RegisterJavaScriptConfirmCallback( callback );
+  }
+}
+
+void WebView::JavaScriptConfirmReply( bool confirmed )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.JavaScriptConfirmReply( confirmed );
+  }
+}
+
+void WebView::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.RegisterJavaScriptPromptCallback( callback );
+  }
+}
+
+void WebView::JavaScriptPromptReply( const std::string& result )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.JavaScriptPromptReply( result );
   }
 }
 
@@ -426,11 +472,24 @@ void WebView::EnableBlendMode(bool blendEnabled)
   }
 }
 
+void WebView::ClearAllTilesResources()
+{
+  if( mWebEngine )
+  {
+    mWebEngine.ClearAllTilesResources();
+  }
+}
+
 Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
 {
   return mPageLoadStartedSignal;
 }
 
+Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadInProgressSignal()
+{
+  return mPageLoadInProgressSignal;
+}
+
 Dali::Toolkit::WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
 {
   return mPageLoadFinishedSignal;
@@ -446,7 +505,12 @@ Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeR
   return mScrollEdgeReachedSignal;
 }
 
-void WebView::OnPageLoadStarted(const std::string& url)
+Dali::Toolkit::WebView::WebViewUrlChangedSignalType& WebView::UrlChangedSignal()
+{
+  return mUrlChangedSignal;
+}
+
+void WebView::OnPageLoadStarted( const std::string& url )
 {
   if(!mPageLoadStartedSignal.Empty())
   {
@@ -455,7 +519,16 @@ void WebView::OnPageLoadStarted(const std::string& url)
   }
 }
 
-void WebView::OnPageLoadFinished(const std::string& url)
+void WebView::OnPageLoadInProgress( const std::string& url )
+{
+  if ( !mPageLoadInProgressSignal.Empty() )
+  {
+    Dali::Toolkit::WebView handle( GetOwner() );
+    mPageLoadInProgressSignal.Emit( handle, url );
+  }
+}
+
+void WebView::OnPageLoadFinished( const std::string& url )
 {
   if(!mPageLoadFinishedSignal.Empty())
   {
@@ -482,7 +555,16 @@ void WebView::OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge)
   }
 }
 
-bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
+void WebView::OnUrlChanged(const std::string& url)
+{
+  if (!mUrlChangedSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mUrlChangedSignal.Emit(handle, url);
+  }
+}
+
+bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::BaseHandle handle(object);
 
@@ -494,6 +576,11 @@ bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tr
     webView.PageLoadStartedSignal().Connect(tracker, functor);
     connected = true;
   }
+  else if (0 == strcmp(signalName.c_str(), PAGE_LOAD_IN_PROGRESS_SIGNAL))
+  {
+    webView.PageLoadInProgressSignal().Connect(tracker, functor);
+    connected = true;
+  }
   else if(0 == strcmp(signalName.c_str(), PAGE_LOAD_FINISHED_SIGNAL))
   {
     webView.PageLoadFinishedSignal().Connect(tracker, functor);
@@ -509,6 +596,11 @@ bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tr
     webView.ScrollEdgeReachedSignal().Connect(tracker, functor);
     connected = true;
   }
+  else if (0 == strcmp(signalName.c_str(), URL_CHANGED_SIGNAL))
+  {
+    webView.UrlChangedSignal().Connect( tracker, functor );
+    connected = true;
+  }
 
   return connected;
 }
index 5a76ab5..065dc45 100644 (file)
@@ -164,9 +164,34 @@ public:
   void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler);
 
   /**
-   * @brief Clears all tiles resources of Web.
+   * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptAlertCallback()
    */
-  void ClearAllTilesResources();
+  void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback );
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::JavaScriptAlertReply()
+   */
+  void JavaScriptAlertReply();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptConfirmCallback()
+   */
+  void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback );
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::JavaScriptConfirmReply()
+   */
+  void JavaScriptConfirmReply( bool confirmed );
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptPromptCallback()
+   */
+  void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::JavaScriptPromptReply()
+   */
+  void JavaScriptPromptReply( const std::string& result );
 
   /**
    * @copydoc Dali::Toolkit::WebView::ClearHistory()
@@ -174,11 +199,21 @@ public:
   void ClearHistory();
 
   /**
+   * @brief Clears all tiles resources of Web.
+   */
+  void ClearAllTilesResources();
+
+  /**
    * @copydoc Dali::Toolkit::WebView::PageLoadStartedSignal()
    */
   Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadStartedSignal();
 
   /**
+   * @copydoc Dali::Toolkit::WebView::PageLoadInProgressSignal()
+   */
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadInProgressSignal();
+
+  /**
    * @copydoc Dali::Toolkit::WebView::PageLoadFinishedSignal()
    */
   Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadFinishedSignal();
@@ -193,6 +228,11 @@ public:
    */
   Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
 
+  /**
+   * @copydoc Dali::Toolkit::WebView::UrlChangedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewUrlChangedSignalType& UrlChangedSignal();
+
 public: // Properties
   /**
    * @brief Called when a property of an object of this type is set.
@@ -340,6 +380,12 @@ private:
   void OnPageLoadStarted(const std::string& url);
 
   /**
+   * @brief Callback function to be called when page is loading in progress.
+   * @param[in] url The url currently being loaded
+   */
+  void OnPageLoadInProgress( const std::string& url );
+
+  /**
    * @brief Callback function to be called when page load finished.
    * @param[in] url The url currently being loaded
    */
@@ -358,28 +404,36 @@ private:
    */
   void OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge);
 
+  /**
+   * @brief Callback function to be called when url is changed.
+   * @param[in] url The url currently being loaded
+   */
+  void OnUrlChanged( const std::string& url );
+
 private:
-  std::string                 mUrl;
-  Dali::Toolkit::Visual::Base mVisual;
-  Dali::Size                  mWebViewSize;
-  Dali::WebEngine             mWebEngine;
-
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType          mPageLoadStartedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType          mPageLoadFinishedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType     mPageLoadErrorSignal;
+  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::WebViewScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
 
-  std::unique_ptr<Dali::Toolkit::WebContext>         mWebContext;
-  std::unique_ptr<Dali::Toolkit::WebCookieManager>   mWebCookieManager;
-  std::unique_ptr<Dali::Toolkit::WebSettings>        mWebSettings;
-  std::unique_ptr<Dali::Toolkit::WebBackForwardList> mWebBackForwardList;
-  Dali::Toolkit::ImageView                           mFaviconView;
-
-  Dali::PropertyNotification mPositionUpdateNotification;
-  Dali::PropertyNotification mSizeUpdateNotification;
-  Dali::PropertyNotification mScaleUpdateNotification;
-  bool                       mVideoHoleEnabled;
-  Dali::Rect<int>            mWebViewArea;
+  std::unique_ptr<Dali::Toolkit::WebContext>             mWebContext;
+  std::unique_ptr<Dali::Toolkit::WebCookieManager>       mWebCookieManager;
+  std::unique_ptr<Dali::Toolkit::WebSettings>            mWebSettings;
+  std::unique_ptr<Dali::Toolkit::WebBackForwardList>     mWebBackForwardList;
+  Dali::Toolkit::ImageView mFaviconView;
+
+  Dali::PropertyNotification                             mPositionUpdateNotification;
+  Dali::PropertyNotification                             mSizeUpdateNotification;
+  Dali::PropertyNotification                             mScaleUpdateNotification;
+  bool                                                   mVideoHoleEnabled;
+  Dali::Rect< int >                                      mWebViewArea;
+  Dali::Toolkit::WebView::WebViewUrlChangedSignalType    mUrlChangedSignal;
 };
 
 } // namespace Internal
index c6fbe87..c6c4058 100644 (file)
@@ -599,7 +599,8 @@ bool Controller::EventHandler::DeleteEvent(Controller& controller, int keyCode)
                                     1,
                                     UPDATE_INPUT_STYLE);
   }
-  else if(keyCode == Dali::DevelKey::DALI_KEY_DELETE)
+  else if((controller.mImpl->mEventData->mPrimaryCursorPosition < controller.mImpl->mModel->mLogicalModel->mText.Count()) &&
+          (keyCode == Dali::DevelKey::DALI_KEY_DELETE))
   {
     // Remove the character after the current cursor position
     removed = controller.RemoveText(0,
index 2b362c0..a900601 100644 (file)
@@ -636,14 +636,29 @@ bool Controller::Relayouter::DoRelayout(Controller& controller, const Size& size
 
 void Controller::Relayouter::CalculateVerticalOffset(Controller& controller, const Size& controlSize)
 {
-  Controller::Impl& impl       = *controller.mImpl;
-  ModelPtr&         model      = impl.mModel;
-  Size              layoutSize = model->mVisualModel->GetLayoutSize();
+  Controller::Impl& impl          = *controller.mImpl;
+  ModelPtr&         model         = impl.mModel;
+  VisualModelPtr&   visualModel   = model->mVisualModel;
+  Size              layoutSize    = model->mVisualModel->GetLayoutSize();
+  Size              oldLayoutSize = layoutSize;
+  float             offsetY       = 0.f;
+  bool              needRecalc    = false;
+  float             defaultFontLineHeight = impl.GetDefaultFontLineHeight();
 
   if(fabsf(layoutSize.height) < Math::MACHINE_EPSILON_1000)
   {
     // Get the line height of the default font.
-    layoutSize.height = impl.GetDefaultFontLineHeight();
+    layoutSize.height = defaultFontLineHeight;
+  }
+
+  // Whether the text control is editable
+  const bool isEditable = NULL != impl.mEventData;
+  if (isEditable && layoutSize.height != defaultFontLineHeight)
+  {
+    // This code prevents the wrong positioning of cursor when the layout size is bigger/smaller than defaultFontLineHeight.
+    // This situation occurs when the size of placeholder text is different from the default text.
+    layoutSize.height = defaultFontLineHeight;
+    needRecalc = true;
   }
 
   switch(model->mVerticalAlignment)
@@ -651,19 +666,34 @@ void Controller::Relayouter::CalculateVerticalOffset(Controller& controller, con
     case VerticalAlignment::TOP:
     {
       model->mScrollPosition.y = 0.f;
+      offsetY = 0.f;
       break;
     }
     case VerticalAlignment::CENTER:
     {
       model->mScrollPosition.y = floorf(0.5f * (controlSize.height - layoutSize.height)); // try to avoid pixel alignment.
+      if (needRecalc) offsetY  = floorf(0.5f * (layoutSize.height - oldLayoutSize.height));
       break;
     }
     case VerticalAlignment::BOTTOM:
     {
       model->mScrollPosition.y = controlSize.height - layoutSize.height;
+      if (needRecalc) offsetY  = layoutSize.height - oldLayoutSize.height;
       break;
     }
   }
+
+  if (needRecalc)
+  {
+    // Update glyphPositions according to recalculation.
+    const Length positionCount = visualModel->mGlyphPositions.Count();
+    Vector<Vector2>& glyphPositions = visualModel->mGlyphPositions;
+    for(Length index = 0u; index < positionCount; index++)
+    {
+      glyphPositions[index].y += offsetY;
+    }
+  }
+
 }
 
 } // namespace Text
index e2b55b5..767bfb0 100644 (file)
@@ -224,32 +224,11 @@ void SvgRasterizeThread::RemoveTask(SvgVisual* visual)
   UnregisterProcessor();
 }
 
-void SvgRasterizeThread::DeleteImage(VectorImageRenderer vectorRenderer)
-{
-  // Lock while adding image to the delete queue
-  ConditionalWait::ScopedLock lock(mConditionalWait);
-
-  if(mIsThreadWaiting) // no rasterization is ongoing, save to delete
-  {
-    // TODO: what?
-  }
-  else // wait to delete until current rasterization completed.
-  {
-    mDeleteSvg.PushBack(&vectorRenderer);
-  }
-}
-
 RasterizingTaskPtr SvgRasterizeThread::NextTaskToProcess()
 {
   // Lock while popping task out from the queue
   ConditionalWait::ScopedLock lock(mConditionalWait);
 
-  // Delete the image here to make sure that it is not used in the nsvgRasterize()
-  if(!mDeleteSvg.Empty())
-  {
-    mDeleteSvg.Clear();
-  }
-
   // conditional wait
   while(mRasterizeTasks.empty())
   {
index 9e54e61..b915b13 100644 (file)
@@ -164,15 +164,6 @@ public:
   void RemoveTask(SvgVisual* visual);
 
   /**
-   * Delete the parsed SVG image, called by main thread.
-   *
-   * The parsed svg should be deleted in worker thread, as the main thread does not know whether a rasterization of this svg is ongoing.
-   *
-   * @param[in] VectorImage The image to be deleted
-   */
-  void DeleteImage(VectorImageRenderer vectorImage);
-
-  /**
    * @copydoc Dali::Integration::Processor::Process()
    */
   void Process() override;
@@ -225,7 +216,6 @@ private:
 private:
   std::vector<RasterizingTaskPtr> mRasterizeTasks; //The queue of the tasks waiting to rasterize the SVG image
   std::vector<RasterizingTaskPtr> mCompletedTasks; //The queue of the tasks with the SVG rasterization completed
-  Vector<VectorImageRenderer*>    mDeleteSvg;      //The images that the event thread requested to delete
 
   ConditionalWait                      mConditionalWait;
   Dali::Mutex                          mMutex;
index 156b08b..0f69e0d 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 = 13;
+const unsigned int TOOLKIT_MICRO_VERSION = 17;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 8e0e800..f522fc0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.0.13
+Version:    2.0.17
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -87,8 +87,7 @@ Application development package for Dali 3D engine toolkit - headers and package
 Summary:    DLI scene loading library
 Group:      System/Libraries
 License:    Apache-2.0
-
-BuildRequires:  pkgconfig(dali2-toolkit)
+Requires:   dali2-toolkit
 
 %description -n %{dali2_scene_loader}
 Provides functionality for loading and displaying DLI format scenes. See README.md for more details.