From 3764d51696fae8143b4f223415a9f499f9114ea3 Mon Sep 17 00:00:00 2001 From: Vinay Sachdeva Date: Sun, 7 Apr 2013 01:53:36 +0530 Subject: [PATCH] Updated the required changed for Share via EMAIL and MESSAGE Change-Id: Ifbdb3e0846f750acc440b74703c31d35bc82edf9 Signed-off-by: Vinay Sachdeva --- src/IntSharePopup.cpp | 81 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 16 deletions(-) diff --git a/src/IntSharePopup.cpp b/src/IntSharePopup.cpp index 97903aa..856dce2 100644 --- a/src/IntSharePopup.cpp +++ b/src/IntSharePopup.cpp @@ -238,14 +238,14 @@ SharePopup::CreateItem(int index, int itemWidth) { AppLogDebug("SharePopUp CreateItem 0"); // IDS_SHARE_VIA_MESSAGE - pItem->AddElement(Rectangle(0,0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_MESSAGE_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_MESSAGES"), true); + pItem->AddElement(Rectangle(45,0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_MESSAGE_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_MESSAGES"), true); } break; case 1: { AppLogDebug("SharePopUp CreateItem 1"); // IDS_SHARE_VIA_EMAIL - pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_EMAIL_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_EMAIL"), true); + pItem->AddElement(Rectangle(45, 0, GetClientAreaBounds().width, listItemWidth), ID_FORMAT_EMAIL_STRING, CommonUtil::GetString(L"IDS_BR_OPT_SHARE_VIA_EMAIL"), true); } break; default: @@ -314,17 +314,19 @@ SharePopup::StartEmailAppControl(void) textVal.Append(L">"); } - String subjectKey = L"subject"; + String subjectKey = L"http://tizen.org/appcontrol/data/subject"; String subjectVal = L""; - String textKey = L"text"; + String textKey = L"http://tizen.org/appcontrol/data/text"; - String toKey = L"to"; + String toKey = L"http://tizen.org/appcontrol/data/to"; String toVal = L""; - String ccKey = L"cc"; + String ccKey = L"http://tizen.org/appcontrol/data/cc"; String ccVal = L""; - String bccKey = L"bcc"; + String bccKey = L"http://tizen.org/appcontrol/data/bcc"; String bccVal = L""; - String attachKey = L"attachments"; + + //String attachKey = L"attachments"; + String attachKey = L"http://tizen.org/appcontrol/data/path"; String attachVal; if (pShareInfo != null) { @@ -340,12 +342,18 @@ SharePopup::StartEmailAppControl(void) } } + ArrayList* pDataList = null; + pDataList = new (std::nothrow) ArrayList(); + pDataList->Construct(); + pDataList->Add(&attachVal); + extraData.Add(&subjectKey, &subjectVal); extraData.Add(&textKey, &textVal); extraData.Add(&toKey, &toVal); extraData.Add(&ccKey, &ccVal); extraData.Add(&bccKey, &bccVal); - extraData.Add(&attachKey, &attachVal); + //extraData.Add(&attachKey, &attachVal); + extraData.Add(&attachKey, pDataList); AppControl* pAc = AppManager::FindAppControlN(L"tizen.email", L"http://tizen.org/appcontrol/operation/compose"); if (pAc) @@ -357,6 +365,10 @@ SharePopup::StartEmailAppControl(void) { delete pShareInfo; } + if(pDataList != null) + { + delete pDataList; + } } void @@ -364,9 +376,18 @@ SharePopup::StartMessageAppControl(void) { HashMap extraData; ShareInfo* pShareInfo = null; + bool imageAttachment = false; extraData.Construct(); + String typeKey = L"http://tizen.org/appcontrol/data/message/type"; + String typeVal; + String textKey = L"http://tizen.org/appcontrol/data/text"; + String textVal; + String attachKey = L"http://tizen.org/appcontrol/data/path"; + String attachVal; + ArrayList* pDataList = null; + if (__pShareList != null) { pShareInfo = dynamic_cast(__pShareList->GetAt(0)); @@ -377,8 +398,6 @@ SharePopup::StartMessageAppControl(void) } } - String textVal; - if (pShareInfo != null) { textVal.Append(pShareInfo->GetPageTitle()); @@ -394,11 +413,38 @@ SharePopup::StartMessageAppControl(void) textVal.Append(pShareInfo->GetPageURL().GetPointer()); textVal.Append(L">"); } - String typeKey = L"type"; - String typeVal = L"SMS"; - String textKey = L"text"; + if (pShareInfo != null) + { + imageAttachment = pShareInfo->GetImageAttached(); + if (imageAttachment) + { + // type is mms + typeVal = L"mms"; + attachVal = pShareInfo->GetImagePath(); + + pDataList = new (std::nothrow) ArrayList(); + pDataList->Construct(); + pDataList->Add(&attachVal); + } + else + { + typeVal = L"sms"; + // type is sms + } + } + extraData.Add(&typeKey, &typeVal); - extraData.Add(&textKey, &textVal); + + if (imageAttachment) + { + // type is MMMS, attach the image + extraData.Add(&attachKey, pDataList); + } + else + { + // type is SMS , attach the text + extraData.Add(&textKey, &textVal); + } AppControl* pAc = AppManager::FindAppControlN(L"tizen.messages", L"http://tizen.org/appcontrol/operation/compose"); if (pAc) { @@ -409,7 +455,10 @@ SharePopup::StartMessageAppControl(void) { delete pShareInfo; } - + if(pDataList) + { + delete pDataList; + } } void -- 2.7.4