From: Heeyong Song Date: Fri, 22 Jul 2022 01:00:29 +0000 (+0000) Subject: Merge "(Vector) Support dynamic properties" into devel/master X-Git-Tag: dali_2.1.33~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=6da98d4f526029d51c8404964dd954afe9752401;hp=-c Merge "(Vector) Support dynamic properties" into devel/master --- 6da98d4f526029d51c8404964dd954afe9752401 diff --combined dali-toolkit/devel-api/controls/control-devel.h index 3a94e1b,abfba65..fe95c70 --- a/dali-toolkit/devel-api/controls/control-devel.h +++ b/dali-toolkit/devel-api/controls/control-devel.h @@@ -2,7 -2,7 +2,7 @@@ #define DALI_TOOLKIT_CONTROL_DEVEL_H /* - * 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. @@@ -215,14 -215,6 +215,14 @@@ enu * */ COUNTER_CLOCKWISE_FOCUSABLE_ACTOR_ID, + + /** + * @brief Identifier that allows the automation framework to find and interact with this element. + * @details Name "automationId", type Property::STRING. + * @note This is a string identifier (compared to @c Actor::Property::ID which is an integer). + * It will also appear in the AT-SPI tree under the key "automationId". + */ + AUTOMATION_ID, }; } // namespace Property @@@ -368,6 -360,18 +368,18 @@@ DALI_TOOLKIT_API Dali::Animation Create DALI_TOOLKIT_API void DoAction(Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes); /** + * @brief Perform an action on a visual registered to this control. + * + * Visuals will have actions, this API is used to perform one of these actions with the given attributes. + * + * @param[in] control The control. + * @param[in] visualIndex The Property index of the visual. + * @param[in] actionId The action to perform. See Visual to find supported actions. + * @param[in] attributes Optional attributes for the action. + */ + DALI_TOOLKIT_API void DoActionExtension(Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, Dali::Any attributes); + + /** * @brief Set input method context. * * @param[in] control The control. diff --combined dali-toolkit/internal/controls/control/control-data-impl.cpp index b967d14,5b638e8..4c74704 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@@ -485,7 -485,6 +485,7 @@@ const PropertyRegistration Control::Imp const PropertyRegistration Control::Impl::PROPERTY_23(typeRegistration, "accessibilityHidden", Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty); const PropertyRegistration Control::Impl::PROPERTY_24(typeRegistration, "clockwiseFocusableActorId", Toolkit::DevelControl::Property::CLOCKWISE_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty); const PropertyRegistration Control::Impl::PROPERTY_25(typeRegistration, "counterClockwiseFocusableActorId", Toolkit::DevelControl::Property::COUNTER_CLOCKWISE_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty); +const PropertyRegistration Control::Impl::PROPERTY_26(typeRegistration, "automationId", Toolkit::DevelControl::Property::AUTOMATION_ID, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty); // clang-format on @@@ -1096,6 -1095,15 +1096,15 @@@ void Control::Impl::DoAction(Dali::Prop } } + void Control::Impl::DoActionExtension(Dali::Property::Index visualIndex, Dali::Property::Index actionId, Dali::Any attributes) + { + RegisteredVisualContainer::Iterator iter; + if(FindVisual(visualIndex, mVisuals, iter)) + { + Toolkit::GetImplementation((*iter)->visual).DoActionExtension(actionId, attributes); + } + } + void Control::Impl::AppendAccessibilityAttribute(const std::string& key, const std::string value) { Property::Value* checkedValue = mAccessibilityAttributes.Find(key); @@@ -1395,16 -1403,6 +1404,16 @@@ void Control::Impl::SetProperty(BaseObj } break; } + + case Toolkit::DevelControl::Property::AUTOMATION_ID: + { + std::string automationId; + if(value.Get(automationId)) + { + controlImpl.mImpl->mAutomationId = automationId; + } + break; + } } } } @@@ -1577,12 -1575,6 +1586,12 @@@ Property::Value Control::Impl::GetPrope value = controlImpl.mImpl->mCounterClockwiseFocusableActorId; break; } + + case Toolkit::DevelControl::Property::AUTOMATION_ID: + { + value = controlImpl.mImpl->mAutomationId; + break; + } } } diff --combined dali-toolkit/internal/controls/control/control-data-impl.h index 793fc22,f72d121..46cc97b --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@@ -224,6 -224,11 +224,11 @@@ public void DoAction(Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes); /** + * @copydoc Dali::Toolkit::DevelControl::DoActionExtension() + */ + void DoActionExtension(Dali::Property::Index visualIndex, Dali::Property::Index actionId, Dali::Any attributes); + + /** * @brief Function used to set control properties. * @param[in] object The object whose property to set * @param[in] index The index of the property to set @@@ -537,7 -542,6 +542,7 @@@ public std::string mAccessibilityName; std::string mAccessibilityDescription; std::string mAccessibilityTranslationDomain; + std::string mAutomationId; bool mAccessibilityHighlightable = false; bool mAccessibilityHidden = false; @@@ -594,7 -598,6 +599,7 @@@ static const PropertyRegistration PROPERTY_23; static const PropertyRegistration PROPERTY_24; static const PropertyRegistration PROPERTY_25; + static const PropertyRegistration PROPERTY_26; private: // Accessibility - notification for highlighted object to check if it is showing.