Some widget use description property for subtext.
Change-Id: Ie7504bba3afdd5d0571ee304eb23d23ba81433c0
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
std::string getInterface() const;
+ /**
+ * @copydoc UiObject::getDescription()
+ */
+ std::string getDescription() const;
+
/**
* @copydoc UiObject::isCheckable()
*/
std::string mXPath;
std::string mToolkitName;
std::string mInterface;
+ std::string mDescription;
Rect<int> mScreenBoundingBox;
Rect<int> mWindowBoundingBox;
Rect<int> mTextMinBoundingRect;
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static GArray *Atspi_accessible_get_children(AtspiAccessible *node, GError **error);
static AtspiAccessible *Atspi_accessible_get_child_at_index(AtspiAccessible *node, int index, GError **error);
static AtspiAccessible *Atspi_accessible_get_parent(AtspiAccessible *node, GError **error);
+ static gchar *Atspi_accessible_get_description(AtspiAccessible *node, GError **error);
static AtspiStateSet *Atspi_accessible_get_state_set(AtspiAccessible *node);
static gboolean Atspi_state_set_contains(AtspiStateSet *set , AtspiStateType state);
static gchar *Atspi_accessible_get_role_name(AtspiAccessible *node, GError **error);
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
bool setValue(double value);
+ /**
+ * @brief Gets object's description.
+ *
+ * @return string
+ *
+ * @since_tizen 7.0
+ */
+ std::string getDescription() const;
+
/**
* @brief Gets object's checkable property.
*
*/
UiSelector *geometry(Rect<int> geometry, bool isEqual);
+ /**
+ * @brief Sets the search criteria to match the object's description.
+ *
+ * @param[in] description object description
+ *
+ * @return UiSelector class instance
+ *
+ * @since_tizen 7.0
+ */
+ UiSelector *description(std::string description);
+
public:
std::string mId;
std::string mAutomationId;
std::string mTextPartialMatch;
std::string mXPath;
std::string mOcrText;
+ std::string mDescription;
bool mMatchId;
bool mMatchAutomationId;
bool mMatchXPath;
bool mMatchOcrText;
bool mMatchGeometry;
+ bool mMatchDescription;
bool mMatchChecked;
bool mMatchCheckable;
}
AccessibleNode::AccessibleNode()
-: mText{""}, mOcrText{""}, mPkg{""}, mRole{""}, mId{""}, mAutomationId{""}, mType{""}, mStyle{""}, mXPath{""}, mToolkitName{""},
- mScreenBoundingBox{0,0,0,0}, mWindowBoundingBox{0,0,0,0}, mSupportingIfaces(0), mFeatureProperty(0), mPid(0), mWindowAngle(0), mTargetAngle(0), mMinValue{0.0}, mMaxValue{0.0}, mValue{0.0}, mIncrement{0.0}, mValid{true}, mLock{}
+: mText{""}, mOcrText{""}, mPkg{""}, mRole{""}, mId{""}, mAutomationId{""}, mType{""}, mStyle{""}, mXPath{""}, mToolkitName{""}, mInterface{""}, mDescription{""},
+ mScreenBoundingBox{0,0,0,0}, mWindowBoundingBox{0,0,0,0}, mTextMinBoundingRect{0,0,0,0}, mSupportingIfaces(0), mFeatureProperty(0), mPid(0), mWindowAngle(0), mTargetAngle(0), mMinValue{0.0}, mMaxValue{0.0}, mValue{0.0}, mIncrement{0.0}, mValid{true}, mLock{}
{
}
ss << "\"mAutomationId\":\"" << this->mAutomationId << "\", ";
ss << "\"mRole\":\"" << this->mRole << "\", ";
ss << "\"mText\":\"" << this->mText << "\", ";
+ ss << "\"mDescription\":\"" << this->mDescription << "\", ";
ss << "\"mOcrText\":\"" << this->mOcrText << "\", ";
ss << "\"mPkg\":\"" << this->mPkg << "\", ";
ss << "\"mType\":\"" << this->mType << "\", ";
return mInterface;
}
+std::string AccessibleNode::getDescription() const
+{
+ return mDescription;
+}
+
bool AccessibleNode::isCheckable() const
{
return hasFeatureProperty(NodeFeatureProperties::CHECKABLE);
Rect<int> AccessibleNode::getTextMinBoundingRect() const
{
return mTextMinBoundingRect;
-}
\ No newline at end of file
+}
mText = name;
g_free(name);
}
+
+ gchar *description = AtspiWrapper::Atspi_accessible_get_description(mNode, NULL);
+ if (description) {
+ mDescription = description;
+ g_free(description);
+ }
}
void AtspiAccessibleNode::updateToolkitName()
return atspi_accessible_get_parent(node, error);
}
+gchar *AtspiWrapper::Atspi_accessible_get_description(AtspiAccessible *node, GError **error)
+{
+ std::unique_lock<std::recursive_mutex> lock(mMutex);
+ return atspi_accessible_get_description(node, error);
+}
+
AtspiStateSet *AtspiWrapper::Atspi_accessible_get_state_set(AtspiAccessible *node)
{
std::unique_lock<std::recursive_mutex> lock(mMutex);
node->updateExtents();
if (checkCriteria(selector->mGeometry, node->getScreenBoundingBox(), selector->mGeometryIsEqual)) return false;
}
+ if (selector->mMatchDescription) {
+ node->updateName();
+ if (checkCriteria(selector->mDescription, node->getDescription(), 0)) return false;
+ }
if (selector->mMatchChecked && checkCriteria(selector->mIschecked, node->isChecked())) return false;
if (selector->mMatchCheckable && checkCriteria(selector->mIscheckable, node->isCheckable())) return false;
if (selector->mMatchClickable && checkCriteria(selector->mIsclickable, node->isClickable())) return false;
return mNode->getInterface();
}
+std::string UiObject::getDescription() const
+{
+ return mNode->getDescription();
+}
+
bool UiObject::setValue(double value)
{
return mNode->setValue(value);
using namespace Aurum;
UiSelector::UiSelector()
-: mId{}, mAutomationId{}, mRole{}, mText{}, mPkg{}, mType{}, mStyle{}, mTextPartialMatch{}, mXPath{}, mOcrText{},
+: mId{}, mAutomationId{}, mRole{}, mText{}, mPkg{}, mType{}, mStyle{}, mTextPartialMatch{}, mXPath{}, mOcrText{}, mDescription{},
mMatchId{}, mMatchAutomationId{}, mMatchRole{}, mMatchText{}, mMatchPkg{}, mMatchType{}, mMatchStyle{},
- mMatchTextPartialMatch{}, mMatchXPath{}, mMatchOcrText{}, mMatchGeometry{}, mMatchChecked{}, mMatchCheckable{}, mMatchClickable{}, mMatchEnabled{},
+ mMatchTextPartialMatch{}, mMatchXPath{}, mMatchOcrText{}, mMatchGeometry{}, mMatchDescription{}, mMatchChecked{}, mMatchCheckable{}, mMatchClickable{}, mMatchEnabled{},
mMatchFocused{}, mMatchFocusable{}, mMatchScrollable{}, mMatchSelected{}, mMatchShowing{}, mMatchActive{}, mMatchVisible{},
mMatchSelectable{}, mMatchHighlightable{}, mMinDepth{}, mMaxDepth{}, mIschecked{}, mIscheckable{}, mIsclickable{}, mIsenabled{},
mIsfocused{}, mIsfocusable{}, mIsscrollable{}, mIsselected{}, mIsshowing{}, mIsactive{}, mIsvisible{},
if(!this->mAutomationId.empty()) ss << "\"mAutomationId\":\"" << this->mAutomationId << "\", ";
if(!this->mRole.empty()) ss << "\"mRole\":\"" << this->mRole << "\", ";
if(!this->mText.empty()) ss << "\"mText\":\"" << this->mText << "\", ";
+ if(!this->mDescription.empty()) ss << "\"mDescription\":\"" << this->mDescription << "\", ";
if(!this->mOcrText.empty()) ss << "\"mOcrText\":\"" << this->mOcrText << "\", ";
if(!this->mTextPartialMatch.empty()) ss << "\"mTextPartialMatch\":\"" << this->mTextPartialMatch << "\", ";
if(!this->mXPath.empty()) ss << "\"mXPath\":\"" << this->mXPath << "\", ";
if(this->mMatchType) ss << "\"mMatchType\":\"" << ((this->mMatchType)?"true":"false") << "\", ";
if(this->mMatchStyle) ss << "\"mMatchStyle\":\"" << ((this->mMatchStyle)?"true":"false" )<< "\", ";
if(this->mMatchGeometry) ss << "\"mMatchGeometry\":\"" << ((this->mMatchGeometry)?"true":"false" )<< "\", ";
+ if(this->mMatchDescription) ss << "\"mMatchDescription\":\"" << ((this->mMatchDescription)?"true":"false") << "\", ";
if(this->mMinDepth) ss << "\"mMinDepth\":\"" << this->mMinDepth << "\", ";
if(this->mMaxDepth) ss << "\"mMaxDepth\":\"" << this->mMaxDepth << "\", ";
if(this->mMatchChecked) ss << "\"mMatchChecked\":\"" << ((this->mMatchChecked)?"true":"false") << "\", ";
this->mMatchGeometry = true;
return this;
}
+
+UiSelector *UiSelector::description(std::string description)
+{
+ this->mDescription = description;
+ this->mMatchDescription = true;
+ return this;
+}
root->set_targetangle(obj->getTargetAngle());
root->set_interface(obj->getInterface());
+ root->set_description(obj->getDescription());
for( auto && childNode : node->mChildren) {
::aurum::Element *child = root->add_child();
if(mRequest->_isvisible_case()) sel->isVisible(mRequest->isvisible());
if(mRequest->_isselectable_case()) sel->isSelectable(mRequest->isselectable());
if(mRequest->_ishighlightable_case()) sel->isHighlightable(mRequest->ishighlightable());
+ if(mRequest->_description_case()) sel->description(mRequest->description());
return sel;
}
elm->set_targetangle(obj->getTargetAngle());
elm->set_interface(obj->getInterface());
+ elm->set_description(obj->getDescription());
mResponse->set_status(::aurum::RspStatus::OK);
} else {
if(mRequest->_isvisible_case()) sel->isVisible(mRequest->isvisible());
if(mRequest->_isselectable_case()) sel->isSelectable(mRequest->isselectable());
if(mRequest->_ishighlightable_case()) sel->isHighlightable(mRequest->ishighlightable());
+ if(mRequest->_description_case()) sel->description(mRequest->description());
+
return std::vector<std::shared_ptr<UiSelector>>{sel};
}
elm->set_targetangle(obj->getTargetAngle());
elm->set_interface(obj->getInterface());
+ elm->set_description(obj->getDescription());
}
mResponse->set_status(::aurum::RspStatus::OK);
} else {
int32 targetAngle = 32;
string interface = 33;
+ string description = 34;
}
message Point {
bool isHighlightable = 25;
}
- repeated ReqFindElement children = 26;
+ oneof _description {
+ string description = 26;
+ }
+
+ repeated ReqFindElement children = 27;
}
message RspFindElement {
bool isHighlightable = 25;
}
- repeated ReqFindElements children = 26;
+ oneof _description {
+ string description = 26;
+ }
+
+ repeated ReqFindElements children = 27;
}
message RspFindElements {