Sometimes we need to check whether it is successful or not.
Change-Id: Ie1fb3fd2fa6f6a6db51407af704a28a0c80791e7
* @brief Sets Node's value.
*
* @param[in] text string
+ *
+ * @return true if success, else false
*
* @since_tizen 6.5
*/
- virtual void setValue(std::string text) = 0;
+ virtual bool setValue(std::string text) = 0;
/**
* @brief Check object valid or not.
/**
* @copydoc AccessibleNode::setValue()
*/
- void setValue(std::string text) override;
+ bool setValue(std::string text) override;
private:
using AccessibleNode::setFeatureProperty;
* @brief TBD
* @since_tizen 6.5
*/
- void setValue(std::string text) override;
+ bool setValue(std::string text) override;
public:
using AccessibleNode::setFeatureProperty;
*
* @param[in] text string
*
- * @return string
+ * @return true if success else false
*
* @since_tizen 6.5
*/
- void setText(std::string text);
+ bool setText(std::string text);
/**
* @brief Gets object's geometry of the screen.
return false;
}
-void AtspiAccessibleNode::setValue(std::string text)
+bool AtspiAccessibleNode::setValue(std::string text)
{
if (!isValid()){
- return;
+ return false;
}
AtspiEditableText *iface = AtspiWrapper::Atspi_accessible_get_editable_text(mNode);
LOGI("set Value iface:%p obj:%p text:%s", iface, mNode, text.c_str() );
- if (iface) {
- int len = getText().length();
- AtspiWrapper::Atspi_editable_text_delete_text(iface, 0, len, NULL);
- AtspiWrapper::Atspi_editable_text_insert_text(iface, 0, text.c_str(), text.length(),
- NULL);
- }
+
+ if (!iface) return false;
+
+ refresh();
+ int len = getText().length();
+ AtspiWrapper::Atspi_editable_text_delete_text(iface, 0, len, NULL);
+ AtspiWrapper::Atspi_editable_text_insert_text(iface, 0, text.c_str(), text.length(),
+ NULL);
+ return true;
}
void AtspiAccessibleNode::setFeatureProperty(AtspiStateType type)
return false;
}
-void MockAccessibleNode::setValue(std::string text)
+bool MockAccessibleNode::setValue(std::string text)
{
mText = text;
+ return true;
}
void MockAccessibleNode::setFeatureProperty(int type)
void MockAccessibleNode::clearActions(void)
{
mActionSet.clear();
-}
\ No newline at end of file
+}
return getAccessibleNode()->getRole();
}
-void UiObject::setText(std::string text)
+bool UiObject::setText(std::string text)
{
- getAccessibleNode()->setValue(text);
+ return getAccessibleNode()->setValue(text);
}
bool UiObject::isCheckable() const
::grpc::Status SetValueCommand::execute()
{
+ bool ret = false;
LOGI("SetValue --------------- ");
LOGI("text:%s", mRequest->stringvalue().c_str());
ObjectMapper *mObjMap = ObjectMapper::getInstance();
std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
- if (obj) obj->setText(const_cast<std::string&>(mRequest->stringvalue()));
+ if (obj) ret = obj->setText(const_cast<std::string&>(mRequest->stringvalue()));
+
+ if (ret) mResponse->set_status(::aurum::RspStatus::OK);
+ else mResponse->set_status(::aurum::RspStatus::ERROR);
+
return grpc::Status::OK;
}