Import/Export view changes
authorchitta.rs <chitta.rs@samsung.com>
Tue, 2 Apr 2013 09:04:07 +0000 (14:34 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Tue, 2 Apr 2013 09:04:07 +0000 (14:34 +0530)
Change-Id: I89924e9ee9a1a899332c419e68a27cdf96e0b50c

inc/MfMyFilesApp.h
res/screen-density-xhigh/U01_list_icon_Vcalendar.png [new file with mode: 0644]
res/screen-density-xhigh/U01_list_icon_Vcard.png [new file with mode: 0644]
src/MfMyFilesApp.cpp
src/MfSubFolderSelection.cpp

index 575707c..350906b 100644 (file)
@@ -136,6 +136,7 @@ private:
 \r
        Tizen::Base::Collection::HashMap* __pResultList;\r
        Tizen::Base::String __operationId;\r
+       Tizen::Base::String __mimeType;\r
 \r
        IListViewStateChangeListener* __pCurrentListToUpdate;\r
        INotificationListener* __pNotificationListener;\r
diff --git a/res/screen-density-xhigh/U01_list_icon_Vcalendar.png b/res/screen-density-xhigh/U01_list_icon_Vcalendar.png
new file mode 100644 (file)
index 0000000..c0ec43f
Binary files /dev/null and b/res/screen-density-xhigh/U01_list_icon_Vcalendar.png differ
diff --git a/res/screen-density-xhigh/U01_list_icon_Vcard.png b/res/screen-density-xhigh/U01_list_icon_Vcard.png
new file mode 100644 (file)
index 0000000..25fd929
Binary files /dev/null and b/res/screen-density-xhigh/U01_list_icon_Vcard.png differ
index c956a85..91735a0 100644 (file)
@@ -47,6 +47,7 @@ MyFilesApp::MyFilesApp(void)
        , __pNotificationListener(null)\r
 {\r
        __operationId.Append(L"");\r
+       __mimeType.Append(L"");\r
        __bAppControlEnabled = false;\r
        __inputSource = APPCONTROL_STATE_MAINVIEW_SELECTED;\r
        __currentFileType = FILE_TYPE_ALL;\r
@@ -113,15 +114,15 @@ MyFilesApp::OnAppInitialized(void)
        {\r
                if (__operationId.CompareTo("http://tizen.org/appcontrol/operation/pick") == 0)\r
                {\r
-                       if (__currentView != APPCONTROL_VIEW_IMPORT && __currentView != APPCONTROL_VIEW_EXPORT)\r
+                       if (__currentView != APPCONTROL_VIEW_IMPORT)\r
                        {\r
-                               AppLogDebug("Ravi: inside appcontrol");\r
                                __inputSource = APPCONTROL_STATE_SELECTED;\r
                                IList* pArgs = new (std::nothrow) ArrayList();\r
                                pArgs->Add(new (std::nothrow) Integer(APPCONTROL_STATE_SELECTED));\r
                                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TEMP_FORM), pArgs);\r
                        }\r
 \r
+#if 0\r
                        else if (__currentView == APPCONTROL_VIEW_EXPORT)\r
                        {\r
                                if (__pResultList == null)\r
@@ -155,6 +156,7 @@ MyFilesApp::OnAppInitialized(void)
                        {\r
                                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM), null);\r
                        }\r
+#endif\r
                }\r
                else\r
                {\r
@@ -186,6 +188,7 @@ MyFilesApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
        AppLogDebug("ENTER");\r
        String resultList;\r
        result r = E_SUCCESS;\r
+       ArrayList* pAppControlResultList = null;\r
 \r
        // Deallocate resources allocated by this App for termination.\r
        // The App's permanent data and context can be saved via appRegistry.\r
@@ -206,10 +209,13 @@ MyFilesApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
                        }\r
                        else\r
                        {\r
+                               pAppControlResultList = new (std::nothrow) ArrayList();\r
+                               pAppControlResultList->Construct();\r
                                resultList = FolderNavigationPresentationModel::GetCurrentPath();\r
+                               pAppControlResultList->Add(new (std::nothrow) String(resultList));\r
                                if (__pResultList != null && resultList.CompareTo("") != 0)\r
                                {\r
-                                       __pResultList->Add(new (std::nothrow) String(appcontrolKey), new (std::nothrow) String(resultList));\r
+                                       __pResultList->Add(new (std::nothrow) String(appcontroldataKey),pAppControlResultList);\r
                                }\r
                                AppLog("Result added is %S",resultList.GetPointer());\r
                                r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, __pResultList);\r
@@ -224,37 +230,41 @@ MyFilesApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
 \r
                pResultHash = FolderEntryEditorPresentationModel::GetInstance()->GetCheckedList();\r
 \r
-               if (pResultHash != null)\r
-               {\r
-                       pResultMapEnum = pResultHash->GetMapEnumeratorN();\r
-\r
-                       if (pResultMapEnum != null)\r
+                       if (__currentAppControlResult != APP_CTRL_RESULT_CANCELED)\r
                        {\r
-                               if (pResultHash->GetCount() != 0)\r
+                               if (pResultHash != null)\r
                                {\r
-                                       //__pResultList->Add(*new (std::nothrow) String(APPCONTROL_RESULT_SUCCEEDED));\r
-                                       while (pResultMapEnum->MoveNext() == E_SUCCESS)\r
+                                       pResultMapEnum = pResultHash->GetMapEnumeratorN();\r
+\r
+                                       if (pResultMapEnum != null)\r
                                        {\r
-                                               pDirStr = static_cast< DirectoryEntry* >(pResultMapEnum->GetValue());\r
+                                               pAppControlResultList = new (std::nothrow) ArrayList();\r
+                                               pAppControlResultList->Construct();\r
 \r
-                                               if (pDirStr != null)\r
+                                               if (pResultHash->GetCount() != 0)\r
                                                {\r
-                                                       resultList.Append(pDirStr->GetFullFilePath());\r
-                                                       Count++;\r
-                                                       if (Count < pResultHash->GetCount())\r
-                                                               resultList.Append(";");\r
+                                                       //__pResultList->Add(*new (std::nothrow) String(APPCONTROL_RESULT_SUCCEEDED));\r
+\r
+                                                       while (pResultMapEnum->MoveNext() == E_SUCCESS)\r
+                                                       {\r
+                                                               pDirStr = static_cast< DirectoryEntry* >(pResultMapEnum->GetValue());\r
+\r
+                                                               if (pDirStr != null)\r
+                                                               {\r
+                                                                       pAppControlResultList->Add(new (std::nothrow) String(pDirStr->GetFullFilePath()));\r
+                                                               }\r
+                                                       }\r
                                                }\r
+                                               delete pResultMapEnum;\r
                                        }\r
                                }\r
-                               delete pResultMapEnum;\r
                        }\r
-               }\r
 \r
-               if (__pResultList != null && resultList.CompareTo("") != 0)\r
-               {\r
-                       __pResultList->Add(new (std::nothrow) String(appcontrolKey), new (std::nothrow) String(resultList));\r
-                       __pResultList->Add(new (std::nothrow) String(appcontroldataKey), new (std::nothrow) String(resultList));\r
-               }\r
+                       if (__pResultList != null && __currentAppControlResult != APP_CTRL_RESULT_CANCELED)\r
+                       {\r
+                               //__pResultList->Add(new (std::nothrow) String(appcontrolKey), new (std::nothrow) String(resultList));\r
+                               __pResultList->Add(new (std::nothrow) String(appcontroldataKey), pAppControlResultList);\r
+                       }\r
 \r
                        if (__currentAppControlResult == APP_CTRL_RESULT_CANCELED)\r
                        {\r
@@ -532,10 +542,16 @@ MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Stri
                const String* inputSelectionType = null;\r
                const String* inputFileType = null;\r
 \r
+               if (pMimeType != null)\r
+               {\r
+                       inputFileType = pMimeType;\r
+                       __mimeType.Clear();\r
+                       __mimeType.Append(*pMimeType);\r
+               }\r
+\r
                if (pExtraData != null)\r
                {\r
-                       inputSelectionType = static_cast< const String* >(pExtraData->GetValue(String(L"selectionType")));\r
-                       inputFileType = static_cast< const String* >(pExtraData->GetValue(String(L"type")));\r
+                       inputSelectionType = static_cast< const String* >(pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/selection_mode")));\r
                }\r
 \r
                if (__pResultList == null)\r
@@ -548,19 +564,19 @@ MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Stri
 \r
                if (inputFileType != null)\r
                {\r
-                       if (inputFileType->CompareTo("all") == 0)\r
+                       if (inputFileType->CompareTo("*/*") == 0)\r
                        {\r
                                __currentFileType = FILE_TYPE_ALL;\r
                        }\r
-                       else if (inputFileType->CompareTo("image") == 0)\r
+                       else if (inputFileType->CompareTo("image/*") == 0)\r
                        {\r
                                __currentFileType = FILE_TYPE_IMAGE_TYPE;\r
                        }\r
-                       else if (inputFileType->CompareTo("audio") == 0)\r
+                       else if (inputFileType->CompareTo("audio/*") == 0)\r
                        {\r
                                __currentFileType = FILE_TYPE_AUDIO_TYPE;\r
                        }\r
-                       else if (inputFileType->CompareTo("video") == 0)\r
+                       else if (inputFileType->CompareTo("video/*") == 0)\r
                        {\r
                                __currentFileType = FILE_TYPE_VIDEO_TYPE;\r
                        }\r
@@ -568,6 +584,15 @@ MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Stri
                        {\r
                                __currentFileType = FILE_TYPE_CONTACTS_TYPE;\r
                        }\r
+                       else if(inputFileType->CompareTo("inode/directory") == 0)\r
+                       {\r
+                               __currentFileType = FILE_TYPE_ALL;\r
+                               __currentView = APPCONTROL_VIEW_EXPORT;\r
+                       }\r
+                       else\r
+                       {\r
+                               __currentFileType = FILE_TYPE_ALL;\r
+                       }\r
                }\r
                else\r
                {\r
@@ -597,13 +622,14 @@ MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Stri
                SceneManager* pSceneManager = null;\r
                pSceneManager = SceneManager::GetInstance();\r
 \r
-               if (pSceneManager != null && __currentView != APPCONTROL_VIEW_IMPORT && __currentView != APPCONTROL_VIEW_EXPORT)\r
+               if (pSceneManager != null && __currentView != APPCONTROL_VIEW_IMPORT)\r
                {\r
                        IList* pArgs = new (std::nothrow) ArrayList();\r
                        pArgs->Add(new (std::nothrow) Integer(APPCONTROL_STATE_SELECTED));\r
                        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TEMP_FORM), pArgs);\r
                        //pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM));\r
                }\r
+#if 0\r
                else if (pSceneManager != null && __currentView == APPCONTROL_VIEW_IMPORT)\r
                {\r
                        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM), null);\r
@@ -612,6 +638,7 @@ MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Stri
                {\r
                        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_FOLDER_SELECTION_FORM), null);\r
                }\r
+#endif\r
        }\r
 \r
 }\r
index 2bdaa87..2d4c568 100644 (file)
@@ -1058,7 +1058,8 @@ SubFolderSelection::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId
                        _pListView->SetShowState(true);\r
                }\r
 \r
-       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT || _currentViewStyle == APPCONTROL_VIEW_IMPORT)\r
+#if 0\r
+               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT || _currentViewStyle == APPCONTROL_VIEW_IMPORT)\r
        {\r
                AppLogDebug("inside view check");\r
                String backupPath;\r
@@ -1101,6 +1102,7 @@ SubFolderSelection::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId
                                _pFilenames = _pFolderEntryPM->GetFolderEntryList();\r
                 */\r
        }\r
+#endif\r
        if (__pReceivedFilename != null)\r
        {\r
                //pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));\r