#include <string.h>
#include <sys/stat.h>
-#define APP_CONTROL_URI_PATH "file://"
-
using namespace Common::Database;
using namespace Contacts;
using namespace Contacts::Details;
view = new DetailsView(getDisplayContactId(personId));
}
} else {
- std::string path = getUrn(APP_CONTROL_URI_PATH);
+ std::string path = getUrn(APP_CONTROL_URI_SCHEME_FILE);
struct stat buffer;
if (stat(path.c_str(), &buffer) == 0) {
view = new VcardView(path);
#define APP_CONTROL_OPERATION_SETTING_CALL "http://tizen.org/appcontrol/operation/setting/call"
-#define APP_CONTROL_MIME_CONTACT "application/vnd.tizen.contact"
+#define APP_CONTROL_MIME_CONTACT "application/vnd.tizen.contact"
+#define APP_CONTROL_MIME_IMAGE "image/*"
+
+#define APP_CONTROL_URI_SCHEME_FILE "file://"
#define APP_CONTROL_SELECT_SINGLE "single"
#define APP_CONTROL_SELECT_MULTIPLE "multiple"
AppControl EXPORT_API requestGalleryImage();
/**
+ * @brief Request view image
+ * @param[in] path Path to image file
+ * @return AppControl wrapper
+ */
+ AppControl EXPORT_API requestViewImage(const char *path);
+
+ /**
* @brief Request share contact via other application
* @param[in] personId Contact's person ID
* @return AppControl wrapper
AppControl App::requestCameraImage()
{
- return AppControl(APP_CONTROL_OPERATION_CREATE_CONTENT, "image/*");
+ return AppControl(APP_CONTROL_OPERATION_CREATE_CONTENT, APP_CONTROL_MIME_IMAGE);
}
AppControl App::requestGalleryImage()
{
- AppControl request(APP_CONTROL_OPERATION_PICK, "image/*");
+ AppControl request(APP_CONTROL_OPERATION_PICK, APP_CONTROL_MIME_IMAGE);
app_control_set_app_id(request.getHandle(), "org.tizen.ug-gallery-efl");
return request;
}
+AppControl App::requestViewImage(const char *path)
+{
+ return AppControl(APP_CONTROL_OPERATION_VIEW, APP_CONTROL_MIME_IMAGE,
+ std::string(APP_CONTROL_URI_SCHEME_FILE).append(path).c_str());
+}
+
AppControl App::requestShareContact(int personId)
{
AppControl request(APP_CONTROL_OPERATION_SHARE, APP_CONTROL_MIME_CONTACT);
#ifndef CONTACTS_DETAILS_BASIC_INFO_ITEM_H
#define CONTACTS_DETAILS_BASIC_INFO_ITEM_H
+#include "App/AppControl.h"
#include "Ui/GenItem.h"
#include "Ux/SelectTypes.h"
void onBackPressed(Evas_Object *button, void *eventInfo);
void onFavChanged(Evas_Object *check, void *eventInfo);
+ void onImageClicked(Evas_Object *image, void *eventInfo);
void onFieldUpdated(Model::ContactField &field, contacts_changed_e change);
Model::Contact &m_Contact;
Ux::SelectMode m_SelectMode;
BackCallback m_OnBackPressed;
+
+ App::AppControl m_Request;
};
}
}
#include "Contacts/Model/ContactCompoundObject.h"
#include "Contacts/Model/ContactTextField.h"
+#include "App/AppControlRequest.h"
#include "Ui/Genlist.h"
#include "Ui/Thumbnail.h"
#include "Utils/Callback.h"
if (strcmp(part, PART_THUMBNAIL) == 0) {
auto control = Ui::Thumbnail::create(parent, Ui::Thumbnail::SizeLarge);
control->setImagePath(m_ImagePath.getValue());
+ evas_object_smart_callback_add(control->getImage(), "clicked",
+ makeCallback(&BasicInfoItem::onImageClicked), this);
+
return control->getEvasObject();
}
m_Contact.save();
}
+void BasicInfoItem::onImageClicked(Evas_Object *image, void *eventInfo)
+{
+ const char *path = m_ImagePath.getValue();
+ if (path) {
+ m_Request = App::requestViewImage(path);
+ m_Request.launch();
+ }
+}
+
void BasicInfoItem::onFieldUpdated(ContactField &field, contacts_changed_e change)
{
if (&field == &m_Contact && change == CONTACTS_CHANGE_DELETED) {