// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
__pShareList = new(std::nothrow) ArrayList();
__pShareList->Construct();
- __pList = static_cast<ListView*>(GetControl(L"IDC_POPUP_LIST"));
+ __pList = static_cast<ListView*>(GetControl(L"IDC_LISTVIEW"));
if (__pList == null)
{
return false;
__pList->SetItemProvider(*this);
__pList->AddListViewItemEventListener(*this);
- pCancelButton = static_cast< Button* >(GetControl(L"IDC_BUTTON", true));
+ pCancelButton = static_cast< Button* >(GetControl(L"IDC_BUTTON1", true));
if (pCancelButton)
{
pCancelButton->AddActionEventListener(*this);
{
case 0:
{
- Popup::SetShowState(false);
- Popup::Show();
+
// share via message
StartMessageAppControl();
+ Popup::SetShowState(false);
+ Popup::Show();
}
break;
case 1:
{
- Popup::SetShowState(false);
- Popup::Show();
+
// share via email
StartEmailAppControl();
+ Popup::SetShowState(false);
+ Popup::Show();
}
break;
default:
ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
int textSize = 35;
int elementHeight = 50;
- int listItemWidth = 112;
+ int listItemWidth = 80;
CustomItem* pItem = new(std::nothrow) CustomItem();
r = pItem->Construct(Dimension(GetClientAreaBounds().width, listItemWidth), style);
{
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:
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)
{
}
}
+ 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);
+ if(attachVal.GetLength() > 0)
+ {
+ extraData.Add(&attachKey, pDataList);
+ }
AppControl* pAc = AppManager::FindAppControlN(L"tizen.email", L"http://tizen.org/appcontrol/operation/compose");
if (pAc)
{
- pAc->Start(null, null, &extraData, null);
+ r = pAc->Start(null, null, &extraData, this);
delete pAc;
}
+
if (pShareInfo != null)
- {
- delete pShareInfo;
- }
+ {
+ delete pShareInfo;
+ }
+ delete pDataList;
+
}
void
{
HashMap extraData;
ShareInfo* pShareInfo = null;
+ result r = E_FAILURE;
+ 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<ShareInfo*>(__pShareList->GetAt(0));
}
}
- String textVal;
-
if (pShareInfo != null)
{
textVal.Append(pShareInfo->GetPageTitle());
- textVal.Append(L" <");
+ if(pShareInfo->GetPageTitle().GetLength() > 0)
+ {
+ textVal.Append(L" <");
+ }
+ else
+ {
+ textVal.Append(L"<");
+ }
AppLog("share info url is %ls",pShareInfo->GetPageURL().GetPointer());
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)
{
- pAc->Start(null, null, &extraData, null);
+ r = pAc->Start(null, null, &extraData, this);
delete pAc;
}
+
if (pShareInfo != null)
{
delete pShareInfo;
}
-
+ if(pDataList)
+ {
+ delete pDataList;
+ }
}
void
SharePopup::OnAppControlCompleted(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::IList* pResultList)
{
+ AppLog("InternetApp::OnForeground called");
+ Frame* pCurrentFrame = null;
+ pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
+
+ if (pCurrentFrame != null)
+ {
+ pCurrentFrame->SetEnabled(true);
+ pCurrentFrame->Invalidate(true);
+ }
+}
+
+void SharePopup::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+ AppLog("SharePopup::OnAppControlCompleteResponseReceived");
+ Frame* pCurrentFrame = null;
+ pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
+
+ if (pCurrentFrame != null)
+ {
+ pCurrentFrame->SetEnabled(true);
+ pCurrentFrame->Invalidate(true);
+ }
}