/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2022 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.
const std::shared_ptr<UiSelector> selector) const
{
std::vector<std::shared_ptr<UiObject>> result{};
- auto nodes = Comparer::findObjects(mDevice, selector, getAccessibleNode());
+
+ std::vector<std::shared_ptr<AccessibleNode>> nodes{};
+ Comparer::findObjects(nodes, mDevice, selector, getAccessibleNode());
for ( auto& node : nodes) {
if (!node) {
LOGI("Skipped! (node == nullptr)");
std::vector<std::shared_ptr<UiObject>> UiObject::getChildren() const
{
- auto sel = Sel::depth(1);
- return this->findObjects(sel);
+ std::vector<std::shared_ptr<UiObject>> ret{};
+
+ auto children = getAccessibleNode()->getChildren();
+ for (auto &child : children) {
+ ret.push_back(std::make_shared<UiObject>(mDevice, mSelector, child));
+ }
+
+ return ret;
}
std::shared_ptr<Node> UiObject::getDescendant()
return getAccessibleNode()->getAutomationId();
}
-std::string UiObject::getElementType() const
+std::string UiObject::getType() const
{
return getAccessibleNode()->getType();
}
return getAccessibleNode()->getXPath();
}
+const double UiObject::getMinValue() const
+{
+ return getAccessibleNode()->getMinValue();
+}
+
+const double UiObject::getMaxValue() const
+{
+ return getAccessibleNode()->getMaxValue();
+}
+
+const double UiObject::getValue() const
+{
+ return getAccessibleNode()->getValue();
+}
+
+const double UiObject::getIncrement() const
+{
+ return getAccessibleNode()->getIncrement();
+}
+
+const Rect<int> UiObject::getTextMinBoundingRect() const
+{
+ return getAccessibleNode()->getTextMinBoundingRect();
+}
+
+bool UiObject::setValue(double value)
+{
+ return getAccessibleNode()->setValue(value);
+}
+
bool UiObject::setText(std::string text)
{
return getAccessibleNode()->setValue(text);
}
+std::string UiObject::getOcrText() const
+{
+ return getAccessibleNode()->getOcrText();
+}
+
+std::string UiObject::getToolkitName() const
+{
+ getAccessibleNode()->updateToolkitName();
+ return getAccessibleNode()->getToolkitName();
+}
+
+void UiObject::setOcrText(std::string text)
+{
+ getAccessibleNode()->setOcrText(text);
+}
+
bool UiObject::isCheckable() const
{
return getAccessibleNode()->isCheckable();
return getAccessibleNode()->isActive();
}
+bool UiObject::isHighlightable() const
+{
+ return getAccessibleNode()->isHighlightable();
+}
+
void UiObject::refresh() const
{
mNode->refresh();
mNode->updateXPath();
}
+void UiObject::updateValue() const
+{
+ mNode->updateValue();
+}
+
+void UiObject::updatePid() const
+{
+ mNode->updatePid();
+}
+
+void UiObject::updateToolkitName() const
+{
+ mNode->updateToolkitName();
+}
+
+void UiObject::updateTextMinBoundingRect() const
+{
+ mNode->updateTextMinBoundingRect();
+}
+
bool UiObject::setFocus() const
{
return mNode->setFocus();