X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;h=14075780ccf012e8f30b06dbb8ed97fdf178ec61;hb=refs%2Fchanges%2F17%2F272317%2F3;hp=db9972878c83b129b1815b0715e49e8caec4c309;hpb=bad241077bd728d9a5ef25d59398eae889b359a1;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 db99728..1407578 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) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -88,8 +88,13 @@ void CreateClippingRenderer(Control& controlImpl) Toolkit::Control Control::New() { + return New(ControlBehaviour::CONTROL_BEHAVIOUR_DEFAULT); +} + +Toolkit::Control Control::New(ControlBehaviour additionalBehaviour) +{ // Create the implementation, temporarily owned on stack - IntrusivePtr controlImpl = new Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)); + IntrusivePtr controlImpl = new Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT | additionalBehaviour)); // Pass ownership to handle Toolkit::Control handle(*controlImpl); @@ -162,6 +167,11 @@ void Control::ClearBackground() RelayoutRequest(); } +Toolkit::DevelControl::ControlAccessible* Control::GetAccessibleObject() +{ + return mImpl->GetAccessibleObject(); +} + void Control::EnableGestureDetection(GestureType::Value type) { if((type & GestureType::PINCH) && !mImpl->mPinchGestureDetector) @@ -427,7 +437,7 @@ void Control::Initialize() if(type) { auto typeName = type.GetName(); - DevelControl::AppendAccessibilityAttribute(Self(), "class", typeName); + DevelControl::AppendAccessibilityAttribute(Toolkit::Control::DownCast(Self()), "class", typeName); } } @@ -479,12 +489,12 @@ void Control::EmitKeyInputFocusSignal(bool focusGained) if(Accessibility::IsUp()) { - auto self = mImpl->GetAccessibilityObject(Self()); + auto self = GetAccessibleObject(); self->EmitFocused(focusGained); auto parent = self->GetParent(); if(parent && !self->GetStates()[Dali::Accessibility::State::MANAGES_DESCENDANTS]) { - parent->EmitActiveDescendantChanged(parent, self); + parent->EmitActiveDescendantChanged(self); } } @@ -566,10 +576,7 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper } case Actor::Property::VISIBLE: { - if(Dali::Accessibility::IsUp()) - { - Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get()); - } + GetAccessibleObject()->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE)); break; } }