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=1a2445c28b26a8ea13d37008e46c6745ba620705;hpb=b6d4b9f100ccc6dce652ae9f301cb1ab19c463b1;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 1a2445c..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,7 +489,7 @@ 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]) @@ -566,10 +576,7 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper } case Actor::Property::VISIBLE: { - if(Dali::Accessibility::IsUp() && !Self().GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN)) - { - Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get()); - } + GetAccessibleObject()->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE)); break; } }