From 7522399786e296d94bf4758c67210081873f5390 Mon Sep 17 00:00:00 2001 From: HyukSoon Choi Date: Wed, 3 Apr 2013 17:27:40 +0900 Subject: [PATCH] Modify AppControl spec Change-Id: Icca00d6c707b53712d78c3683af0fa37dfa4685c Signed-off-by: HyukSoon Choi --- inc/IvImageViewerPresentationModel.h | 6 +++--- inc/IvTypes.h | 17 +++++------------ src/IvImageViewerForm.cpp | 22 ++++++---------------- src/IvImageViewerPresentationModel.cpp | 7 ++++--- src/IvTypes.cpp | 9 ++++++--- 5 files changed, 24 insertions(+), 37 deletions(-) diff --git a/inc/IvImageViewerPresentationModel.h b/inc/IvImageViewerPresentationModel.h index 0266912..a37fd82 100644 --- a/inc/IvImageViewerPresentationModel.h +++ b/inc/IvImageViewerPresentationModel.h @@ -77,9 +77,9 @@ public: int GetDurationOfSlideShow(void) const; SlideShowTransitionEffect GetTransitionEffectOfSlideShow(void) const; - result StartAppControl(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, - const Tizen::Base::String* uriData, const Tizen::Base::Collection::HashMap* pDataList, - Tizen::App::IAppControlResponseListener* pListener); + result StartAppControl(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, + const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, + const Tizen::Base::Collection::HashMap* pDataList, Tizen::App::IAppControlResponseListener* pListener); virtual void OnImageReceivedN(Tizen::Base::Runtime::IEventArg& eventArg); diff --git a/inc/IvTypes.h b/inc/IvTypes.h index 7137e34..9dfe2ca 100644 --- a/inc/IvTypes.h +++ b/inc/IvTypes.h @@ -108,9 +108,13 @@ extern const wchar_t* APPCONTROL_KEY_SELECTION_MODE; extern const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_TYPE; extern const wchar_t* APPCONTROL_KEY_SOCIAL_RESULT_TYPE; extern const wchar_t* APPCONTROL_KEY_MESSAGE_TYPE; - extern const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_ID; +extern const wchar_t* APPCONTROL_URI_MMS_TO; +extern const wchar_t* APPCONTROL_URI_MAIL_TO; + +extern const wchar_t* APPCONTROL_MIME_VIDEO_ALL; + extern const wchar_t* APPCONTROL_DATA_IMAGE; extern const wchar_t* APPCONTROL_DATA_VIDEO; extern const wchar_t* APPCONTROL_DATA_SLIDE_SHOW; @@ -119,19 +123,8 @@ extern const wchar_t* APPCONTROL_DATA_EMAIL; extern const wchar_t* APPCONTROL_DATA_SINGLE; extern const wchar_t* APPCONTROL_DATA_ITEM_ID; extern const wchar_t* APPCONTROL_DATA_URI_FILE; -extern const wchar_t* APPCONTROL_DATA_MMS; extern const wchar_t* APPCONTROL_DATA_PERSON; -extern const wchar_t* APPCONTROL_DATA_IMAGE; -extern const wchar_t* APPCONTROL_DATA_VIDEO; -extern const wchar_t* APPCONTROL_DATA_SLIDE_SHOW; -extern const wchar_t* APPCONTROL_DATA_MESSAGE; -extern const wchar_t* APPCONTROL_DATA_EMAIL; -extern const wchar_t* APPCONTROL_DATA_SINGLE; -extern const wchar_t* APPCONTROL_DATA_CONTACT_ID; -extern const wchar_t* APPCONTROL_DATA_URI_FILE; -extern const wchar_t* APPCONTROL_DATA_MMS; - extern const wchar_t* SETTING_VALUE_HOME_SCREEN_WALLPAPER; extern const wchar_t* SETTING_VALUE_LOCK_SCREEN_WALLPAPER; diff --git a/src/IvImageViewerForm.cpp b/src/IvImageViewerForm.cpp index 048d219..4018c05 100644 --- a/src/IvImageViewerForm.cpp +++ b/src/IvImageViewerForm.cpp @@ -540,10 +540,8 @@ ImageViewerForm::CallVideoPlayer(void) String filePath = __pPresentationModel->GetFilePathAt(index); filePath.Insert(APPCONTROL_DATA_URI_FILE, 0); - AppLogDebug("ENTER(%ls)", filePath.GetPointer()); - __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_VIDEO_PLAYER, APPCONTROL_OPERATION_ID_VIEW, - &filePath, null, this); + new (std::nothrow) String(filePath), new (std::nothrow) String(APPCONTROL_MIME_VIDEO_ALL), null, this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -1445,7 +1443,7 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) new (std::nothrow) String(APPCONTROL_DATA_ITEM_ID)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CONTACTS, - APPCONTROL_OPERATION_ID_PICK, null, pDataList, this); + APPCONTROL_OPERATION_ID_PICK, null, null, pDataList, this); break; } @@ -1841,7 +1839,7 @@ ImageViewerForm::OnRequestEmailAction(void) pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pList); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE, - null, pDataList, this); + new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -1861,16 +1859,12 @@ ImageViewerForm::OnRequestMessagesAction(void) HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); - pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_MESSAGE_TYPE), - new (std::nothrow) String(APPCONTROL_DATA_MMS)); - IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); pList->Add(new (std::nothrow) String(filePath)); - pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pList); - __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGES, - APPCONTROL_OPERATION_ID_COMPOSE, null, pDataList, this); + __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGES, APPCONTROL_OPERATION_ID_COMPOSE, + new (std::nothrow) String(APPCONTROL_URI_MMS_TO), null, pDataList, this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -2074,7 +2068,6 @@ void ImageViewerForm::OnFormFileEventOccuered(const int index, const unsigned lo void ImageViewerForm::OnSlideSettingPopUpItemSelected(int index) { - if ( __pPopUp != NULL) { __pPopUp->SetShowState(false); @@ -2108,10 +2101,7 @@ ImageViewerForm::OnSlideSettingPopUpItemSelected(int index) } else if (index == 1) // launch settings { - HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); - pDataList->Construct(); - __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_GALLERY, - APPCONTROL_OPERATION_ID_CONFIGURE, null, null, this); + APPCONTROL_OPERATION_ID_CONFIGURE, null, null, null, this); } } diff --git a/src/IvImageViewerPresentationModel.cpp b/src/IvImageViewerPresentationModel.cpp index 38c4cd5..4d3b6b7 100644 --- a/src/IvImageViewerPresentationModel.cpp +++ b/src/IvImageViewerPresentationModel.cpp @@ -345,8 +345,9 @@ ImageViewerPresentationModel::GetFileName(const String& filePath, bool checkExe) } result -ImageViewerPresentationModel::StartAppControl(const String& providerId, const String& operationId, - const String* uriData, const HashMap* pDataList, IAppControlResponseListener* pListener) +ImageViewerPresentationModel::StartAppControl(const String& providerId, const String& operationId, + const String* pUriData, const String* pMimeType, const HashMap* pDataList, + IAppControlResponseListener* pListener) { AppLogDebug("ENTER"); AppControl* pAc = AppManager::FindAppControlN(providerId, operationId); @@ -357,7 +358,7 @@ ImageViewerPresentationModel::StartAppControl(const String& providerId, const S return E_FAILURE; } - result r = pAc->Start(uriData, null, pDataList, pListener); + result r = pAc->Start(pUriData, pMimeType, pDataList, pListener); if (r == E_SUCCESS) { diff --git a/src/IvTypes.cpp b/src/IvTypes.cpp index ccadc25..1c02abe 100644 --- a/src/IvTypes.cpp +++ b/src/IvTypes.cpp @@ -42,13 +42,13 @@ const wchar_t* APPCONTROL_PROVIDER_ID_MESSAGES = L"tizen.messages"; const wchar_t* APPCONTROL_PROVIDER_ID_EMAIL = L"tizen.email"; const wchar_t* APPCONTROL_PROVIDER_ID_CONTACTS = L"tizen.contacts"; const wchar_t* APPCONTROL_PROVIDER_ID_VIDEO_PLAYER = L"tizen.videoplayer"; +const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY = L"tizen.gallery"; const wchar_t* APPCONTROL_OPERATION_ID_PICK = L"http://tizen.org/appcontrol/operation/pick"; const wchar_t* APPCONTROL_OPERATION_ID_VIEW = L"http://tizen.org/appcontrol/operation/view"; const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE = L"http://tizen.org/appcontrol/operation/compose"; const wchar_t* APPCONTROL_OPERATION_ID_MAIN = L"http://tizen.org/appcontrol/operation/main"; const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE = L"http://tizen.org/appcontrol/operation/configure"; -const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY = L"tizen.gallery"; const wchar_t* APPCONTROL_KEY_TYPE = L"http://tizen.org/appcontrol/data/type"; const wchar_t* APPCONTROL_KEY_PATH = L"http://tizen.org/appcontrol/data/path"; @@ -57,9 +57,13 @@ const wchar_t* APPCONTROL_KEY_SELECTION_MODE = L"http://tizen.org/appcontrol/dat const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_TYPE = L"http://tizen.org/appcontrol/data/social/item_type"; const wchar_t* APPCONTROL_KEY_SOCIAL_RESULT_TYPE = L"http://tizen.org/appcontrol/data/social/result_type"; const wchar_t* APPCONTROL_KEY_MESSAGE_TYPE = L"http://tizen.org/appcontrol/data/message/type"; - const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_ID = L"http://tizen.org/appcontrol/data/social/item_id"; +const wchar_t* APPCONTROL_URI_MMS_TO = L"mmsto"; +const wchar_t* APPCONTROL_URI_MAIL_TO = L"mailto"; + +const wchar_t* APPCONTROL_MIME_VIDEO_ALL = L"video/*"; + const wchar_t* APPCONTROL_DATA_IMAGE = L"image"; const wchar_t* APPCONTROL_DATA_VIDEO = L"video"; const wchar_t* APPCONTROL_DATA_SLIDE_SHOW = L"slideshow"; @@ -68,7 +72,6 @@ const wchar_t* APPCONTROL_DATA_EMAIL = L"email"; const wchar_t* APPCONTROL_DATA_SINGLE = L"single"; const wchar_t* APPCONTROL_DATA_ITEM_ID = L"item_id"; const wchar_t* APPCONTROL_DATA_URI_FILE = L"file://"; -const wchar_t* APPCONTROL_DATA_MMS = L"mms"; const wchar_t* APPCONTROL_DATA_PERSON = L"person"; const wchar_t* SETTING_VALUE_HOME_SCREEN_WALLPAPER = L"http://tizen.org/setting/screen.wallpaper"; -- 2.7.4