EmailForm::InvokeMediaAppControl(void)
{
result r = E_SUCCESS;
- String* pData = null;
- String* pTempData = null;
+ String uri;
+ String mimeType("*/*");
AppControl* pAc = null;
MessageBox* pMessage = null;
int ModalResult;
r = dataList.Construct();
TryCatch(r == E_SUCCESS, , "Failed to construct data list");
- pData = new (std::nothrow) String(L"all");
- TryCatch(pData != null,;
- , "Failed to instantiate String");
-
- r = dataList.Add(new (std::nothrow) String(L"type"), pData);
- TryCatch(r == E_SUCCESS, , "Failed to add data to Array list");
-
- pTempData = new (std::nothrow) String(L"multiple");
- TryCatch(pTempData != null,;
- , "Failed to instantiate String");
-
- r = dataList.Add(new (std::nothrow) String(L"selectionType"), pTempData);
+ r = dataList.Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/selection_mode"), new (std::nothrow) String(L"multiple"));
TryCatch(r == E_SUCCESS, , "Failed to add data to Array list");
- pAc = AppManager::FindAppControlN(String(L"tizen.filemanager"), L"http://tizen.org/appcontrol/operation/pick");
+ pAc = AppManager::FindAppControlN(String(L"tizen.filemanager"), String(L"http://tizen.org/appcontrol/operation/pick"));
TryCatch(pAc != null,;
, "Failed FindAppControlN");
- r = pAc->Start(null, null, &dataList, this);
+ r = pAc->Start(&uri, &mimeType, &dataList, this);
TryCatch(r == E_SUCCESS,;
, "Failed to invoke ac");
delete pAc;
{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
+ const String* pValue = null;
+ const ArrayList* pResultList = dynamic_cast<const ArrayList*> (pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/selected")));
- String* pValue = (Tizen::Base::String*) pExtraData->GetValue(String(L"path"));
- if (pValue != NULL)
+ if (pResultList != NULL)
{
- AppLog("Value is: %S", pValue->GetPointer());
-
- StringTokenizer strTok(*pValue, L";"); //get each file paths seperated by ;
-
int count = 0;
- count = strTok.GetTokenCount();
-
+ count = pResultList->GetCount();
for (int index = 0; index < count; index++)
{
AppLog("Media list success.");
- String tokenValue;
- strTok.GetNextToken(tokenValue);
+ pValue = static_cast<const String*>(pResultList->GetAt(index));
//Add Attachment To Email
- AppLog("Add Attachment : %ls", tokenValue.GetPointer());
- r = __pEmailSend->SetEmailAttach(&tokenValue);
+ AppLog("Add Attachment : %ls", pValue->GetPointer());
+ r = __pEmailSend->SetEmailAttach(const_cast<String*>(pValue));
if (!IsFailed(r))
{
- __pAttachList->AddItem(&tokenValue, (MmsAttachmentFormat) - 1);
+ __pAttachList->AddItem(const_cast<String*>(pValue), (MmsAttachmentFormat) - 1);
}
else
{
MmsForm::InvokeMediaAppControl(int type)
{
result r = E_SUCCESS;
- String* pData = null;
- String* pTempData = null;
+ String uri;
+ String mimeType;
AppControl* pAc = null;
MessageBox* pMessage = null;
int ModalResult;
if (type == ID_ATTACH_IMAGE)
{
__attachmentFormat = MMS_IMAGE;
- pData = new (std::nothrow) String(L"image");
+ mimeType.Append(L"image/*");
}
else if (type == ID_ATTACH_AUDIO)
{
__attachmentFormat = MMS_AUDIO;
- pData = new (std::nothrow) String(L"audio");
+ mimeType.Append(L"audio/*");
}
else if (type == ID_ATTACH_VIDEO)
{
__attachmentFormat = MMS_VIDEO;
- pData = new (std::nothrow) String(L"video");
+ mimeType.Append(L"video/*");
}
- TryCatch(pData != null, , "Failed to instantiate String");
- r = dataList.Add(new (std::nothrow) String(L"type"), pData);
+ r = dataList.Add(new (std::nothrow) String(L"http://tizen.org/appcontrol/data/selection_mode"), new (std::nothrow) String(L"single"));
TryCatch(r == E_SUCCESS, , "Failed to add data to Array list");
- pTempData = new (std::nothrow) String(L"single");
- TryCatch(pTempData != null, , "Failed to instantiate String");
-
- r = dataList.Add(new (std::nothrow) String(L"selectionType"), pTempData);
- TryCatch(r == E_SUCCESS, , "Failed to add data to Array list");
-
- pAc = AppManager::FindAppControlN(String(L"tizen.filemanager"), L"http://tizen.org/appcontrol/operation/pick");
+ pAc = AppManager::FindAppControlN(String(L"tizen.filemanager"), String(L"http://tizen.org/appcontrol/operation/pick"));
TryCatch(pAc != null, , "Failed FindAppControlN");
- r = pAc->Start(null, null, &dataList, this);
+ r = pAc->Start(&uri, &mimeType, &dataList, this);
+
TryCatch(r == E_SUCCESS, , "Failed to invoke ac");
delete pAc;
{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- String* pValue = (Tizen::Base::String*) pExtraData->GetValue(String(L"path"));
+ const String* pValue = null;
+ const ArrayList* pResultList = dynamic_cast<const ArrayList*> (pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/selected")));
+
+ if (pResultList != null )
+ {
+ pValue = static_cast<const String*>(pResultList->GetAt(0));
+ }
+ else
+ {
+ pValue = static_cast<const String*>(pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/selected")));
+ }
if (pValue != NULL)
{
AppLog("Value : %S", pValue->GetPointer());
- r = __pMmsSend->SetMmsAttach(__attachmentFormat, pValue);
+ r = __pMmsSend->SetMmsAttach(__attachmentFormat, const_cast<String*>(pValue));
if (!IsFailed(r))
{
- __pAttachList->AddItem(pValue, __attachmentFormat);
+ __pAttachList->AddItem(const_cast<String*>(pValue), __attachmentFormat);
Invalidate(true);
}
}