bool ivug_ext_launch_browser(const char *uri);
bool ivug_ext_launch_email(const char *uri);
-
-/*
- Below functions are not used at Now, but should be needed soon.
-*/
bool ivug_ext_launch_print(const char *uri);
bool ivug_ext_launch_default(const char *uri, const char *operation, const char *pkg, void *data);
return (ret == SERVICE_ERROR_NONE ? true : false);
}
+bool ivug_ext_launch_print(const char *uri)
+{
+ MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri);
+
+ int ret = -1;
+ int destroy_ret = -1;
+ const char *pkgname = PRINT_PKG_NAME;
+
+ if(uri == NULL)
+ {
+ MSG_IMAGEVIEW_ERROR("URI is NULL");
+ return false;
+ }
+
+ service_h handle;
+
+ ret = service_create(&handle);
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret);
+ return false;
+ }
+
+ ret = service_set_operation(handle, OPERATION_NAME_PRINT);
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret);
+ goto PRINT_END;
+ }
+
+ ret = service_set_package(handle, pkgname);
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_set_package failed, %d", ret);
+ goto PRINT_END;
+ }
+
+ ret = service_set_uri (handle, uri);
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret);
+ goto PRINT_END;
+ }
+
+ ret = service_add_extra_data(handle, SERVICE_PRINT_FILES_TYPE, "IMG");
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret);
+ goto PRINT_END;
+ }
+
+ ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL);
+ if(ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret);
+ goto PRINT_END;
+ }
+
+PRINT_END:
+ destroy_ret = service_destroy(handle);
+ if(destroy_ret != SERVICE_ERROR_NONE)
+ {
+ MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret);
+ return false;
+ }
+
+ return (ret == SERVICE_ERROR_NONE ? true : false);
+}
+
{
on_btn_tag_clicked(data, obj, event_info);
}
+ else if(strncmp(label, IDS_PRINT, strlen(label)) == 0)
+ {
+ Media_Item *WMitem = ivug_slider_get_item(pMainView->slider);
+ Media_Data *mdata = ivug_medialist_get_data(WMitem);
+
+ if (mdata == NULL)
+ {
+ MSG_MAIN_ERROR("slider data is NULL");
+ evas_object_del(pMainView->ctx_popup);
+ pMainView->ctx_popup = NULL;
+ ivug_main_view_set_hide_timer(pMainView);
+ return;
+ }
+ ivug_ext_launch_print(mdata->filepath);
+ }
evas_object_del(pMainView->ctx_popup);
pMainView->ctx_popup = NULL;
ivug_listpopup_item_append(popup, NULL, IDS_ROTATE_RIGHT, IDS_ROTATE_RIGHT);
}
}
+
+ ivug_listpopup_item_append(popup, NULL, IDS_PRINT, IDS_PRINT);
}
else if(mdata->slide_type == SLIDE_TYPE_VIDEO)
{