libaurum: add highlighted property 06/319306/5
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 7 Feb 2025 09:10:27 +0000 (18:10 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Tue, 18 Feb 2025 10:42:11 +0000 (19:42 +0900)
Change-Id: I74c12ecf39cd27cedf4b3c4eb17ae871d138b0a8

16 files changed:
libaurum/inc/Accessibility/AccessibleNode.h
libaurum/inc/UiObject.h
libaurum/inc/UiSelector.h
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc
libaurum/src/PartialMatch.cc
libaurum/src/UiObject.cc
libaurum/src/UiSelector.cc
org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc
org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc
org.tizen.aurum-bootstrap/src/Commands/FindElementsCommand.cc
org.tizen.aurum-bootstrap/src/Commands/FirstCommand.cc
org.tizen.aurum-bootstrap/src/Commands/LastCommand.cc
org.tizen.aurum-bootstrap/src/Commands/NextCommand.cc
org.tizen.aurum-bootstrap/src/Commands/PrevCommand.cc
protocol/aurum.proto

index 87e30dfe31f0dfe29773b36b4c7978260655a87a..4bf4a37745392a2cfcab4a21129ee2175fe8ac34 100644 (file)
@@ -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.
index 0d9ea6847ce253237da1e43d71bec1e285a6bd9b..cf6865efc4fde89fa0c97edb62654575f71b0ef8 100644 (file)
@@ -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.
      *
index 93d0ce9285083752819b8bd80928071b8d7cf957..dcf9c7d9bbb86a7c15bd333dd0dd93432f0e2960 100644 (file)
@@ -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;
 
index b373c27d304a169d94241cec92371d934c025a7f..ebf0749664f5b6c47b75ac6ae8027c5e5b3eca2b 100644 (file)
@@ -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;
index ed571b35baf399e959dbf4949fc655a358e9da31..192125cad30227ca1a6c672a0c64ff6ba226d25f 100644 (file)
@@ -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);
index a18b3cd67c325670272266efa1c68b053ee73e73..a1e320d312f290a07d75c3ff44b774fb25afde84 100644 (file)
@@ -110,6 +110,7 @@ bool PartialMatch::checkCriteria(const std::shared_ptr<UiSelector> 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;
 }
index 75c1bbf664cd33ecd899bdd532e64e1c626f95a1..bec1d6db2b16173570ab180e876075d874f9a7c9 100644 (file)
@@ -377,6 +377,11 @@ bool UiObject::isHighlightable() const
     return mNode->isHighlightable();
 }
 
+bool UiObject::isHighlighted() const
+{
+    return mNode->isHighlighted();
+}
+
 void UiObject::refresh() const
 {
     mNode->refresh();
index 423e07c68af4e3d18331bf9d0ad4cc7057f36481..531314a75e5e10739bb6237c4493f410da34b872 100644 (file)
@@ -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<UiSelector> child)
 {
     mChild.push_back(child);
index eb39d546aab51b1962cb5d2708d91df1cdf3fdb5..8faacbd0dbcd3cb9fe23da79ee3630b06b7b96ab 100644 (file)
@@ -77,6 +77,7 @@ void DumpObjectTreeCommand::traverse(::aurum::Element *root, std::shared_ptr<Nod
     root->set_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());
index 12e202f5ce8a7da6aa794b8d250461f90a6a26ba..e5376ec320393943737cac69145d72da702560c9 100644 (file)
@@ -72,6 +72,7 @@ std::shared_ptr<UiSelector> 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<UiSelector> 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());
index 8a5d68f7d3904bae7f45230249a9a7c7c394c029..2a125f1c311bdcdb370389cf426136f3da82689d 100644 (file)
@@ -72,6 +72,7 @@ std::vector<std::shared_ptr<UiSelector>> 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<std::shared_ptr<UiSelector>> 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());
index a7c5f4ac27184f6dbcfa17ce8e532e398cf60e8f..fcb60b698f59cb1a0451d2a37d35766341aa0ad0 100644 (file)
@@ -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());
index 85b7de6cf4fce374fcf0c12d8cf6618eb3a48282..720376d35d8def902ce14ad24fb5a8c53433c41e 100644 (file)
@@ -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());
index 08b0fc648c6eb079f01e8bf89b2a0a367ccd06f8..7bb53e76e893f71d7cdec60049f87a281c6f14d0 100644 (file)
@@ -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());
index 54475df05cfa149c1750bd7cb1d9346778bc0924..a97e6cad132f56a793e8cacabb4d1f4b119864f5 100644 (file)
@@ -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());
index 1492f091a31c8a7f2baf30565cdfd961c86cd6d2..177b41472a6ed42b1269ef6cfeb8b59940c75d2b 100644 (file)
@@ -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 {