X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;h=781b531dff024714af62647127417f0f2a17f387;hb=refs%2Fchanges%2F88%2F257188%2F4;hp=c34dbb3412887d51f8f9953bd1c48a61d9d415c3;hpb=1fe6286be11679b2f5c14a60636ae9cb486570e4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index c34dbb3..781b531 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,21 @@ #include // EXTERNAL INCLUDES +#include +#include #include #include #include +#include #include #include #include // for strcmp #include #include #include -#include -#include -#include // INTERNAL INCLUDES +#include #include #include #include @@ -44,13 +45,11 @@ #include #include #include +#include #include #include #include #include -#include -#include -#include namespace Dali { @@ -374,7 +373,7 @@ void Control::KeyboardEnter() bool Control::OnAccessibilityActivated() { - if( Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( Self() ) ) + if(Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) { return OnKeyboardEnter(); } @@ -489,15 +488,12 @@ void Control::Initialize() } Dali::TypeInfo type; - Self().GetTypeInfo( type ); - if (type) + Self().GetTypeInfo(type); + if(type) { auto typeName = type.GetName(); - DevelControl::AppendAccessibilityAttribute( Self(), "t", typeName ); + DevelControl::AppendAccessibilityAttribute(Self(), "class", typeName); } - - if (Accessibility::IsUp()) - mImpl->AccessibilityRegister(); } void Control::OnInitialize() @@ -546,14 +542,14 @@ void Control::EmitKeyInputFocusSignal(bool focusGained) { Dali::Toolkit::Control handle(GetOwner()); - if( Accessibility::IsUp() ) + if(Accessibility::IsUp()) { - auto self = mImpl->GetAccessibilityObject( Self() ); - self->EmitFocused( focusGained ); + auto self = mImpl->GetAccessibilityObject(Self()); + self->EmitFocused(focusGained); auto parent = self->GetParent(); - if( parent && !self->GetStates()[Dali::Accessibility::State::MANAGES_DESCENDANTS] ) + if(parent && !self->GetStates()[Dali::Accessibility::State::MANAGES_DESCENDANTS]) { - parent->EmitActiveDescendantChanged( parent, self ); + parent->EmitActiveDescendantChanged(parent, self); } } @@ -594,20 +590,12 @@ void Control::OnSceneConnection(int depth) // The clipping renderer is only created if required. CreateClippingRenderer(*this); - // Request to be laid out when the control is connected to the Scene. - // Signal that a Relayout may be needed - if( Accessibility::IsUp() ) - { - mImpl->AccessibilityRegister(); - } + mImpl->AccessibilityRegister(); } void Control::OnSceneDisconnection() { - if( Accessibility::IsUp() ) - { - mImpl->AccessibilityDeregister(); - } + mImpl->AccessibilityDeregister(true); mImpl->OnSceneDisconnection(); } @@ -633,30 +621,30 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper { // If the clipping mode has been set, we may need to create a renderer. // Only do this if we are already on-stage as the OnSceneConnection will handle the off-stage clipping controls. - switch( index ) + switch(index) { case Actor::Property::CLIPPING_MODE: { - if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE )) + if(Self().GetProperty(Actor::Property::CONNECTED_TO_SCENE)) { // Note: This method will handle whether creation of the renderer is required. - CreateClippingRenderer( *this ); + CreateClippingRenderer(*this); } break; } case Actor::Property::VISIBLE: { - if( Dali::Accessibility::IsUp() ) + if(Dali::Accessibility::IsUp()) { - Dali::Accessibility::Accessible::Get(Self())->EmitVisible( Self().GetProperty( Actor::Property::VISIBLE ).Get() ); + Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get()); } break; } case Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE: { - if( Dali::Accessibility::IsUp() ) + if(Dali::Accessibility::IsUp()) { - Dali::Accessibility::Accessible::Get(Self())->Emit( Dali::Accessibility::ObjectPropertyChangeEvent::ROLE ); + Dali::Accessibility::Accessible::Get(Self())->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::ROLE); } break; }