*/
virtual bool setFocus() = 0;
+ /**
+ * @copydoc UiObject::moveTo()
+ */
+ virtual bool moveTo() = 0;
+
/**
* @copydoc UIObject::updateTextMinBoundingRect()
*/
*/
bool setFocus() override;
+ /**
+ * @copydoc UiObject::moveTo()
+ */
+ bool moveTo() override;
+
/**
* @copydoc AccessibleNode::refresh()
*/
static AtspiAccessible *Atspi_accessible_get_application (AtspiAccessible *node, GError **error);
static void Atspi_accessible_clear_cache (AtspiAccessible *node);
static gboolean Atspi_component_grab_focus(AtspiComponent *obj, GError **error);
+ static gboolean Atspi_component_grab_highlight(AtspiComponent *obj, GError **error);
static void Atspi_accessible_set_cache_mask(AtspiAccessible *node, AtspiCache mask);
static AtspiValue *Atspi_accessible_get_value(AtspiAccessible *node);
static gdouble Atspi_value_get_minimum_value(AtspiValue *iface, GError **error);
*/
bool setFocus() override;
+ /**
+ * @brief TBD
+ * @since_tizen 9.0
+ */
+ bool moveTo() override;
+
/**
* @brief TBD
* @since_tizen 7.0
*/
bool setFocus() const;
+ /**
+ * @brief Moves to object.
+ *
+ * @since_tizen 9.0
+ */
+ bool moveTo() const;
+
/**
* @brief Updates object's information from atspi server.
*
return false;
}
+bool AtspiAccessibleNode::moveTo()
+{
+ AtspiComponent *component = AtspiWrapper::Atspi_accessible_get_component_iface(mNode);
+ if (component) {
+ bool ret = AtspiWrapper::Atspi_component_grab_highlight(component, NULL);
+ g_object_unref(component);
+ return ret;
+ }
+ else
+ return false;
+}
+
void AtspiAccessibleNode::refresh(bool updateAll)
{
AtspiWrapper::Atspi_accessible_clear_cache(mNode);
return atspi_component_grab_focus(obj, error);
}
+gboolean AtspiWrapper::Atspi_component_grab_highlight(AtspiComponent *obj, GError **error)
+{
+ std::unique_lock<std::recursive_mutex> lock(mMutex);
+ return atspi_component_grab_highlight(obj, error);
+}
+
void AtspiWrapper::Atspi_accessible_set_cache_mask(AtspiAccessible *node, AtspiCache mask)
{
std::unique_lock<std::recursive_mutex> lock(mMutex);
return false;
}
+bool MockAccessibleNode::moveTo()
+{
+ return false;
+}
+
void MockAccessibleNode::updateTextMinBoundingRect()
{
}
return mNode->setFocus();
}
+bool UiObject::moveTo() const
+{
+ return mNode->moveTo();
+}
+
bool UiObject::isValid() const
{
return mNode->isValid();
::grpc::Status getAngle(::grpc::ServerContext *context,
const ::aurum::ReqGetAngle *request,
::aurum::RspGetAngle *response) override;
+ ::grpc::Status moveTo(::grpc::ServerContext *context,
+ const ::aurum::ReqMoveTo *request,
+ ::aurum::RspMoveTo *response) override;
public:
int WAIT_TIMEOUT_MS;
};
#include "Commands/GetScreenSizeCommand.h"
#include "Commands/ActionAndWaitEventCommand.h"
#include "Commands/SetFocusCommand.h"
+#include "Commands/MoveToCommand.h"
#include "Commands/GetActiveAppToolkitNameCommand.h"
#include "Commands/GetTextMinBoundingRectCommand.h"
#include "Commands/SetXMLSyncCommand.h"
--- /dev/null
+/*
+ * Copyright (c) 2023 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "bootstrap.h"
+
+class MoveToCommand : public Command {
+private:
+ const ::aurum::ReqMoveTo *mRequest;
+ ::aurum::RspMoveTo *mResponse;
+
+public:
+ MoveToCommand(const ::aurum::ReqMoveTo *request,
+ ::aurum::RspMoveTo *response);
+ ::grpc::Status execute() override;
+};
files('src/Commands/GetScreenSizeCommand.cc'),
files('src/Commands/ActionAndWaitEventCommand.cc'),
files('src/Commands/SetFocusCommand.cc'),
+ files('src/Commands/MoveToCommand.cc'),
files('src/Commands/GetActiveAppToolkitNameCommand.cc'),
files('src/Commands/GetTextMinBoundingRectCommand.cc'),
files('src/Commands/SetXMLSyncCommand.cc'),
{
std::unique_ptr<GetAngleCommand> cmd = std::make_unique<GetAngleCommand>(request, response);
return execute(cmd.get(), true);
+}
+
+::grpc::Status aurumServiceImpl::moveTo(::grpc::ServerContext *context,
+ const ::aurum::ReqMoveTo *request,
+ ::aurum::RspMoveTo *response)
+{
+ std::unique_ptr<MoveToCommand> cmd = std::make_unique<MoveToCommand>(request, response);
+ return execute(cmd.get(), true);
}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2023 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "MoveToCommand.h"
+#include "UiObject.h"
+
+MoveToCommand::MoveToCommand(const ::aurum::ReqMoveTo *request,
+ ::aurum::RspMoveTo *response)
+ : mRequest{request}, mResponse{response}
+{
+}
+
+::grpc::Status MoveToCommand::execute()
+{
+ LOGI("MoveTo --------------- ");
+
+ bool ret = false;
+
+ ObjectMapper *mObjMap = ObjectMapper::getInstance();
+ std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
+ if (obj) ret = obj->moveTo();
+
+ if (ret) mResponse->set_status(::aurum::RspStatus::OK);
+ else mResponse->set_status(::aurum::RspStatus::ERROR);
+
+ return grpc::Status::OK;
+}
rpc setTimeout(ReqSetTimeout) returns (RspSetTimeout) {}
rpc setXMLSync(ReqSetXMLSync) returns (RspSetXMLSync) {}
rpc getAngle(ReqGetAngle) returns (RspGetAngle) {}
+ rpc moveTo(ReqMoveTo) returns (RspMoveTo) {}
}
// ------------------------------------ //
RspStatus status = 1;
}
+message ReqMoveTo {
+ string elementId = 1;
+}
+
+message RspMoveTo {
+ RspStatus status = 1;
+}
+
message ReqGetActiveAppToolkitName {
}