std::string getOcrText() const override;
/**
+ * @copydoc UiObject::getWindowAngle()
+ */
+ int getWindowAngle() const override;
+
+ /**
+ * @copydoc UiObject::getTargetAngle()
+ */
+ int getTargetAngle() const override;
+
+ /**
* @copydoc UiObject::isFocusable()
*/
bool isFocusable() const override;
void setOcrText(std::string text);
/**
+ * @brief Sets Node's angle of window.
+ *
+ * @param[in] int window angle
+ *
+ * @since_tizen 7.5
+ */
+ void setWindowAngle(int windowAngle);
+
+ /**
+ * @brief Sets Node's angle of target device.
+ *
+ * @param[in] int target angle
+ *
+ * @since_tizen 7.5
+ */
+ void setTargetAngle(int targetAngle);
+
+ /**
* @copydoc UiObject::getPkg()
*/
std::string getPkg() const;
int mSupportingIfaces;
int mFeatureProperty;
int mPid;
+ int mWindowAngle;
+ int mTargetAngle;
double mMinValue;
double mMaxValue;
double mValue;
virtual std::string getOcrText() const = 0;
/**
+ * @copydoc UiObject::getWindowAngle()
+ */
+ virtual int getWindowAngle() const = 0;
+
+ /**
+ * @copydoc UiObject::getTargetAngle()
+ */
+ virtual int getTargetAngle() const = 0;
+
+ /**
* @copydoc UiObject::isFocusable()
*/
virtual bool isFocusable() const = 0;
*/
bool getWithScreenAnalyzer();
+ /**
+ * @brief Gets angle of root window.
+ *
+ * @return window angle int
+ *
+ * @since_tizen 7.5
+ */
+ int getWindowAngle();
+
+ /**
+ * @brief Gets angle of target device.
+ *
+ * @return target angle int
+ *
+ * @since_tizen 7.5
+ */
+ int getTargetAngle();
+
private:
/**
* @brief Waits process idle.
std::string getOcrText() const override;
/**
+ * @brief Gets object's angle of window.
+ *
+ * @return int
+ *
+ * @since_tizen 7.5
+ */
+ int getWindowAngle() const override;
+
+ /**
+ * @brief Gets object's angle of target device.
+ *
+ * @return int
+ *
+ * @since_tizen 7.5
+ */
+ int getTargetAngle() const override;
+
+ /**
* @brief Gets object's focusable property.
*
* @return true if focusable else false
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), mMinValue{0.0}, mMaxValue{0.0}, mValue{0.0}, mIncrement{0.0}, mValid{true}, mLock{}
+ 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{}
{
}
return mOcrText;
}
+int AccessibleNode::getWindowAngle() const
+{
+ return mWindowAngle;
+}
+
+int AccessibleNode::getTargetAngle() const
+{
+ return mTargetAngle;
+}
+
void AccessibleNode::setOcrText(std::string text)
{
mOcrText = text;
}
+void AccessibleNode::setWindowAngle(int windowAngle)
+{
+ mWindowAngle = windowAngle;
+}
+
+void AccessibleNode::setTargetAngle(int targetAngle)
+{
+ mTargetAngle = targetAngle;
+}
+
std::string AccessibleNode::getPkg() const
{
return mPkg;
std::transform(wins.begin(), wins.end(), std::back_inserter(ret),
[&](std::shared_ptr<AccessibleWindow> window) {
window->getAccessibleNode()->updateApplication();
+ window->getAccessibleNode()->setWindowAngle(tWin->getWindowAngle());
+ window->getAccessibleNode()->setTargetAngle(tWin->getTargetAngle());
LOGI("Target window add pkg: (%s), name (%s)", window->getAccessibleNode()->getPkg().c_str(), window->getTitle().c_str());
return window->getAccessibleNode();
}
{
return AccessibleWatcher::getInstance()->registerCallback(type, cb, data);
}
+
+int UiDevice::getWindowAngle()
+{
+ auto wins = getWindowRoot();
+
+ if (wins.size() > 0) return wins[0]->getWindowAngle();
+
+ return 0;
+}
+
+int UiDevice::getTargetAngle()
+{
+ auto wins = getWindowRoot();
+
+ if (wins.size() > 0) return wins[0]->getTargetAngle();
+
+ return 0;
+}
\ No newline at end of file
return getAccessibleNode()->getOcrText();
}
+int UiObject::getWindowAngle() const
+{
+ return getAccessibleNode()->getWindowAngle();
+}
+
+int UiObject::getTargetAngle() const
+{
+ return getAccessibleNode()->getTargetAngle();
+}
+
std::string UiObject::getToolkitName() const
{
getAccessibleNode()->updateToolkitName();
::grpc::Status setXMLSync(::grpc::ServerContext *context,
const ::aurum::ReqSetXMLSync *request,
::aurum::RspSetXMLSync *response) override;
+ ::grpc::Status getAngle(::grpc::ServerContext *context,
+ const ::aurum::ReqGetAngle *request,
+ ::aurum::RspGetAngle *response) override;
public:
int WAIT_TIMEOUT_MS;
};
#include "Commands/EnableScreenAnalyzerCommand.h"
#include "Commands/GetTextMinBoundingRectCommand.h"
-#include "Commands/SetXMLSyncCommand.h"
\ No newline at end of file
+#include "Commands/SetXMLSyncCommand.h"
+#include "Commands/GetAngleCommand.h"
\ 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 <gio/gio.h>
+#include <grpcpp/grpcpp.h>
+#include "Commands/Command.h"
+#include "ObjectMapper.h"
+#include <aurum.grpc.pb.h>
+#include "config.h"
+
+class GetAngleCommand : public Command {
+private:
+ const ::aurum::ReqGetAngle *mRequest;
+ ::aurum::RspGetAngle *mResponse;
+
+public:
+ GetAngleCommand(const ::aurum::ReqGetAngle *request,
+ ::aurum::RspGetAngle *response);
+ ::grpc::Status execute() override;
+};
\ No newline at end of file
files('src/Commands/EnableScreenAnalyzerCommand.cc'),
files('src/Commands/GetTextMinBoundingRectCommand.cc'),
files('src/Commands/SetXMLSyncCommand.cc'),
+ files('src/Commands/GetAngleCommand.cc'),
]
bootstrap_svr_dep = [
{
std::unique_ptr<SetXMLSyncCommand> cmd = std::make_unique<SetXMLSyncCommand>(request, response);
return execute(cmd.get(), true);
+}
+
+::grpc::Status aurumServiceImpl::getAngle(::grpc::ServerContext *context,
+ const ::aurum::ReqGetAngle *request,
+ ::aurum::RspGetAngle *response)
+{
+ std::unique_ptr<GetAngleCommand> cmd = std::make_unique<GetAngleCommand>(request, response);
+ return execute(cmd.get(), true);
}
\ No newline at end of file
root->set_value(obj->getValue());
root->set_increment(obj->getIncrement());
+ root->set_windowangle(obj->getWindowAngle());
+ root->set_targetangle(obj->getTargetAngle());
+
for( auto && childNode : node->mChildren) {
::aurum::Element *child = root->add_child();
traverse(child, childNode, depth+1);
elm->set_value(obj->getValue());
elm->set_increment(obj->getIncrement());
+ elm->set_windowangle(obj->getWindowAngle());
+ elm->set_targetangle(obj->getTargetAngle());
+
mResponse->set_status(::aurum::RspStatus::OK);
} else {
mResponse->set_status(::aurum::RspStatus::ERROR);
elm->set_maxvalue(obj->getMaxValue());
elm->set_value(obj->getValue());
elm->set_increment(obj->getIncrement());
+
+ elm->set_windowangle(obj->getWindowAngle());
+ elm->set_targetangle(obj->getTargetAngle());
}
mResponse->set_status(::aurum::RspStatus::OK);
} else {
--- /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"
+#include "GetAngleCommand.h"
+
+#include "UiDevice.h"
+
+GetAngleCommand::GetAngleCommand(const ::aurum::ReqGetAngle* request,
+ ::aurum::RspGetAngle* response)
+ : mRequest{request}, mResponse{response}
+{
+}
+
+::grpc::Status GetAngleCommand::execute()
+{
+ LOGI("GetAngle --------------- ");
+
+ std::shared_ptr<UiDevice> mDevice = UiDevice::getInstance();
+
+ mResponse->set_windowangle(mDevice->getWindowAngle());
+ mResponse->set_targetangle(mDevice->getTargetAngle());
+
+ mResponse->set_status(::aurum::RspStatus::OK);
+ return grpc::Status::OK;
+}
rpc getTextMinBoundingRect(ReqGetTextMinBoundingRect) returns (RspGetTextMinBoundingRect) {}
rpc setTimeout(ReqSetTimeout) returns (RspSetTimeout) {}
rpc setXMLSync(ReqSetXMLSync) returns (RspSetXMLSync) {}
+ rpc getAngle(ReqGetAngle) returns (RspGetAngle) {}
}
// ------------------------------------ //
double maxValue = 28;
double value = 29;
double increment = 30;
+
+ int32 windowAngle = 31;
+ int32 targetAngle = 32;
}
message Point {
message RspSetXMLSync {
RspStatus status = 1;
}
+
+message ReqGetAngle {
+}
+
+message RspGetAngle {
+ RspStatus status = 1;
+ int32 windowAngle = 2;
+ int32 targetAngle = 3;
+}