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()
{
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;
{
}
+ void EnableCacheBuilder( bool enabled ) override
+ {
+ }
+
+ void UseScrollbarThumbFocusNotifications( bool used ) override
+ {
+ }
+
+ void EnableDoNotTrack( bool enabled ) override
+ {
+ }
+
void AllowFileAccessFromExternalUrl( bool allowed ) override
{
}
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;
};
/*
- * 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.
END_TEST;
}
+int UtcDaliAnimatedImageVisualImageLoadingFail01(void)
+{
+ ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+
+ {
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
+ propertyMap.Insert( ImageVisual::Property::URL, "dummy.gif" );
+ propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2 );
+ propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2 );
+ propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20 );
+ propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+ propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS, 0.23f );
+ propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE );
+
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base visual = factory.CreateVisual( propertyMap );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+ dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ application.GetScene().Add( dummyControl );
+
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+
+ DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6 );
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+
+ dummyControl.Unparent();
+ }
+
+ END_TEST;
+}
int UtcDaliAnimatedImageVisualSynchronousLoading(void)
{
/*
- * 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.
gTextChangedCallBackCalled = false;
editor.SetProperty( TextEditor::Property::TEXT, "ABC" );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
DALI_TEST_CHECK( textChangedSignal );
- application.SendNotification();
-
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;
+ 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
/*
- * 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.
gTextChangedCallBackCalled = false;
field.SetProperty( TextField::Property::TEXT, "ABC" );
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK( gTextChangedCallBackCalled );
DALI_TEST_CHECK( textChangedSignal );
- application.SendNotification();
-
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;
+ 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)
{
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 );
settings->AllowMixedContents( false );
settings->EnableSpatialNavigation( false );
settings->EnableWebSecurity( false );
+ settings->EnableCacheBuilder( false );
+ settings->EnableDoNotTrack( false );
+ settings->UseScrollbarThumbFocusNotifications( false );
settings->AllowFileAccessFromExternalUrl( false );
settings->AllowScriptsOpenWindows( false );
settings->AllowMixedContents( false );
settings->EnableSpatialNavigation( false );
settings->EnableWebSecurity( false );
+ settings->EnableCacheBuilder( false );
+ settings->EnableDoNotTrack( false );
+ settings->UseScrollbarThumbFocusNotifications( false );
settings->AllowFileAccessFromExternalUrl( false );
settings->AllowScriptsOpenWindows( false );
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;
settings->AllowMixedContents( false );
settings->EnableSpatialNavigation( false );
settings->EnableWebSecurity( false );
+ settings->EnableCacheBuilder( false );
+ settings->EnableDoNotTrack( false );
+ settings->UseScrollbarThumbFocusNotifications( false );
settings->AllowFileAccessFromExternalUrl( false );
settings->AllowScriptsOpenWindows( false );
settings->AllowMixedContents( false );
settings->EnableSpatialNavigation( false );
settings->EnableWebSecurity( false );
+ settings->EnableCacheBuilder( false );
+ settings->EnableDoNotTrack( false );
+ settings->UseScrollbarThumbFocusNotifications( false );
settings->AllowFileAccessFromExternalUrl( false );
settings->AllowScriptsOpenWindows( false );
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);
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);
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
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,
void TextEditor::ResizeActor(Actor& actor, const Vector2& size)
{
- if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
{
actor.SetProperty(Actor::Property::SIZE, size);
}
}
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
void TextEditor::TextChanged()
{
- Dali::Toolkit::TextEditor handle(GetOwner());
- mTextChangedSignal.Emit(handle);
+ mTextChanged = true;
}
void TextEditor::MaxLengthReached()
mHasBeenStaged(false),
mScrollAnimationEnabled(false),
mScrollBarEnabled(false),
- mScrollStarted(false)
+ mScrollStarted(false),
+ mTextChanged(false)
{
}
* @param[in] actor The actor to be resized.
* @param[in] size Size to change.
*/
- void ResizeActor( Actor& actor, const Vector2& size );
+ void ResizeActor(Actor& actor, const Vector2& size);
/**
* @brief Render view, create and attach actor(s) to this text editor.
bool mScrollAnimationEnabled : 1;
bool mScrollBarEnabled : 1;
bool mScrollStarted : 1;
+ bool mTextChanged : 1;
struct AccessibleImpl : public DevelControl::AccessibleImpl,
public virtual Dali::Accessibility::Text,
void TextField::ResizeActor(Actor& actor, const Vector2& size)
{
- if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
{
actor.SetProperty(Actor::Property::SIZE, size);
}
}
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
void TextField::TextChanged()
{
- Dali::Toolkit::TextField handle(GetOwner());
- mTextChangedSignal.Emit(handle);
+ mTextChanged = true;
}
void TextField::MaxLengthReached()
mAlignmentOffset(0.f),
mRenderingBackend(DEFAULT_RENDERING_BACKEND),
mExceedPolicy(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP),
- mHasBeenStaged(false)
+ mHasBeenStaged(false),
+ mTextChanged(false)
{
}
* @param[in] actor The actor to be resized.
* @param[in] size Size to change.
*/
- void ResizeActor( Actor& actor, const Vector2& size );
+ void ResizeActor(Actor& actor, const Vector2& size);
/**
* @brief Render view, create and attach actor(s) to this Text Field.
int mRenderingBackend;
int mExceedPolicy;
bool mHasBeenStaged : 1;
+ bool mTextChanged : 1;
protected:
struct AccessibleImpl : public DevelControl::AccessibleImpl,
void AnimatedImageVisual::OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes)
{
- // Check if action is valid for this visual type and perform action if possible
+ // Make not set any action when the resource status is already failed.
+ if(mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::FAILED)
+ {
+ return;
+ }
+ // Check if action is valid for this visual type and perform action if possible
switch(actionId)
{
case DevelAnimatedImageVisual::Action::PAUSE:
void AnimatedImageVisual::DoSetProperties(const Property::Map& propertyMap)
{
// url[s] already passed in from constructor
-
for(Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter)
{
KeyValuePair keyValue = propertyMap.GetKeyValue(iter);
mPlacementActor = actor;
TextureSet textureSet = PrepareTextureSet();
+ // Loading animated image file is failed.
+ if(!mImageCache ||
+ (mAnimatedImageLoading && !mAnimatedImageLoading.HasLoadingSucceeded()))
+ {
+ textureSet = SetLoadingFailed();
+ }
+
if(textureSet) // if the image loading is successful
{
StartFirstFrame(textureSet);
mFrameDelayTimer.TickSignal().Connect(this, &AnimatedImageVisual::DisplayNextFrame);
mFrameDelayTimer.Start();
}
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::READY)\n");
- ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+
+ if(mImpl->mResourceStatus != Toolkit::Visual::ResourceStatus::FAILED)
+ {
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::READY)\n");
+ ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+ }
}
TextureSet AnimatedImageVisual::PrepareTextureSet()
void AnimatedImageVisual::FrameReady(TextureSet textureSet)
{
- if(textureSet)
+ // When image visual requested to load new frame to mImageCache and it is failed.
+ if(!textureSet)
{
- SetImageSize(textureSet);
+ textureSet = SetLoadingFailed();
+ }
- if(mStartFirstFrame)
- {
- StartFirstFrame(textureSet);
- }
- else
- {
- if(mImpl->mRenderer)
- {
- mImpl->mRenderer.SetTextures(textureSet);
- }
- }
+ SetImageSize(textureSet);
+
+ if(mStartFirstFrame)
+ {
+ StartFirstFrame(textureSet);
}
else
{
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n");
- ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ if(mImpl->mRenderer)
+ {
+ mImpl->mRenderer.SetTextures(textureSet);
+ }
}
}
bool AnimatedImageVisual::DisplayNextFrame()
{
- bool continueTimer = false;
+ TextureSet textureSet;
+ bool continueTimer = false;
if(mImageCache)
{
DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::DisplayNextFrame(this:%p) CurrentFrameIndex:%d\n", this, frameIndex);
- TextureSet textureSet;
if(nextFrame)
{
textureSet = mImageCache->NextFrame();
textureSet = mImageCache->Frame(frameIndex);
}
- if(textureSet)
+ continueTimer = (mActionStatus == DevelAnimatedImageVisual::Action::PLAY) ? true : false;
+ }
+
+ if(textureSet)
+ {
+ SetImageSize(textureSet);
+ if(mImpl->mRenderer)
{
- SetImageSize(textureSet);
- if(mImpl->mRenderer)
- {
- mImpl->mRenderer.SetTextures(textureSet);
- }
+ mImpl->mRenderer.SetTextures(textureSet);
}
-
- continueTimer = (mActionStatus == DevelAnimatedImageVisual::Action::PLAY) ? true : false;
}
return continueTimer;
}
+TextureSet AnimatedImageVisual::SetLoadingFailed()
+{
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n");
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+
+ TextureSet textureSet = TextureSet::New();
+ Texture brokenImage = mFactoryCache.GetBrokenVisualImage();
+ textureSet.SetTexture(0u, brokenImage);
+
+ if(mFrameDelayTimer)
+ {
+ mFrameDelayTimer.Stop();
+ mFrameDelayTimer.Reset();
+ }
+
+ SetImageSize(textureSet);
+
+ return textureSet;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
void InitializeAnimatedImage(const VisualUrl& imageUrl);
+ /**
+ * Set the state of loading fail of an image or a frame.
+ * Returns TextureSet of broken image.
+ */
+ TextureSet SetLoadingFailed();
+
// Undefined
AnimatedImageVisual(const AnimatedImageVisual& animatedImageVisual);
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 16;
+const unsigned int TOOLKIT_MICRO_VERSION = 18;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.0.16
+Version: 2.0.18
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
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.