int app_control_get_component_id(app_control_h app_control,
char **component_id);
+/**
+ * @brief Sets the window position of application.
+ * @since_tizen 7.5
+ *
+ * @param[in] app_control The app_control handle
+ * @param[in] x x position of application's left top
+ * @param[in] y y position of application's left top
+ * @param[in] w width of application
+ * @param[in] h height of application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
+ */
+int app_control_set_window_position(app_control_h app_control,
+ int x, int y, int w, int h);
+
+/**
+ * @brief Gets the window position of application.
+ * @since_tizen 7.5
+ *
+ * @param[in] app_control The app_control handle
+ * @param[out] x x position of application's left top
+ * @param[out] y y position of application's left top
+ * @param[out] w width of application
+ * @param[out] h height of application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
+ */
+int app_control_get_window_position(app_control_h app_control,
+ int *x, int *y, int *w, int *h);
+
/**
* @}
*/
return true;
}
+void AppControl::SetWindowPosition(int x, int y, int w, int h) {
+ int ret = aul_svc_set_window_position(data_.GetHandle(), x, y, w, h);
+ if (ret != AUL_SVC_RET_OK)
+ THROW(Util::AulSvcErrorConvert(ret));
+}
+
+std::tuple<int, int, int, int> AppControl::GetWindowPosition() {
+ int x, y, w, h;
+
+ int ret = aul_svc_get_window_position(data_.GetHandle(), &x, &y, &w, &h);
+ if (ret != AUL_SVC_RET_OK)
+ THROW(Util::AulSvcErrorConvert(ret));
+
+ return std::tuple<int, int, int, int>(x, y, w, h);
+}
+
} // namespace app_control
bool IsExtraDataArray(const std::string& key) const;
std::vector<std::string> GetExtraDataKeys();
std::vector<std::string> GetMatchedAppIds();
+ void SetWindowPosition(int x, int y, int w, int h);
+ std::tuple<int, int, int, int> GetWindowPosition();
bool IsReplyRequested() const;
void EnableAppStartedResultEvent();
return APP_CONTROL_ERROR_NONE;
}
+
+EXPORT int app_control_set_window_position(app_control_h app_control,
+ int x, int y, int w, int h) {
+ if (app_control == nullptr) {
+ _E("Invalid parameter");
+ return APP_CONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
+ try {
+ handle->SetWindowPosition(x, y, w, h);
+ } catch (Exception& e) {
+ _E("Failed to set window position");
+ return APP_CONTROL_ERROR_IO_ERROR;
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}
+
+EXPORT int app_control_get_window_position(app_control_h app_control,
+ int *x, int *y, int *w, int *h) {
+ if (app_control == nullptr ||
+ x == nullptr ||
+ y == nullptr ||
+ w == nullptr ||
+ h == nullptr) {
+ _E("Invalid parameter");
+ return APP_CONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ auto* handle = reinterpret_cast<AppControl*>(app_control);
+ try {
+ std::tie(*x, *y, *w, *h) = handle->GetWindowPosition();
+ } catch (Exception& e) {
+ _E("Failed to get window position");
+ return APP_CONTROL_ERROR_IO_ERROR;
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}