X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;h=60efa05f14f2d0f84cabd4c1e14b52164cb37670;hp=9c52f227df25a8bf0c33072b78d48e67e978f61a;hb=3ff7f1def424f0ea497f41f1ee5053291cbf722b;hpb=70fdb1a1e8e2660c383079ae49bc94fbe14943d1 diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 9c52f22..60efa05 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) @@ -335,6 +345,11 @@ bool Control::OnAccessibilityZoom() return false; // Accessibility zoom action is not handled by default } +DevelControl::ControlAccessible* Control::CreateAccessibleObject() +{ + return new DevelControl::ControlAccessible(Self()); +} + Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) { return Actor(); @@ -427,7 +442,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 +494,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,9 +581,15 @@ 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)) + GetAccessibleObject()->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE)); + break; + } + case DevelActor::Property::USER_INTERACTION_ENABLED: + { + const bool enabled = propertyValue.Get(); + if (!enabled && Self() == Dali::Toolkit::KeyboardFocusManager::Get().GetCurrentFocusActor()) { - Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get()); + Dali::Toolkit::KeyboardFocusManager::Get().ClearFocus(); } break; }