From: Hosang Kim Date: Fri, 7 Feb 2025 09:10:27 +0000 (+0900) Subject: libaurum: add highlighted property X-Git-Tag: accepted/tizen/unified/20250221.111437~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F319306%2F5;p=platform%2Fcore%2Fuifw%2Faurum.git libaurum: add highlighted property Change-Id: I74c12ecf39cd27cedf4b3c4eb17ae871d138b0a8 --- diff --git a/libaurum/inc/Accessibility/AccessibleNode.h b/libaurum/inc/Accessibility/AccessibleNode.h index 87e30df..4bf4a37 100644 --- a/libaurum/inc/Accessibility/AccessibleNode.h +++ b/libaurum/inc/Accessibility/AccessibleNode.h @@ -77,7 +77,8 @@ enum class NodeFeatureProperties { SHOWING = 0X0800, ACTIVE = 0X1000, HIGHLIGHTABLE = 0X2000, - INVALID = 0X4000, + HIGHLIGHTED = 0X4000, + INVALID = 0X8000, }; /** @@ -408,6 +409,11 @@ public: */ bool isHighlightable() const; + /** + * @copydoc UiObject::isHighlighted() + */ + bool isHighlighted() const; + public: /** * @brief Print Node information. diff --git a/libaurum/inc/UiObject.h b/libaurum/inc/UiObject.h index 0d9ea68..cf6865e 100644 --- a/libaurum/inc/UiObject.h +++ b/libaurum/inc/UiObject.h @@ -580,6 +580,15 @@ public: */ bool isHighlightable() const; + /** + * @brief Gets object's highlighted property. + * + * @return true if highlighted else false + * + * @since_tizen 10.0 + */ + bool isHighlighted() const; + /** * @brief Performs a click action on object. * diff --git a/libaurum/inc/UiSelector.h b/libaurum/inc/UiSelector.h index 93d0ce9..dcf9c7d 100644 --- a/libaurum/inc/UiSelector.h +++ b/libaurum/inc/UiSelector.h @@ -348,6 +348,17 @@ public: */ UiSelector *isHighlightable(bool condition); + /** + * @brief Sets the search criteria to match the object that is highlighted. + * + * @param[in] condition object's highlighted condition + * + * @return UiSelector class instance + * + * @since_tizen 10.0 + */ + UiSelector *isHighlighted(bool condition); + /** * @brief Sets the child selector. * @@ -456,6 +467,7 @@ public: bool mMatchVisible; bool mMatchSelectable; bool mMatchHighlightable; + bool mMatchHighlighted; int mMinDepth; int mMaxDepth; @@ -473,6 +485,7 @@ public: bool mIsvisible; bool mIsselectable; bool mIshighlightable; + bool mIshighlighted; bool mGeometryIsEqual; diff --git a/libaurum/src/Accessibility/AccessibleNode.cc b/libaurum/src/Accessibility/AccessibleNode.cc index b373c27..ebf0749 100644 --- a/libaurum/src/Accessibility/AccessibleNode.cc +++ b/libaurum/src/Accessibility/AccessibleNode.cc @@ -315,6 +315,11 @@ bool AccessibleNode::isHighlightable() const return hasFeatureProperty(NodeFeatureProperties::HIGHLIGHTABLE); } +bool AccessibleNode::isHighlighted() const +{ + return hasFeatureProperty(NodeFeatureProperties::HIGHLIGHTED); +} + double AccessibleNode::getMinValue() const { return mMinValue; diff --git a/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc b/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc index ed571b3..192125c 100644 --- a/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc +++ b/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc @@ -591,6 +591,9 @@ void AtspiAccessibleNode::setFeatureProperty(AtspiStateType type) case ATSPI_STATE_HIGHLIGHTABLE: setFeatureProperty(NodeFeatureProperties::HIGHLIGHTABLE, true); break; + case ATSPI_STATE_HIGHLIGHTED: + setFeatureProperty(NodeFeatureProperties::HIGHLIGHTED, true); + break; case ATSPI_STATE_DEFUNCT: case ATSPI_STATE_INVALID: setFeatureProperty(NodeFeatureProperties::INVALID, true); diff --git a/libaurum/src/PartialMatch.cc b/libaurum/src/PartialMatch.cc index a18b3cd..a1e320d 100644 --- a/libaurum/src/PartialMatch.cc +++ b/libaurum/src/PartialMatch.cc @@ -110,6 +110,7 @@ bool PartialMatch::checkCriteria(const std::shared_ptr selector, if (selector->mMatchVisible && checkCriteria(selector->mIsvisible, node->isVisible())) return false; if (selector->mMatchSelectable && checkCriteria(selector->mIsselectable, node->isSelectable())) return false; if (selector->mMatchHighlightable && checkCriteria(selector->mIshighlightable, node->isHighlightable())) return false; + if (selector->mMatchHighlighted && checkCriteria(selector->mIshighlighted, node->isHighlighted())) return false; return true; } diff --git a/libaurum/src/UiObject.cc b/libaurum/src/UiObject.cc index 75c1bbf..bec1d6d 100644 --- a/libaurum/src/UiObject.cc +++ b/libaurum/src/UiObject.cc @@ -377,6 +377,11 @@ bool UiObject::isHighlightable() const return mNode->isHighlightable(); } +bool UiObject::isHighlighted() const +{ + return mNode->isHighlighted(); +} + void UiObject::refresh() const { mNode->refresh(); diff --git a/libaurum/src/UiSelector.cc b/libaurum/src/UiSelector.cc index 423e07c..531314a 100644 --- a/libaurum/src/UiSelector.cc +++ b/libaurum/src/UiSelector.cc @@ -26,9 +26,9 @@ UiSelector::UiSelector() mMatchId{}, mMatchAutomationId{}, mMatchRole{}, mMatchText{}, mMatchPkg{}, mMatchType{}, mMatchStyle{}, mMatchTextPartialMatch{}, mMatchXPath{}, mMatchOcrText{}, mMatchGeometry{}, mMatchDescription{}, mMatchImgSrc{}, mMatchChecked{}, mMatchCheckable{}, mMatchClickable{}, mMatchEnabled{}, mMatchFocused{}, mMatchFocusable{}, mMatchScrollable{}, mMatchSelected{}, mMatchShowing{}, mMatchActive{}, mMatchVisible{}, - mMatchSelectable{}, mMatchHighlightable{}, mMinDepth{}, mMaxDepth{}, mIschecked{}, mIscheckable{}, mIsclickable{}, mIsenabled{}, + mMatchSelectable{}, mMatchHighlightable{}, mMatchHighlighted{}, mMinDepth{}, mMaxDepth{}, mIschecked{}, mIscheckable{}, mIsclickable{}, mIsenabled{}, mIsfocused{}, mIsfocusable{}, mIsscrollable{}, mIsselected{}, mIsshowing{}, mIsactive{}, mIsvisible{}, - mIsselectable{}, mIshighlightable{}, mGeometryIsEqual{}, mChild{}, mParent{}, mGeometry{} + mIsselectable{}, mIshighlightable{}, mIshighlighted{}, mGeometryIsEqual{}, mChild{}, mParent{}, mGeometry{} { } @@ -77,6 +77,7 @@ std::string UiSelector::description() if(this->mMatchVisible) ss << "\"mMatchVisible\":\"" << ((this->mMatchVisible)?"true":"false") << "\", "; if(this->mMatchSelectable) ss << "\"mMatchSelectable\":\"" << ((this->mMatchSelectable)?"true":"false") << "\", "; if(this->mMatchHighlightable) ss << "\"mMatchHighlightable\":\"" << ((this->mMatchHighlightable)?"true":"false") << "\", "; + if(this->mMatchHighlighted) ss << "\"mMatchHighlighted\":\"" << ((this->mMatchHighlighted)?"true":"false") << "\", "; if(this->mParent) { ss << "\"mParent\":" << this->mParent->description(); } @@ -278,6 +279,13 @@ UiSelector *UiSelector::isHighlightable(bool condition) return this; } +UiSelector *UiSelector::isHighlighted(bool condition) +{ + this->mIshighlighted = condition; + this->mMatchHighlighted = true; + return this; +} + UiSelector *UiSelector::hasChild(std::shared_ptr child) { mChild.push_back(child); diff --git a/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc index eb39d54..8faacbd 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc @@ -77,6 +77,7 @@ void DumpObjectTreeCommand::traverse(::aurum::Element *root, std::shared_ptrset_isvisible(obj->isVisible()); root->set_isselectable(obj->isSelectable()); root->set_ishighlightable(obj->isHighlightable()); + root->set_ishighlighted(obj->isHighlighted()); root->set_minvalue(obj->getMinValue()); root->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc index 12e202f..e5376ec 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc @@ -72,6 +72,7 @@ std::shared_ptr FindElementCommand::getSelector(void) if(mRequest->reqIsvisible_case()) sel->isVisible(mRequest->isvisible()); if(mRequest->reqIsselectable_case()) sel->isSelectable(mRequest->isselectable()); if(mRequest->reqIshighlightable_case()) sel->isHighlightable(mRequest->ishighlightable()); + if(mRequest->reqIshighlighted_case()) sel->isHighlighted(mRequest->ishighlighted()); if(mRequest->reqDescription_case()) sel->description(mRequest->description()); if(mRequest->reqImgSrc_case()) sel->imgSrc(mRequest->imgsrc()); @@ -140,6 +141,7 @@ std::shared_ptr FindElementCommand::getSelector(void) elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/FindElementsCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/FindElementsCommand.cc index 8a5d68f..2a125f1 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/FindElementsCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/FindElementsCommand.cc @@ -72,6 +72,7 @@ std::vector> FindElementsCommand::getSelectors(void) if(mRequest->reqIsvisible_case()) sel->isVisible(mRequest->isvisible()); if(mRequest->reqIsselectable_case()) sel->isSelectable(mRequest->isselectable()); if(mRequest->reqIshighlightable_case()) sel->isHighlightable(mRequest->ishighlightable()); + if(mRequest->reqIshighlighted_case()) sel->isHighlighted(mRequest->ishighlighted()); if(mRequest->reqDescription_case()) sel->description(mRequest->description()); if(mRequest->reqImgSrc_case()) sel->imgSrc(mRequest->imgsrc()); @@ -147,6 +148,7 @@ std::vector> FindElementsCommand::getSelectors(void) elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/FirstCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/FirstCommand.cc index a7c5f4a..fcb60b6 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/FirstCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/FirstCommand.cc @@ -87,6 +87,7 @@ FirstCommand::FirstCommand(const ::aurum::ReqFirst *request, elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/LastCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/LastCommand.cc index 85b7de6..720376d 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/LastCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/LastCommand.cc @@ -87,6 +87,7 @@ LastCommand::LastCommand(const ::aurum::ReqLast *request, elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/NextCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/NextCommand.cc index 08b0fc6..7bb53e7 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/NextCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/NextCommand.cc @@ -87,6 +87,7 @@ NextCommand::NextCommand(const ::aurum::ReqNext *request, elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/org.tizen.aurum-bootstrap/src/Commands/PrevCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/PrevCommand.cc index 54475df..a97e6ca 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/PrevCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/PrevCommand.cc @@ -87,6 +87,7 @@ PrevCommand::PrevCommand(const ::aurum::ReqPrev *request, elm->set_isvisible(obj->isVisible()); elm->set_isselectable(obj->isSelectable()); elm->set_ishighlightable(obj->isHighlightable()); + elm->set_ishighlighted(obj->isHighlighted()); elm->set_minvalue(obj->getMinValue()); elm->set_maxvalue(obj->getMaxValue()); diff --git a/protocol/aurum.proto b/protocol/aurum.proto index 1492f09..177b414 100644 --- a/protocol/aurum.proto +++ b/protocol/aurum.proto @@ -109,6 +109,8 @@ message Element { string interface = 33; string description = 34; string imgSrc = 35; + + bool isHighlighted = 36; } message Point { @@ -239,6 +241,10 @@ message ReqFindElement { } repeated ReqFindElement children = 27; + + oneof reqIshighlighted { + bool isHighlighted = 29; + } } message RspFindElement { @@ -355,6 +361,10 @@ message ReqFindElements { } repeated ReqFindElements children = 27; + + oneof reqIshighlighted { + bool isHighlighted = 29; + } } message RspFindElements {