diff options
author | Adam Bialogonski <adam.b@samsung.com> | 2024-08-16 08:43:26 +0100 |
---|---|---|
committer | Adam Bialogonski <adam.b@samsung.com> | 2024-08-16 08:43:26 +0100 |
commit | 43b87d4a38c92b3f9fc7814f2a6b4602560e4d49 (patch) | |
tree | eb620314f0cf3c7b86b8659571e10d995a3cd427 /dali/internal/accessibility/bridge | |
parent | f5fa2a0aff0ebc5a1b718d03cd1341c8f344c441 (diff) | |
parent | aa25408542c93dca0266f984797963d92e94b5c4 (diff) | |
download | dali-adaptor-master.tar.gz dali-adaptor-master.tar.bz2 dali-adaptor-master.zip |
Change-Id: Ie44b2b9dfd6840cb56cfad9bcf8bed7e54bb561c
Diffstat (limited to 'dali/internal/accessibility/bridge')
-rw-r--r-- | dali/internal/accessibility/bridge/bridge-accessible.cpp | 38 | ||||
-rw-r--r-- | dali/internal/accessibility/bridge/bridge-base.h | 7 |
2 files changed, 31 insertions, 14 deletions
diff --git a/dali/internal/accessibility/bridge/bridge-accessible.cpp b/dali/internal/accessibility/bridge/bridge-accessible.cpp index c57a887c4..344d96800 100644 --- a/dali/internal/accessibility/bridge/bridge-accessible.cpp +++ b/dali/internal/accessibility/bridge/bridge-accessible.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -41,6 +41,9 @@ using namespace Dali::Accessibility; namespace { +constexpr const char* VALUE_FORMAT_KEY = "value_format"; +constexpr const char* VALUE_FORMAT_TEXT_VAL = "text"; + bool SortVertically(Component* lhs, Component* rhs) { auto leftRect = lhs->GetExtents(CoordinateType::WINDOW); @@ -488,8 +491,9 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial() std::string labeledByName = labellingObject ? labellingObject->GetName() : ""; auto describedByObject = findObjectByRelationType(RelationType::DESCRIBED_BY); + auto attributes = self->GetAttributes(); - double currentValue = 0.0; + double currentValue = 0.0; std::string currentValueText; double minimumIncrement = 0.0; double maximumValue = 0.0; @@ -503,6 +507,15 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial() maximumValue = valueInterface->GetMaximum(); minimumValue = valueInterface->GetMinimum(); } + else + { + // value text support outside of IAtspiValue interface + currentValueText = self->GetValue(); + if(!currentValueText.empty()) + { + attributes.insert({VALUE_FORMAT_KEY, VALUE_FORMAT_TEXT_VAL}); + } + } int32_t firstSelectedChildIndex = -1; int32_t selectedChildCount = 0; @@ -529,7 +542,6 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial() } } - auto attributes = self->GetAttributes(); auto itemCount = attributes.find("item_count"); auto atspiRole = self->GetRole(); int32_t listChildrenCount = 0; @@ -602,23 +614,23 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial() BridgeAccessible::NodeInfoType BridgeAccessible::GetNodeInfo() { - auto self = FindSelf(); - auto roleName = self->GetRoleName(); - auto name = self->GetName(); - auto toolkitName = "dali"; - auto attributes = self->GetAttributes(); - auto states = self->GetStates(); - - auto* component = Component::DownCast(self); + auto self = FindSelf(); + auto roleName = self->GetRoleName(); + auto name = self->GetName(); + auto toolkitName = "dali"; + auto attributes = self->GetAttributes(); + auto states = self->GetStates(); + + auto* component = Component::DownCast(self); Dali::Rect<> screenExtents = {0, 0, 0, 0}; Dali::Rect<> windowExtents = {0, 0, 0, 0}; - if (component) + if(component) { screenExtents = component->GetExtents(CoordinateType::SCREEN); windowExtents = component->GetExtents(CoordinateType::WINDOW); } - auto* valueInterface = Value::DownCast(self); + auto* valueInterface = Value::DownCast(self); double currentValue = 0.0; double minimumIncrement = 0.0; double maximumValue = 0.0; diff --git a/dali/internal/accessibility/bridge/bridge-base.h b/dali/internal/accessibility/bridge/bridge-base.h index 2cfcab094..cc3d6136c 100644 --- a/dali/internal/accessibility/bridge/bridge-base.h +++ b/dali/internal/accessibility/bridge/bridge-base.h @@ -58,7 +58,12 @@ public: std::string GetDescription() const override { - return ""; + return {}; + } + + std::string GetValue() const override + { + return {}; } Dali::Accessibility::Accessible* GetParent() override |