1 #include "LongClickCommand.h"
7 LongClickCommand::LongClickCommand(const ::aurum::ReqClick* request,
8 ::aurum::RspClick* response)
9 : mRequest{request}, mResponse{response}
13 ::grpc::Status LongClickCommand::execute()
15 LOG_SCOPE_F(INFO, "LongClick --------------- ");
17 ObjectMapper* mObjMap = ObjectMapper::getInstance();
18 ::aurum::ReqClick_RequestType type = mRequest->type();
20 if (type == ::aurum::ReqClick_RequestType_ELEMENTID) {
21 std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
23 obj->longClick(LOGNCLICK_INTERVAL);
24 mResponse->set_status(::aurum::RspStatus::OK);
26 mResponse->set_status(::aurum::RspStatus::ERROR);
27 } else if (type == ::aurum::ReqClick_RequestType_COORD) {
28 std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
29 const ::aurum::Point& point = mRequest->coordination();
30 obj->click(point.x(), point.y(), LOGNCLICK_INTERVAL);
31 mResponse->set_status(::aurum::RspStatus::OK);
32 } else if (type == ::aurum::ReqClick_RequestType_ATSPI) {
33 mResponse->set_status(::aurum::RspStatus::ERROR);
36 return grpc::Status::OK;