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;
};
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 );
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
#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>
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,
${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
)
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
#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
{
{
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));
});
}
// 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>
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));
});
}
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);
// 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
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;
});
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);
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());
*/
class Control::Impl : public ConnectionTracker, public Visual::EventObserver
{
+ friend class Toolkit::DevelControl::AccessibleImpl;
+
public:
/**
* @brief Retrieves the implementation of the internal control class.
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;
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));
});
}
#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;
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));
});
}
#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>
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));
});
}
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;
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
#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>
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));
});
}
#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>
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));
});
}
#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
{
{
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));
});
}
#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>
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));
});
}
// 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>
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);
#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>
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;
#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>
*/
// 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>
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;
// 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>
#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>
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;
#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>
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;
};
#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>
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));
});
}
// 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>
#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>
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;
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));
});
}
#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;
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));
});
}
#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>
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");
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);
if(mDecorator &&
(Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
{
- mDecorator->Relayout(size);
+ mDecorator->Relayout(contentSize);
}
if(!mRenderer)
{
using namespace Dali::Accessibility;
- auto states = Control::Impl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::AccessibleImpl::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;
#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>
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);
bool mScrollBarEnabled : 1;
bool mScrollStarted : 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;
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");
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);
if(mDecorator &&
(Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
{
- mDecorator->Relayout(size);
+ mDecorator->Relayout(contentSize);
}
if(!mRenderer)
{
using namespace Dali::Accessibility;
- auto states = Control::Impl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::AccessibleImpl::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;
#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>
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);
bool mHasBeenStaged : 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;
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;
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
// 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>
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));
});
}
// 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
{
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));
});
}
#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>
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));
});
}
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)
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
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 15;
+const unsigned int TOOLKIT_MICRO_VERSION = 17;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.0.15
+Version: 2.0.17
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT