+EXPORT_API minicontrol_error_e minicontrol_win_handler_get(Evas_Object *mincontrol, minicontrol_h *handler)
+{
+ if (!mincontrol) {
+ ERR("invaild mincontrol object");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+ if (!handler) {
+ ERR("invaild mincontrol handler");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ struct _provider_data *pd = evas_object_data_get(mincontrol, MINICTRL_DATA_KEY);
+ if (pd != NULL) {
+ *handler = pd->handler;
+ } else {
+ return MINICONTROL_ERROR_NO_DATA;
+ }
+
+ return MINICONTROL_ERROR_NONE;
+}
+
+EXPORT_API minicontrol_error_e minicontrol_win_handler_update(Evas_Object *mincontrol, minicontrol_h handler)
+{
+ struct _provider_data *pd;
+ int ret = MINICONTROL_ERROR_NONE;
+
+ if (!mincontrol) {
+ ERR("mincontrol is NULL, invaild parameter");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+ if (_minictrl_handler_check_validation(handler) != MINICONTROL_ERROR_NONE) {
+ ERR("handler is invalid, invaild parameter");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ pd = evas_object_data_get(mincontrol, MINICTRL_DATA_KEY);
+ if (!pd) {
+ ERR("pd is NULL, invaild parameter");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!pd->name) {
+ ERR("pd name is NULL, invaild parameter");
+ return MINICONTROL_ERROR_INVALID_PARAMETER;
+ }
+
+ if (pd->handler != handler) {
+ if (pd->handler != NULL) {
+ _minictrl_handler_destroy(pd->handler);
+ pd->handler = NULL;
+ }
+ if (_minictrl_handler_clone(handler, &(pd->handler)) != MINICONTROL_ERROR_NONE) {
+ ERR("failed to clone a minicontrol handler");
+ return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ if (pd->state == MINICTRL_STATE_RUNNING) {
+ ret = _minictrl_provider_message_send(MINICTRL_DBUS_SIG_REQUEST,
+ pd->name, MINICONTROL_REQ_UPDATE_HANDLER, MINICONTROL_REQ_UPDATE_HANDLER
+ , pd->priority, pd->handler);
+ }
+
+ return ret;
+}
+