NABI_SE issues resolved
authorchitta.rs <chitta.rs@samsung.com>
Fri, 26 Apr 2013 10:44:39 +0000 (16:14 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Fri, 26 Apr 2013 11:20:10 +0000 (16:50 +0530)
Change-Id: I7da6ee1598687b8f2211fc199bae47fbfd7b9d9c

inc/MfCreateFolderForm.h
res/screen-size-normal/IDL_DELETE_POPUP.xml
src/MfDetailsForm.cpp
src/MfFileManageWorkerThread.cpp
src/MfMyFilesApp.cpp
src/MfSearchForm.cpp
src/MfSubBaseFolderEntryForm.cpp
src/MfSubFolderFileListForm.cpp
src/MfTopLevelFolderFileListForm.cpp

index d6f4771..275a8c9 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.0 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-\r
-/**\r
- * @file: MfCreateFolderForm.h\r
- * @brief:This file contains declaration of CreateFolderForm class, which implements the Create Folder and rename file/folder functionality\r
- * and contains methods that handle the same. Also contains the ResultValues enum\r
- */\r
-\r
-#ifndef _MF_CREATE_FOLDER_FORM_H_\r
-#define _MF_CREATE_FOLDER_FORM_H_\r
-\r
-#include <FGraphics.h>\r
-#include <FUi.h>\r
-#include <FText.h>\r
-\r
-#include "MfBaseForm.h"\r
-#include "MfFolderEntryEditorPresentationModel.h"\r
-#include "MfTypes.h"\r
-#include "MfMyFilesApp.h"\r
-\r
-enum  ResultValues\r
-{\r
-       RESULT_VALUES_FILE_EXISTS,\r
-       RESULT_VALUES_NULL,\r
-       RESULT_VALUES_SUCCESS\r
-};\r
-\r
-class CreateFolderForm\r
-       : public BaseForm\r
-       , public Tizen::Ui::IKeypadEventListener\r
-       , public Tizen::Ui::ITextEventListener\r
-       , public Tizen::Ui::ITouchEventListener\r
-{\r
-public:\r
-       //Constructor of the class.\r
-       CreateFolderForm(void);\r
-\r
-       // Destructor of the class.\r
-       virtual ~CreateFolderForm(void);\r
-\r
-       //Initializes the form in the Application.\r
-       bool Initialize(void);\r
-\r
-       // Call back is called On Initialization of Form\r
-       result OnInitializing(void);\r
-\r
-       // Call back is called On Termination of Form\r
-       result OnTerminating(void);\r
-\r
-       //IDeviceEventListener\r
-       virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);\r
-\r
-       //IActionEventListener\r
-       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);\r
-\r
-       //IOrientationEventListener\r
-       virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);\r
-\r
-       //IFormBackEventListener\r
-       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);\r
-\r
-       //IKeypadEventListener\r
-       virtual void OnKeypadWillOpen(Tizen::Ui::Control& source);\r
-       virtual void OnKeypadOpened(Tizen::Ui::Control& source);\r
-       virtual void OnKeypadClosed(Tizen::Ui::Control& source);\r
-       virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);\r
-\r
-       //ISceneEventListener\r
-       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);\r
-       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);\r
-\r
-       //ISceneManagerEventListener\r
-       virtual void OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId &currentSceneId);\r
-       virtual void OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId &currentSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId);\r
-\r
-       //ITextEventListener\r
-       virtual void OnTextValueChanged(const Tizen::Ui::Control& source);\r
-       virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);\r
-\r
-       //ITouchEventListener\r
-       virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-       virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-       virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-       virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-       virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-       virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);\r
-\r
-       // Call back is called On Changes in Device Status\r
-       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
-\r
-private:\r
-       // Copy Constructor of the class.\r
-       CreateFolderForm(const CreateFolderForm& createFolderForm);\r
-\r
-       // Generates the default name of the Folder in case the name has not been set by the user.\r
-       void GenerateFolderName(Tizen::Base::String& newName);\r
-\r
-       // Overloaded = Operator.\r
-       CreateFolderForm& operator =(const CreateFolderForm& createFolderForm);\r
-\r
-       result CreateFileProgressingPopup(void);\r
-\r
-       void TransitionScene(void);\r
-       \r
-       void HideFileProgressingPopup(void);\r
-       void ShowFileProgressingPopup(void);\r
-       void OnFileManagingStart(void);\r
-       void OnFileManagingStop(FileManagingResult fileProcessingResult);\r
-       void OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs);\r
-\r
-private:\r
-       static const int IDA_BUTTON_SAVE = 101;\r
-       static const int IDA_BUTTON_CANCEL = 102;\r
-       static const int IDA_KEYPAD_BUTTON_DONE = 103;\r
-       static const int IDA_KEYPAD_BUTTON_CANCEL = 104;\r
-       static const int IDA_BTN_POPUP_RENAME_CANCEL = 135;\r
-       static const int IDA_BTN_ANIMATION_POPUP_CANCEL = 136;\r
-\r
-       int entryIsDirectory;\r
-       bool __isCurrentDirectioryToBeRenamed;\r
-\r
-       FolderEntryEditorPresentationModel* __pFileManager;\r
-       DirectoryEntry* __pDirectory;\r
-\r
-       Tizen::Base::Integer __launchSource;\r
-       Tizen::Base::String __fileExtension;\r
-       Tizen::Base::String __fileName;\r
-       Tizen::Base::String __filePath;\r
-       Tizen::Base::String __rootPath;\r
-       Tizen::Base::String __updatedFilePath;\r
-\r
-       Tizen::Ui::Controls::Footer* __pFooter;\r
-       Tizen::Ui::Controls::FooterItem* __pFooterItemSave;\r
-\r
-       Tizen::Ui::Controls::ButtonItem* __pHeaderCancel;\r
-//     Tizen::Ui::Controls::ButtonItem* __pHeaderSave;\r
-       Tizen::Ui::Controls::HeaderItem* __pHeaderSave;\r
-       Tizen::Ui::Controls::EditField* __pEditFieldFolderName;\r
-       Tizen::Ui::Controls::Header* __pHeader;\r
-\r
-       Tizen::Ui::Controls::Popup* _pFileProgressingPopup;\r
-       Tizen::Ui::Controls::Button* _pFileProgressingCancelButton;\r
-       Tizen::Ui::Controls::Progress* _pFileProgressingProgress;\r
-       Tizen::Ui::Controls::Label* _pFileProgressingHeaderLabel;\r
-       Tizen::Ui::Controls::Label* _pFileProgressingLabel;\r
-\r
-       MemoryType __previousFormTab;\r
-       Tizen::Base::String __previousFormPath;\r
-       Tizen::Base::String __previousSceneId;\r
-\r
-       int __textLength;\r
-};\r
-\r
-#endif //_MF_CREATE_FOLDER_FORM_H_\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: MfCreateFolderForm.h
+ * @brief:This file contains declaration of CreateFolderForm class, which implements the Create Folder and rename file/folder functionality
+ * and contains methods that handle the same. Also contains the ResultValues enum
+ */
+
+#ifndef _MF_CREATE_FOLDER_FORM_H_
+#define _MF_CREATE_FOLDER_FORM_H_
+
+#include <FGraphics.h>
+#include <FUi.h>
+#include <FText.h>
+
+#include "MfBaseForm.h"
+#include "MfFolderEntryEditorPresentationModel.h"
+#include "MfTypes.h"
+#include "MfMyFilesApp.h"
+
+enum  ResultValues
+{
+       RESULT_VALUES_FILE_EXISTS,
+       RESULT_VALUES_NULL,
+       RESULT_VALUES_SUCCESS
+};
+
+class CreateFolderForm
+       : public BaseForm
+       , public Tizen::Ui::IKeypadEventListener
+       , public Tizen::Ui::ITextEventListener
+       , public Tizen::Ui::ITouchEventListener
+{
+public:
+       //Constructor of the class.
+       CreateFolderForm(void);
+
+       // Destructor of the class.
+       virtual ~CreateFolderForm(void);
+
+       //Initializes the form in the Application.
+       bool Initialize(void);
+
+       // Call back is called On Initialization of Form
+       result OnInitializing(void);
+
+       // Call back is called On Termination of Form
+       result OnTerminating(void);
+
+       //IDeviceEventListener
+       virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+
+       //IActionEventListener
+       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+       //IOrientationEventListener
+       virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
+
+       //IFormBackEventListener
+       virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+       //IKeypadEventListener
+       virtual void OnKeypadWillOpen(Tizen::Ui::Control& source);
+       virtual void OnKeypadOpened(Tizen::Ui::Control& source);
+       virtual void OnKeypadClosed(Tizen::Ui::Control& source);
+       virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
+
+       //ISceneEventListener
+       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
+
+       //ISceneManagerEventListener
+       virtual void OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId &currentSceneId);
+       virtual void OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId &currentSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId);
+
+       //ITextEventListener
+       virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
+       virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source);
+
+       //ITouchEventListener
+       virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
+
+       // Call back is called On Changes in Device Status
+       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);
+
+private:
+       // Copy Constructor of the class.
+       CreateFolderForm(const CreateFolderForm& createFolderForm);
+
+       // Generates the default name of the Folder in case the name has not been set by the user.
+       void GenerateFolderName(Tizen::Base::String& newName);
+
+       // Overloaded = Operator.
+       CreateFolderForm& operator =(const CreateFolderForm& createFolderForm);
+
+       result CreateFileProgressingPopup(void);
+
+       void TransitionScene(void);
+       
+       void HideFileProgressingPopup(void);
+       void ShowFileProgressingPopup(void);
+       void OnFileManagingStart(void);
+       void OnFileManagingStop(FileManagingResult fileProcessingResult);
+       void OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs);
+
+private:
+       static const int IDA_BUTTON_SAVE = 101;
+       static const int IDA_BUTTON_CANCEL = 102;
+       static const int IDA_KEYPAD_BUTTON_DONE = 103;
+       static const int IDA_KEYPAD_BUTTON_CANCEL = 104;
+       static const int IDA_BTN_POPUP_RENAME_CANCEL = 135;
+       static const int IDA_BTN_ANIMATION_POPUP_CANCEL = 136;
+
+       int entryIsDirectory;
+       bool __isCurrentDirectioryToBeRenamed;
+
+       FolderEntryEditorPresentationModel* __pFileManager;
+       DirectoryEntry* __pDirectory;
+
+       Tizen::Base::Integer __launchSource;
+       Tizen::Base::String __fileExtension;
+       Tizen::Base::String __fileName;
+       Tizen::Base::String __filePath;
+       Tizen::Base::String __rootPath;
+       Tizen::Base::String __updatedFilePath;
+
+       Tizen::Ui::Controls::Footer* __pFooter;
+       Tizen::Ui::Controls::FooterItem* __pFooterItemSave;
+
+       Tizen::Ui::Controls::ButtonItem* __pHeaderCancel;
+//     Tizen::Ui::Controls::ButtonItem* __pHeaderSave;
+       Tizen::Ui::Controls::HeaderItem* __pHeaderSave;
+       Tizen::Ui::Controls::EditField* __pEditFieldFolderName;
+       Tizen::Ui::Controls::Header* __pHeader;
+
+       Tizen::Ui::Controls::Popup* _pFileProgressingPopup;
+       Tizen::Ui::Controls::Button* _pFileProgressingCancelButton;
+       Tizen::Ui::Controls::Progress* _pFileProgressingProgress;
+       Tizen::Ui::Controls::Label* _pFileProgressingHeaderLabel;
+       Tizen::Ui::Controls::Label* _pFileProgressingLabel;
+
+       MemoryType __previousFormTab;
+       Tizen::Base::String __previousFormPath;
+       Tizen::Base::String __previousSceneId;
+
+       int __textLength;
+};
+
+#endif //_MF_CREATE_FOLDER_FORM_H_
index 9d2c59c..44c5f49 100644 (file)
@@ -3,7 +3,7 @@
        This XML file was automatically generated by UiBuilder - do not modify by hand.
 -->
 <!DOCTYPE ScenePopup SYSTEM "UIForm.dtd">
-<ScenePopup Bversion="2.0.0.201304161803" Dversion="20120315">
+<ScenePopup Bversion="2.0.0.201304191935" Dversion="20120315">
     <Popup id="IDL_DELETE_POPUP">
         <property accessibilityHint="" color="" titleText="" titleTextColor=""/>
         <layout height="230.0" mode="Portrait" style="" type="LAYOUT_RELATIVE" width="688.0"/>
     </Popup>
     <Label id="IDC_LABEL_DELETE" parent="IDL_DELETE_POPUP">
         <property accessibilityHint="" backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" horizontalAlign="ALIGN_LEFT" leftMargin="0" text="::IDS_COM_POP_DELETE_Q" textColor="" textSize="38.0" textStyle="LABEL_TEXT_STYLE_BOLD" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>
-        <layout bottomRelation="IDC_BUTTON_DELETE" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="80.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DELETE_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="20.0" marginLeft="16.0" marginRight="16.0" marginTop="32.0" mode="Portrait" rightRelation="IDL_DELETE_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_POPUP_DELETE" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="656.0" x="16.0" y="32.0"/>
+        <layout bottomRelation="" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="80.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DELETE_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="20.0" marginLeft="16.0" marginRight="16.0" marginTop="32.0" mode="Portrait" rightRelation="IDL_DELETE_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="656.0" x="16.0" y="32.0"/>
         <layout bottomRelation="IDC_BUTTON_DELETE" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_TOP" centerHorizontal="false" centerVertical="false" height="70.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DELETE_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="20.0" marginLeft="16.0" marginRight="16.0" marginTop="32.0" mode="Landscape" rightRelation="IDL_DELETE_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="IDL_POPUP_DELETE" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_CONTENT" width="656.0" x="16.0" y="32.0"/>
     </Label>
-    
-    
     <Button id="IDC_BUTTON_DELETE" parent="IDL_DELETE_POPUP">
         <property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="#FFFFFF" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="#D05252" disabledColorOpacity="40" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="#D05252" normalColorOpacity="100" normalTextColor="#FFFFFF" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="#C24747" pressedColorOpacity="100" pressedTextColor="" text="::IDS_MF_SK3_DELETE" textSize="36.0" verticalAlign="ALIGN_MIDDLE"/>
         <layout bottomRelation="IDL_DELETE_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DELETE_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24.0" marginLeft="16.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="318.0" x="16.0" y="132.0"/>
         <layout bottomRelation="IDL_DELETE_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_DELETE_POPUP" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="24.0" marginLeft="16.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="318.0" x="16.0" y="122.0"/>
     </Button>
     <Button id="IDC_BUTTON_CANCEL" parent="IDL_DELETE_POPUP">
-        <property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Cancel" textSize="36.0" verticalAlign="ALIGN_MIDDLE"/>
+        <property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="::IDS_COM_POP_CANCEL" textSize="36.0" verticalAlign="ALIGN_MIDDLE"/>
         <layout bottomRelation="IDL_DELETE_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_RIGHT" marginBottom="24.0" marginLeft="20.0" marginRight="16.0" marginTop="0.0" mode="Portrait" rightRelation="IDL_DELETE_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="318.0" x="354.0" y="132.0"/>
         <layout bottomRelation="IDL_DELETE_POPUP" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="74.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="24.0" marginLeft="0.0" marginRight="16.0" marginTop="0.0" mode="Landscape" rightRelation="IDL_DELETE_POPUP" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="318.0" x="354.0" y="122.0"/>
     </Button>
index ae4214a..0c662c5 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.0 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-\r
-/**\r
- * @file: MfFileDetailForm.cpp\r
- * @brief: This file contains the implementation of class DetailsForm, which acts as a View to display\r
- * the details of files or folders.\r
- */\r
-\r
-#include <FApp.h>\r
-#include <FUiControl.h>\r
-\r
-#include "MfDetailsForm.h"\r
-\r
-using namespace Tizen::App;\r
-using namespace Tizen::Base::Collection;\r
-using namespace Tizen::Base;\r
-using namespace Tizen::Content;\r
-using namespace Tizen::Graphics;\r
-using namespace Tizen::Io;\r
-using namespace Tizen::Locales;\r
-using namespace Tizen::System;\r
-using namespace Tizen::Ui;\r
-using namespace Tizen::Ui::Controls;\r
-using namespace Tizen::Ui::Scenes;\r
-\r
-DetailsForm::DetailsForm(void)\r
-       : __pMediaMetaData(null)\r
-       , __pFileDetailList(null)\r
-       , __pFileHeaderDetailList(null)\r
-       , __pGroupedDetailListView(null)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-DetailsForm::~DetailsForm(void)\r
-{\r
-       if (__pFileDetailList != null)\r
-       {\r
-               __pFileDetailList->RemoveAll(true);\r
-               delete __pFileDetailList;\r
-       }\r
-\r
-       if (__pFileHeaderDetailList != null)\r
-       {\r
-               __pFileHeaderDetailList->RemoveAll(true);\r
-               delete __pFileHeaderDetailList;\r
-       }\r
-}\r
-\r
-DetailsForm&\r
-DetailsForm::operator =(const DetailsForm& fileDetailForm)\r
-{\r
-       return *this;\r
-}\r
-\r
-DetailsForm::DetailsForm(const DetailsForm& fileDetailForm)\r
-{\r
-       //Do Nothing\r
-}\r
-\r
-bool\r
-DetailsForm::Initialize(void)\r
-{\r
-       result r = E_SUCCESS;\r
-       Construct(L"IDL_DETAIL_FORM");\r
-       __pFileDetailList = new (std::nothrow) ArrayList();\r
-       r = __pFileDetailList->Construct();\r
-\r
-       __pFileHeaderDetailList = new (std::nothrow) ArrayList();\r
-       r = __pFileHeaderDetailList->Construct();\r
-\r
-       return true;\r
-}\r
-\r
-result\r
-DetailsForm::OnInitializing(void)\r
-{\r
-       AppLogDebug("Entry");\r
-       result r = E_SUCCESS;\r
-       // Setup back event listener\r
-       SetFormBackEventListener(this);\r
-\r
-       __pGroupedDetailListView = static_cast< GroupedListView* >(GetControl(L"IDC_GROUPEDLISTVIEW1"));\r
-       if (__pGroupedDetailListView != null)\r
-       {\r
-               __pGroupedDetailListView->SetItemProvider(*this);\r
-               __pGroupedDetailListView->AddGroupedListViewItemEventListener(*this);\r
-               __pGroupedDetailListView->SetMultipointTouchEnabled(false);\r
-       }\r
-\r
-       SetMultipointTouchEnabled(false);\r
-       AppLogDebug("Exit");\r
-       return r;\r
-}\r
-\r
-result\r
-DetailsForm::OnTerminating(void)\r
-{\r
-       result r = E_SUCCESS;\r
-       return r;\r
-}\r
-\r
-void\r
-DetailsForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)\r
-{\r
-       AppLogDebug("Entry");\r
-       SceneManager* pSceneManager = SceneManager::GetInstance();\r
-       if (pSceneManager != null)\r
-       {\r
-               pSceneManager->GoBackward(BackwardSceneTransition());\r
-       }\r
-       AppLogDebug("Exit");\r
-}\r
-\r
-\r
-void\r
-DetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,\r
-                                                          const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)\r
-{\r
-       AppLogDebug("Entry");\r
-       String* pFilePath = null;\r
-       FolderEntryDetailPresentationModel mediaUtility;\r
-       FileAttributes fileAttrib;\r
-       String imageFileFormat;\r
-\r
-       ContentType contentType = CONTENT_TYPE_UNKNOWN;\r
-\r
-\r
-       SceneManager::GetInstance()->AddSceneManagerEventListener(*this);\r
-       DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);\r
-\r
-       if (pArgs != null)\r
-       {\r
-               pFilePath = dynamic_cast< String* >(pArgs->GetAt(0));\r
-               __fileFullPath.Clear();\r
-               if (pFilePath != null)\r
-               {\r
-                       __fileFullPath.Append(*pFilePath);\r
-               }\r
-               pArgs->RemoveAll(true);\r
-               contentType = ContentManagerUtil::CheckContentType(__fileFullPath);\r
-               File::GetAttributes(__fileFullPath, fileAttrib);\r
-        AppLogDebug("file path is %ls",__fileFullPath.GetPointer());\r
-               if (fileAttrib.IsDirectory())\r
-               {\r
-                       __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_FOLDER_TYPE);\r
-                       SetFileDetailList(FILE_TYPE_FOLDER_TYPE);\r
-               }\r
-               else\r
-               {\r
-                       int chkForFileFormatFlag = IMAGE_FILE_FORMAT;\r
-                       int counter = 0;\r
-                       if (chkForFileFormatFlag == IMAGE_FILE_FORMAT)\r
-                       {\r
-\r
-                               for (counter = 0; counter < IMAGE_FILE_FORMAT_COUNT; counter++)\r
-                               {\r
-                                       imageFileFormat = typeImage[counter];\r
-\r
-                                       //if (__fileFullPath.EndsWith(imageFileFormat))\r
-                                       if(contentType == CONTENT_TYPE_IMAGE)\r
-                                       {\r
-                                               chkForFileFormatFlag = IMAGE_FILE_FORMAT;\r
-\r
-                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_IMAGE_TYPE);\r
-                                               SetFileDetailList(FILE_TYPE_IMAGE_TYPE);\r
-                                               break;\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               chkForFileFormatFlag = AUDIO_FILE_FORMAT;\r
-                                       }\r
-\r
-                               }\r
-                       }\r
-\r
-                       if (chkForFileFormatFlag == AUDIO_FILE_FORMAT)\r
-                       //if(contentType == CONTENT_TYPE_AUDIO)\r
-                       {\r
-                               int counter = 0;\r
-\r
-                               for (counter = 0; counter < AUDIO_FILE_FORMAT_COUNT; counter++)\r
-                               {\r
-\r
-                                       String audioFileFormat = typeAudio[counter];\r
-\r
-                                       //if (__fileFullPath.EndsWith(audioFileFormat))\r
-                                       if(contentType == CONTENT_TYPE_AUDIO)\r
-                                       {\r
-                                               chkForFileFormatFlag = AUDIO_FILE_FORMAT;\r
-\r
-                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_AUDIO_TYPE);\r
-                                               SetFileDetailList(FILE_TYPE_AUDIO_TYPE);\r
-                                               break;\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               chkForFileFormatFlag = VIDEO_FILE_FORMAT;\r
-                                       }\r
-                               }\r
-                       }\r
-                       if (chkForFileFormatFlag == VIDEO_FILE_FORMAT)\r
-                       //if(contentType == CONTENT_TYPE_VIDEO)\r
-                       {\r
-                               int counter = 0;\r
-                               for (counter = 0; counter < VIDEO_FILE_FORMAT_COUNT; counter++)\r
-                               {\r
-                                       String videoFileFormat = typeVideo[counter];\r
-                                       //if (__fileFullPath.EndsWith(videoFileFormat))\r
-                                       if(contentType == CONTENT_TYPE_VIDEO)\r
-                                       {\r
-                                               chkForFileFormatFlag = VIDEO_FILE_FORMAT;\r
-\r
-                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_VIDEO_TYPE);\r
-                                               SetFileDetailList(FILE_TYPE_VIDEO_TYPE);\r
-                                               break;\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               chkForFileFormatFlag = OTHER_FILE_FORMAT;\r
-                                       }\r
-                               }\r
-                       }\r
-                       if (chkForFileFormatFlag == OTHER_FILE_FORMAT)\r
-                       {\r
-\r
-                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_OTHER_TYPE);\r
-                               SetFileDetailList(FILE_TYPE_OTHER_TYPE);\r
-                       }\r
-\r
-               }\r
-               delete pArgs;\r
-       }\r
-\r
-       AppLogDebug("Exit");\r
-}\r
-\r
-void\r
-DetailsForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,\r
-                                                               const Tizen::Ui::Scenes::SceneId& nextSceneId)\r
-{\r
-       DeviceManager::RemoveAllDeviceEventListeners();\r
-}\r
-\r
-void\r
-DetailsForm::SetFileDetailList(FileType fileType)\r
-{\r
-       AppLogDebug("Entry");\r
-       String* pNameHeading = null;\r
-       String* pFileName = null;\r
-       String* pSizeHeading = null;\r
-       String* pSize = null;\r
-       String* pContainsHeading = null;\r
-       String* pFileAndFolders = null;\r
-       String* pDateCreateHeading = null;\r
-       String* pDateAndTime = null;\r
-       String* pLocationHeading = null;\r
-       String* pFilePath = null;\r
-       String* pFormatHeading = null;\r
-       String* pFormat = null;\r
-       String* pResolutionHeading = null;\r
-       String* pResolution = null;\r
-       AppResource* pAppResource = null;\r
-\r
-       pAppResource = Application::GetInstance()->GetAppResource();\r
-       TryCatch(pAppResource != null, , "Failed to get instance of pAppResource");\r
-\r
-       switch (fileType)\r
-       {\r
-       case FILE_TYPE_FOLDER_TYPE:\r
-       {\r
-               String nameHeading;\r
-               String sizeHeading;\r
-               String containsHeading;\r
-               String dateCreatedHeading;\r
-               String locationHeading;\r
-               String size;\r
-               String fileAndFolders;\r
-               String dateAndTime;\r
-               String files;\r
-               String folders;\r
-\r
-               FolderMediaMetaData* folderMediaMetaData = static_cast< FolderMediaMetaData* >(__pMediaMetaData);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_FOLDERS", folders);\r
-               pAppResource->GetString(L"IDS_COM_OPT_FILES", files);\r
-\r
-\r
-               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);\r
-               pNameHeading = new (std::nothrow) String(nameHeading);\r
-\r
-               __pFileHeaderDetailList->Add(pNameHeading);\r
-\r
-\r
-               pFileName = new (std::nothrow) String(*(folderMediaMetaData->GetFileName()));\r
-               __pFileDetailList->Add(pFileName);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);\r
-\r
-               pSizeHeading = new (std::nothrow) String(sizeHeading);\r
-               __pFileHeaderDetailList->Add(pSizeHeading);\r
-\r
-\r
-               size = MfUtility::ConvertFileSizeToString(folderMediaMetaData->GetFileSize());\r
-\r
-               pSize = new (std::nothrow) String(size);\r
-               __pFileDetailList->Add(pSize);\r
-\r
-               fileAndFolders.Append(folderMediaMetaData->GetNoOfFiles());\r
-               fileAndFolders.Append(L" ");\r
-               fileAndFolders.Append(files);\r
-               fileAndFolders.Append(", ");\r
-               fileAndFolders.Append(folderMediaMetaData->GetNoOfFolders());\r
-               fileAndFolders.Append(L" ");\r
-               fileAndFolders.Append(folders);\r
-\r
-               pAppResource->GetString(L"IDS_MF_BODY_CONTAINS", containsHeading);\r
-\r
-\r
-               pContainsHeading = new (std::nothrow) String(containsHeading);\r
-               __pFileHeaderDetailList->Add(pContainsHeading);\r
-\r
-               pFileAndFolders = new (std::nothrow) String(fileAndFolders);\r
-               __pFileDetailList->Add(pFileAndFolders);\r
-\r
-               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);\r
-\r
-               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);\r
-               __pFileHeaderDetailList->Add(pDateCreateHeading);\r
-\r
-               dateAndTime = MfUtility::ConvertDateTimeToString(folderMediaMetaData->GetFileCreationTime());\r
-\r
-               pDateAndTime = new (std::nothrow) String(dateAndTime);\r
-               __pFileDetailList->Add(pDateAndTime);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);\r
-\r
-               pLocationHeading = new (std::nothrow) String(locationHeading);\r
-               __pFileHeaderDetailList->Add(pLocationHeading);\r
-\r
-               pFilePath = new (std::nothrow) String(*(folderMediaMetaData->GetFilePath()));\r
-               __pFileDetailList->Add(pFilePath);\r
-\r
-               //if (folderMediaMetaData != null)\r
-               //{\r
-\r
-               delete folderMediaMetaData;\r
-               folderMediaMetaData = null;\r
-               //}\r
-\r
-       }\r
-       break;\r
-\r
-       case FILE_TYPE_IMAGE_TYPE:\r
-       {\r
-               String nameHeading;\r
-               String sizeHeading;\r
-               String formatHeading;\r
-               String resolutionHeading;\r
-               String dateCreatedHeading;\r
-               String locationHeading;\r
-               String size;\r
-\r
-               ImageMediaMetaData* imageMediaMetaData = static_cast< ImageMediaMetaData* >(__pMediaMetaData);\r
-               TryCatch(imageMediaMetaData != null, , "Failed to allocate Image Media Meta Data");\r
-\r
-               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);\r
-               pNameHeading = new (std::nothrow) String(nameHeading);\r
-               __pFileHeaderDetailList->Add(pNameHeading);\r
-\r
-\r
-               pFileName = new (std::nothrow) String(*(imageMediaMetaData->GetFileName()));\r
-               __pFileDetailList->Add(pFileName);\r
-\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);\r
-               pSizeHeading = new (std::nothrow) String(sizeHeading);\r
-\r
-               __pFileHeaderDetailList->Add(pSizeHeading);\r
-\r
-               size = MfUtility::ConvertFileSizeToString(imageMediaMetaData->GetFileSize());\r
-               pSize = new (std::nothrow) String(size);\r
-               __pFileDetailList->Add(pSize);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);\r
-               pFormatHeading = new (std::nothrow) String(formatHeading);\r
-               __pFileHeaderDetailList->Add(pFormatHeading);\r
-\r
-               pFormat = new (std::nothrow) String(*(imageMediaMetaData->GetFileFormat()));\r
-               __pFileDetailList->Add(pFormat);\r
-\r
-               pAppResource->GetString(L"IDS_IDLE_BODY_RESOLUTION", resolutionHeading);\r
-               pResolutionHeading = new (std::nothrow) String(resolutionHeading);\r
-               __pFileHeaderDetailList->Add(pResolutionHeading);\r
-\r
-\r
-               pResolution = new (std::nothrow) String(*(imageMediaMetaData->GetFileResolution()));\r
-               __pFileDetailList->Add(pResolution);\r
-\r
-\r
-               String dateAndTime = MfUtility::ConvertDateTimeToString(imageMediaMetaData->GetFileCreationTime());\r
-               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);\r
-               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);\r
-               __pFileHeaderDetailList->Add(pDateCreateHeading);\r
-\r
-\r
-               pDateAndTime = new (std::nothrow) String(dateAndTime);\r
-               __pFileDetailList->Add(pDateAndTime);\r
-\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);\r
-               pLocationHeading = new (std::nothrow) String(locationHeading);\r
-               __pFileHeaderDetailList->Add(pLocationHeading);\r
-\r
-\r
-               pFilePath = new (std::nothrow) String(*(imageMediaMetaData->GetFilePath()));\r
-               __pFileDetailList->Add(pFilePath);\r
-\r
-               //if (imageMediaMetaData != null)\r
-               //{\r
-\r
-               delete imageMediaMetaData;\r
-               imageMediaMetaData = null;\r
-               //}\r
-\r
-       }\r
-       break;\r
-\r
-       case FILE_TYPE_AUDIO_TYPE:\r
-       {\r
-               String nameHeading;\r
-               String sizeHeading;\r
-               String formatHeading;\r
-               String dateCreatedHeading;\r
-               String locationHeading;\r
-               String size;\r
-\r
-               AudioMediaMetaData* audioMediaMetaData = static_cast< AudioMediaMetaData* >(__pMediaMetaData);\r
-               TryCatch(audioMediaMetaData != null, , "Failed to allocate Audio Media Meta Data");\r
-\r
-               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);\r
-               pNameHeading = new (std::nothrow) String(nameHeading);\r
-               __pFileHeaderDetailList->Add(pNameHeading);\r
-\r
-               pFileName = new (std::nothrow) String(*(audioMediaMetaData->GetFileName()));\r
-               __pFileDetailList->Add(pFileName);\r
-\r
-\r
-               size = MfUtility::ConvertFileSizeToString(audioMediaMetaData->GetFileSize());\r
-               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);\r
-               pSizeHeading = new (std::nothrow) String(sizeHeading);\r
-               __pFileHeaderDetailList->Add(pSizeHeading);\r
-\r
-               pSize = new (std::nothrow) String(size);\r
-               __pFileDetailList->Add(pSize);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);\r
-               pFormatHeading = new (std::nothrow) String(formatHeading);\r
-               __pFileHeaderDetailList->Add(pFormatHeading);\r
-\r
-               pFormat = new (std::nothrow) String(*(audioMediaMetaData->GetFileFormat()));\r
-               __pFileDetailList->Add(pFormat);\r
-\r
-               String dateAndTime = MfUtility::ConvertDateTimeToString(audioMediaMetaData->GetFileCreationTime());\r
-               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);\r
-               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);\r
-               __pFileHeaderDetailList->Add(pDateCreateHeading);\r
-\r
-               pDateAndTime = new (std::nothrow) String(dateAndTime);\r
-               __pFileDetailList->Add(pDateAndTime);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);\r
-               pLocationHeading = new (std::nothrow) String(locationHeading);\r
-               __pFileHeaderDetailList->Add(pLocationHeading);\r
-\r
-               pFilePath = new (std::nothrow) String(*(audioMediaMetaData->GetFilePath()));\r
-               __pFileDetailList->Add(pFilePath);\r
-\r
-               //if (audioMediaMetaData != null)\r
-               //{\r
-\r
-               delete audioMediaMetaData;\r
-               audioMediaMetaData = null;\r
-               //}\r
-\r
-       }\r
-       break;\r
-\r
-       case FILE_TYPE_VIDEO_TYPE:\r
-       {\r
-               String nameHeading;\r
-               String sizeHeading;\r
-               String formatHeading;\r
-               String resolutionHeading;\r
-               String dateCreatedHeading;\r
-               String locationHeading;\r
-               String size;\r
-\r
-               VideoMediaMetaData* videoMediaMetaData = static_cast< VideoMediaMetaData* >(__pMediaMetaData);\r
-               TryCatch(videoMediaMetaData != null, , "Failed to allocate Video Media Meta Data");\r
-\r
-               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);\r
-               pNameHeading = new (std::nothrow) String(nameHeading);\r
-               __pFileHeaderDetailList->Add(pNameHeading);\r
-\r
-               pFileName = new (std::nothrow) String(*(videoMediaMetaData->GetFileName()));\r
-               __pFileDetailList->Add(pFileName);\r
-\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);\r
-               pSizeHeading = new (std::nothrow) String(sizeHeading);\r
-               __pFileHeaderDetailList->Add(pSizeHeading);\r
-\r
-               size = MfUtility::ConvertFileSizeToString(videoMediaMetaData->GetFileSize());\r
-               pSize = new (std::nothrow) String(size);\r
-               __pFileDetailList->Add(pSize);\r
-\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);\r
-               pFormatHeading = new (std::nothrow) String(formatHeading);\r
-               __pFileHeaderDetailList->Add(pFormatHeading);\r
-\r
-               pFormat = new (std::nothrow) String(*(videoMediaMetaData->GetFileFormat()));\r
-               __pFileDetailList->Add(pFormat);\r
-\r
-               pAppResource->GetString(L"IDS_IDLE_BODY_RESOLUTION", resolutionHeading);\r
-               pResolutionHeading = new (std::nothrow) String(resolutionHeading);\r
-               __pFileHeaderDetailList->Add(pResolutionHeading);\r
-\r
-               pResolution = new (std::nothrow) String(*(videoMediaMetaData->GetFileResolution()));\r
-               __pFileDetailList->Add(pResolution);\r
-\r
-               String dateAndTime = MfUtility::ConvertDateTimeToString(videoMediaMetaData->GetFileCreationTime());\r
-               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);\r
-               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);\r
-               __pFileHeaderDetailList->Add(pDateCreateHeading);\r
-\r
-               pDateAndTime = new (std::nothrow) String(dateAndTime);\r
-               __pFileDetailList->Add(pDateAndTime);\r
-\r
-               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);\r
-               pLocationHeading = new (std::nothrow) String(locationHeading);\r
-               __pFileHeaderDetailList->Add(pLocationHeading);\r
-\r
-               pFilePath = new (std::nothrow) String(*(videoMediaMetaData->GetFilePath()));\r
-               __pFileDetailList->Add(pFilePath);\r
-\r
-               //if (videoMediaMetaData != null)\r
-               //{\r
-\r
-               delete videoMediaMetaData;\r
-               videoMediaMetaData = null;\r
-               //}\r
-\r
-       }\r
-       break;\r
-\r
-       case FILE_TYPE_OTHER_TYPE:\r
-       {\r
-               String nameHeading;\r
-               String sizeHeading;\r
-               String formatHeading;\r
-               String dateCreatedHeading;\r
-               String locationHeading;\r
-               String size;\r
-               OtherMediaMetaData* otherMediaMetaData = static_cast< OtherMediaMetaData* >(__pMediaMetaData);\r
-               TryCatch(otherMediaMetaData != null, , "Failed to allocate Other Media Meta Data");\r
-\r
-               if (otherMediaMetaData != null)\r
-               {\r
-                       pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);\r
-                       pNameHeading = new (std::nothrow) String(nameHeading);\r
-                       __pFileHeaderDetailList->Add(pNameHeading);\r
-\r
-                       pFileName = new (std::nothrow) String(*(otherMediaMetaData->GetFileName()));\r
-                       __pFileDetailList->Add(pFileName);\r
-\r
-                       size = MfUtility::ConvertFileSizeToString(otherMediaMetaData->GetFileSize());\r
-                       pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);\r
-                       pSizeHeading = new (std::nothrow) String(sizeHeading);\r
-                       __pFileHeaderDetailList->Add(pSizeHeading);\r
-\r
-                       pSize = new (std::nothrow) String(size);\r
-                       __pFileDetailList->Add(pSize);\r
-\r
-                       pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);\r
-                       pFormatHeading = new (std::nothrow) String(formatHeading);\r
-                       __pFileHeaderDetailList->Add(pFormatHeading);\r
-\r
-                       pFormat = new (std::nothrow) String(*(otherMediaMetaData->GetFileFormat()));\r
-                       __pFileDetailList->Add(pFormat);\r
-\r
-                       String dateAndTime = MfUtility::ConvertDateTimeToString(otherMediaMetaData->GetFileCreationTime());\r
-                       pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);\r
-                       pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);\r
-                       __pFileHeaderDetailList->Add(pDateCreateHeading);\r
-\r
-                       pDateAndTime = new (std::nothrow) String(dateAndTime);\r
-                       __pFileDetailList->Add(pDateAndTime);\r
-\r
-                       pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);\r
-                       pLocationHeading = new (std::nothrow) String(locationHeading);\r
-                       __pFileHeaderDetailList->Add(pLocationHeading);\r
-\r
-                       pFilePath = new (std::nothrow) String(*(otherMediaMetaData->GetFilePath()));\r
-                       __pFileDetailList->Add(pFilePath);\r
-\r
-\r
-                       delete otherMediaMetaData;\r
-                       otherMediaMetaData = null;\r
-               }\r
-\r
-       }\r
-       break;\r
-\r
-       default:\r
-       {\r
-               //Do Nothing.\r
-       }\r
-       break;\r
-       }\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-       return;\r
-\r
-CATCH:\r
-       AppLogDebug("Exit");\r
-       return;\r
-}\r
-\r
-\r
-\r
-void\r
-DetailsForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)\r
-{\r
-       Rectangle listViewBounds(GetClientAreaBounds().x, GetClientAreaBounds().y, GetClientAreaBounds().width, GetClientAreaBounds().height);\r
-\r
-       switch (orientationStatus)\r
-       {\r
-       case ORIENTATION_STATUS_PORTRAIT:\r
-       {\r
-               //Do Nothing\r
-       }\r
-       break;\r
-\r
-       case ORIENTATION_STATUS_LANDSCAPE:\r
-       {\r
-               //Do Nothing\r
-       }\r
-       break;\r
-\r
-       default:\r
-               //Do Nothing.\r
-               break;\r
-       }\r
-\r
-       Invalidate(true);\r
-}\r
-\r
-int\r
-DetailsForm::GetGroupCount(void)\r
-{\r
-       return 1;\r
-}\r
-\r
-int\r
-DetailsForm::GetItemCount(int groupIndex)\r
-{\r
-       if (__pFileDetailList != null)\r
-       {\r
-               AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-               return __pFileDetailList->GetCount();\r
-       }\r
-       else\r
-       {\r
-               return 0;\r
-       }\r
-}\r
-\r
-Tizen::Ui::Controls::GroupItem*\r
-DetailsForm::CreateGroupItem(int groupIndex,\r
-                                                        int itemWidth)\r
-{\r
-       GroupItem* pItem = new (std::nothrow) GroupItem();\r
-       pItem->Construct(Dimension(itemWidth, Y_DEFAULT));\r
-       pItem->SetElement(L"", null);\r
-\r
-       return pItem;\r
-}\r
-\r
-Tizen::Ui::Controls::ListItemBase*\r
-DetailsForm::CreateItem(int groupIndex,\r
-                                               int itemIndex,\r
-                                               int itemWidth)\r
-{\r
-\r
-       result r = E_SUCCESS;\r
-       ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;\r
-       String* pHeaderValue = null;\r
-       String* pValue = null;\r
-       CustomItem* pItem = null;\r
-       int w_Content = itemWidth - (2 * X_LISTVIEW);\r
-\r
-       pItem = new (std::nothrow) CustomItem();\r
-       TryCatch(pItem != null, , "Failed to allocate Memory to pItem");\r
-\r
-       pHeaderValue = static_cast< String* >(__pFileHeaderDetailList->GetAt(itemIndex));\r
-       pValue = static_cast< String* >(__pFileDetailList->GetAt(itemIndex));\r
-\r
-       pItem->Construct(Dimension(itemWidth, H_DETAIL_LISTVIEW), style);\r
-       pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW, w_Content, H_LISTVIEW_ITEM_DESCRIPTION),\r
-                                         ID_FORMAT_DETAIL_TYPE,\r
-                                         pHeaderValue->GetPointer(),\r
-                                         ID_FONT_SIZE_32,\r
-                                         Color::GetColor(COLOR_ID_GREY),\r
-                                         Color::GetColor(COLOR_ID_GREY),\r
-                                         Color::GetColor(COLOR_ID_GREY),\r
-                                         true);\r
-       pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW + H_LISTVIEW_ITEM_DESCRIPTION, w_Content, H_LISTVIEW_ITEM_TITLE),\r
-                                         ID_FORMAT_DETAIL_VALUE,\r
-                                         pValue->GetPointer(),\r
-                                         ID_FONT_SIZE_44,\r
-                                         Color::GetColor(COLOR_ID_BLACK),\r
-                                         Color::GetColor(COLOR_ID_BLACK),\r
-                                         Color::GetColor(COLOR_ID_BLACK), true);\r
-\r
-       pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,Color(246,249,239));\r
-       AppLogDebug("Exit %s", GetErrorMessage(r));\r
-       return pItem;\r
-\r
-CATCH:\r
-       AppLogDebug("Exit %s", GetErrorMessage(r));\r
-       return null;\r
-}\r
-\r
-bool\r
-DetailsForm::DeleteGroupItem(int groupIndex,\r
-                                                        Tizen::Ui::Controls::GroupItem* pItem,\r
-                                                        int itemWidth)\r
-{\r
-       delete pItem;\r
-       pItem = null;\r
-       return true;\r
-}\r
-\r
-bool\r
-DetailsForm::DeleteItem(int groupIndex,\r
-                                               int itemIndex,\r
-                                               Tizen::Ui::Controls::ListItemBase* pItem,\r
-                                               int itemWidth)\r
-{\r
-       delete pItem;\r
-       pItem = null;\r
-       return true;\r
-}\r
-\r
-void\r
-DetailsForm::OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)\r
-{\r
-       //Empty Implementation.\r
-}\r
-void\r
-DetailsForm::OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView,\r
-                                                                                          int groupIndex,\r
-                                                                                          int itemIndex,\r
-                                                                                          int elementId,\r
-                                                                                          Tizen::Ui::Controls::ListItemStatus state)\r
-{\r
-       //Empty Implementation.\r
-}\r
-void\r
-DetailsForm::OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView,\r
-                                                                               int groupIndex,\r
-                                                                               int itemIndex,\r
-                                                                               Tizen::Ui::Controls::SweepDirection direction)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-DetailsForm::OnGroupedListViewItemLongPressed(Tizen::Ui::Controls::GroupedListView& listView,\r
-                                                                                         int groupIndex,\r
-                                                                                         int itemIndex,\r
-                                                                                         int elementId,\r
-                                                                                         bool& invokeListViewItemCallback)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-DetailsForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,\r
-               const Tizen::Ui::Scenes::SceneId &currentSceneId)\r
-{\r
-       SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);\r
-\r
-       if (__pGroupedDetailListView != null)\r
-       {\r
-               __pGroupedDetailListView->UpdateList();\r
-       }\r
-}\r
-\r
-void\r
-DetailsForm::OnSceneTransitionStarted(const Tizen::Ui::Scenes::SceneId &currentSceneId,\r
-               const Tizen::Ui::Scenes::SceneId &nextSceneId)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-DetailsForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)\r
-{\r
-       bool setMediaPath = false;\r
-       bool searchHistoryStatus = false;\r
-       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;\r
-       String unmounted = sdCardStatusUnmounted;\r
-       String removed = usbDeviceStatusRemoved;\r
-       String currentPath;\r
-       String searchScene;\r
-       SceneManager* pSceneManager = null;\r
-       IListT< SceneId >* pSceneList = null;\r
-       int itemCount = 0;\r
-\r
-       pSceneManager = SceneManager::GetInstance();\r
-\r
-       if (state == unmounted || state == removed)\r
-       {\r
-               currentPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-               if (state == unmounted)\r
-               {\r
-                       if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))\r
-                       {\r
-                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
-                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
-                               setMediaPath = true;\r
-                       }\r
-               }\r
-\r
-               if (state == removed)\r
-               {\r
-                       if (currentPath.Contains(BasePresentationModel::GetUsbPath()))\r
-                       {\r
-                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());\r
-                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);\r
-                               setMediaPath = true;\r
-                       }\r
-               }\r
-\r
-               if (setMediaPath)\r
-               {\r
-                       if (pSceneManager != null)\r
-                       {\r
-                               pSceneList = pSceneManager->GetSceneHistoryN();\r
-                       }\r
-\r
-                       if (pSceneList != null)\r
-                       {\r
-                               itemCount = pSceneList->GetCount() - 1;\r
-                               pSceneList->GetAt(itemCount, searchScene);\r
-                               while (searchScene != IDSCN_SEARCH_FORM && itemCount >= 0)\r
-                               {\r
-                                       itemCount--;\r
-                                       pSceneList->GetAt(itemCount, searchScene);\r
-                               }\r
-                       }\r
-\r
-                       if (searchScene == IDSCN_SEARCH_FORM)\r
-                       {\r
-                               AppLogDebug("Search scene present");\r
-                               searchHistoryStatus = true;\r
-                       }\r
-                       else\r
-                       {\r
-                               AppLogDebug("Search scene not present");\r
-                               searchHistoryStatus = false;\r
-                       }\r
-\r
-                       if(pSceneList)\r
-                       {\r
-                               pSceneList->RemoveAll();\r
-                               delete pSceneList;\r
-                               pSceneList = null;\r
-                       }\r
-\r
-                       if (searchHistoryStatus == true)\r
-                       {\r
-                               if (pSceneManager != null)\r
-                               {\r
-                                       pSceneManager->DestroyScene(IDSCN_SEARCH_FORM);\r
-                                       pSceneManager->ClearSceneHistory();\r
-                               }\r
-                       }\r
-\r
-                       if (pSceneManager != null)\r
-                       {\r
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-void\r
-DetailsForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)\r
-{\r
-       ComponentType currentDeviceType;\r
-       switch (deviceType)\r
-       {\r
-       case StorageCard:\r
-       {\r
-               currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;\r
-       }\r
-       break;\r
-\r
-       case UsbClient:\r
-       {\r
-               currentDeviceType = COMPONENT_TYPE_USB;\r
-       }\r
-       break;\r
-\r
-       default:\r
-       {\r
-               //Do Nothing.\r
-       }\r
-       break;\r
-       }\r
-       OnDeviceChange(currentDeviceType, state);\r
-}\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: MfFileDetailForm.cpp
+ * @brief: This file contains the implementation of class DetailsForm, which acts as a View to display
+ * the details of files or folders.
+ */
+
+#include <FApp.h>
+#include <FUiControl.h>
+
+#include "MfDetailsForm.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base;
+using namespace Tizen::Content;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Locales;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+DetailsForm::DetailsForm(void)
+       : __pMediaMetaData(null)
+       , __pFileDetailList(null)
+       , __pFileHeaderDetailList(null)
+       , __pGroupedDetailListView(null)
+{
+       //Empty Implementation.
+}
+
+DetailsForm::~DetailsForm(void)
+{
+       if (__pFileDetailList != null)
+       {
+               __pFileDetailList->RemoveAll(true);
+               delete __pFileDetailList;
+       }
+
+       if (__pFileHeaderDetailList != null)
+       {
+               __pFileHeaderDetailList->RemoveAll(true);
+               delete __pFileHeaderDetailList;
+       }
+}
+
+DetailsForm&
+DetailsForm::operator =(const DetailsForm& fileDetailForm)
+{
+       return *this;
+}
+
+DetailsForm::DetailsForm(const DetailsForm& fileDetailForm)
+{
+       //Do Nothing
+}
+
+bool
+DetailsForm::Initialize(void)
+{
+       result r = E_SUCCESS;
+       Construct(L"IDL_DETAIL_FORM");
+       __pFileDetailList = new (std::nothrow) ArrayList();
+       r = __pFileDetailList->Construct();
+
+       __pFileHeaderDetailList = new (std::nothrow) ArrayList();
+       r = __pFileHeaderDetailList->Construct();
+
+       return true;
+}
+
+result
+DetailsForm::OnInitializing(void)
+{
+       AppLogDebug("Entry");
+       result r = E_SUCCESS;
+       // Setup back event listener
+       SetFormBackEventListener(this);
+
+       __pGroupedDetailListView = static_cast< GroupedListView* >(GetControl(L"IDC_GROUPEDLISTVIEW1"));
+       if (__pGroupedDetailListView != null)
+       {
+               __pGroupedDetailListView->SetItemProvider(*this);
+               __pGroupedDetailListView->AddGroupedListViewItemEventListener(*this);
+               __pGroupedDetailListView->SetMultipointTouchEnabled(false);
+       }
+
+       SetMultipointTouchEnabled(false);
+       AppLogDebug("Exit");
+       return r;
+}
+
+result
+DetailsForm::OnTerminating(void)
+{
+       result r = E_SUCCESS;
+       return r;
+}
+
+void
+DetailsForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+       AppLogDebug("Entry");
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       if (pSceneManager != null)
+       {
+               pSceneManager->GoBackward(BackwardSceneTransition());
+       }
+       AppLogDebug("Exit");
+}
+
+
+void
+DetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                          const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+       AppLogDebug("Entry");
+       String* pFilePath = null;
+       FolderEntryDetailPresentationModel mediaUtility;
+       FileAttributes fileAttrib;
+       String imageFileFormat;
+
+       ContentType contentType = CONTENT_TYPE_UNKNOWN;
+
+
+       SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
+       DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+
+       if (pArgs != null)
+       {
+               pFilePath = dynamic_cast< String* >(pArgs->GetAt(0));
+               __fileFullPath.Clear();
+               if (pFilePath != null)
+               {
+                       __fileFullPath.Append(*pFilePath);
+               }
+               pArgs->RemoveAll(true);
+               contentType = ContentManagerUtil::CheckContentType(__fileFullPath);
+               File::GetAttributes(__fileFullPath, fileAttrib);
+        AppLogDebug("file path is %ls",__fileFullPath.GetPointer());
+               if (fileAttrib.IsDirectory())
+               {
+                       __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_FOLDER_TYPE);
+                       SetFileDetailList(FILE_TYPE_FOLDER_TYPE);
+               }
+               else
+               {
+                       int chkForFileFormatFlag = IMAGE_FILE_FORMAT;
+                       int counter = 0;
+                       if (chkForFileFormatFlag == IMAGE_FILE_FORMAT)
+                       {
+
+                               for (counter = 0; counter < IMAGE_FILE_FORMAT_COUNT; counter++)
+                               {
+                                       imageFileFormat = typeImage[counter];
+
+                                       //if (__fileFullPath.EndsWith(imageFileFormat))
+                                       if(contentType == CONTENT_TYPE_IMAGE)
+                                       {
+                                               chkForFileFormatFlag = IMAGE_FILE_FORMAT;
+
+                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_IMAGE_TYPE);
+                                               SetFileDetailList(FILE_TYPE_IMAGE_TYPE);
+                                               break;
+                                       }
+                                       else
+                                       {
+                                               chkForFileFormatFlag = AUDIO_FILE_FORMAT;
+                                       }
+
+                               }
+                       }
+
+                       if (chkForFileFormatFlag == AUDIO_FILE_FORMAT)
+                       //if(contentType == CONTENT_TYPE_AUDIO)
+                       {
+                               int counter = 0;
+
+                               for (counter = 0; counter < AUDIO_FILE_FORMAT_COUNT; counter++)
+                               {
+
+                                       String audioFileFormat = typeAudio[counter];
+
+                                       //if (__fileFullPath.EndsWith(audioFileFormat))
+                                       if(contentType == CONTENT_TYPE_AUDIO)
+                                       {
+                                               chkForFileFormatFlag = AUDIO_FILE_FORMAT;
+
+                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_AUDIO_TYPE);
+                                               SetFileDetailList(FILE_TYPE_AUDIO_TYPE);
+                                               break;
+                                       }
+                                       else
+                                       {
+                                               chkForFileFormatFlag = VIDEO_FILE_FORMAT;
+                                       }
+                               }
+                       }
+                       if (chkForFileFormatFlag == VIDEO_FILE_FORMAT)
+                       //if(contentType == CONTENT_TYPE_VIDEO)
+                       {
+                               int counter = 0;
+                               for (counter = 0; counter < VIDEO_FILE_FORMAT_COUNT; counter++)
+                               {
+                                       String videoFileFormat = typeVideo[counter];
+                                       //if (__fileFullPath.EndsWith(videoFileFormat))
+                                       if(contentType == CONTENT_TYPE_VIDEO)
+                                       {
+                                               chkForFileFormatFlag = VIDEO_FILE_FORMAT;
+
+                                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_VIDEO_TYPE);
+                                               SetFileDetailList(FILE_TYPE_VIDEO_TYPE);
+                                               break;
+                                       }
+                                       else
+                                       {
+                                               chkForFileFormatFlag = OTHER_FILE_FORMAT;
+                                       }
+                               }
+                       }
+                       if (chkForFileFormatFlag == OTHER_FILE_FORMAT)
+                       {
+
+                               __pMediaMetaData = mediaUtility.GetFolderEntryMetaDataN(__fileFullPath, FILE_TYPE_OTHER_TYPE);
+                               SetFileDetailList(FILE_TYPE_OTHER_TYPE);
+                       }
+
+               }
+               delete pArgs;
+       }
+
+       AppLogDebug("Exit");
+}
+
+void
+DetailsForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                               const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+       DeviceManager::RemoveAllDeviceEventListeners();
+}
+
+void
+DetailsForm::SetFileDetailList(FileType fileType)
+{
+       AppLogDebug("Entry");
+       String* pNameHeading = null;
+       String* pFileName = null;
+       String* pSizeHeading = null;
+       String* pSize = null;
+       String* pContainsHeading = null;
+       String* pFileAndFolders = null;
+       String* pDateCreateHeading = null;
+       String* pDateAndTime = null;
+       String* pLocationHeading = null;
+       String* pFilePath = null;
+       String* pFormatHeading = null;
+       String* pFormat = null;
+       String* pResolutionHeading = null;
+       String* pResolution = null;
+       AppResource* pAppResource = null;
+
+       pAppResource = Application::GetInstance()->GetAppResource();
+       TryCatch(pAppResource != null, , "Failed to get instance of pAppResource");
+
+       switch (fileType)
+       {
+       case FILE_TYPE_FOLDER_TYPE:
+       {
+               String nameHeading;
+               String sizeHeading;
+               String containsHeading;
+               String dateCreatedHeading;
+               String locationHeading;
+               String size;
+               String fileAndFolders;
+               String dateAndTime;
+               String files;
+               String folders;
+
+               FolderMediaMetaData* folderMediaMetaData = static_cast< FolderMediaMetaData* >(__pMediaMetaData);
+
+               pAppResource->GetString(L"IDS_COM_BODY_FOLDERS", folders);
+               pAppResource->GetString(L"IDS_COM_OPT_FILES", files);
+
+
+               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);
+               pNameHeading = new (std::nothrow) String(nameHeading);
+
+               __pFileHeaderDetailList->Add(pNameHeading);
+
+
+               pFileName = new (std::nothrow) String(*(folderMediaMetaData->GetFileName()));
+               __pFileDetailList->Add(pFileName);
+
+               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);
+
+               pSizeHeading = new (std::nothrow) String(sizeHeading);
+               __pFileHeaderDetailList->Add(pSizeHeading);
+
+
+               size = MfUtility::ConvertFileSizeToString(folderMediaMetaData->GetFileSize());
+
+               pSize = new (std::nothrow) String(size);
+               __pFileDetailList->Add(pSize);
+
+               fileAndFolders.Append(folderMediaMetaData->GetNoOfFiles());
+               fileAndFolders.Append(L" ");
+               fileAndFolders.Append(files);
+               fileAndFolders.Append(", ");
+               fileAndFolders.Append(folderMediaMetaData->GetNoOfFolders());
+               fileAndFolders.Append(L" ");
+               fileAndFolders.Append(folders);
+
+               pAppResource->GetString(L"IDS_MF_BODY_CONTAINS", containsHeading);
+
+
+               pContainsHeading = new (std::nothrow) String(containsHeading);
+               __pFileHeaderDetailList->Add(pContainsHeading);
+
+               pFileAndFolders = new (std::nothrow) String(fileAndFolders);
+               __pFileDetailList->Add(pFileAndFolders);
+
+               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);
+
+               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);
+               __pFileHeaderDetailList->Add(pDateCreateHeading);
+
+               dateAndTime = MfUtility::ConvertDateTimeToString(folderMediaMetaData->GetFileCreationTime());
+
+               pDateAndTime = new (std::nothrow) String(dateAndTime);
+               __pFileDetailList->Add(pDateAndTime);
+
+               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);
+
+               pLocationHeading = new (std::nothrow) String(locationHeading);
+               __pFileHeaderDetailList->Add(pLocationHeading);
+
+               pFilePath = new (std::nothrow) String(*(folderMediaMetaData->GetFilePath()));
+               __pFileDetailList->Add(pFilePath);
+
+               //if (folderMediaMetaData != null)
+               //{
+
+               delete folderMediaMetaData;
+               folderMediaMetaData = null;
+               //}
+
+       }
+       break;
+
+       case FILE_TYPE_IMAGE_TYPE:
+       {
+               String nameHeading;
+               String sizeHeading;
+               String formatHeading;
+               String resolutionHeading;
+               String dateCreatedHeading;
+               String locationHeading;
+               String size;
+
+               ImageMediaMetaData* imageMediaMetaData = static_cast< ImageMediaMetaData* >(__pMediaMetaData);
+               TryCatch(imageMediaMetaData != null, , "Failed to allocate Image Media Meta Data");
+
+               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);
+               pNameHeading = new (std::nothrow) String(nameHeading);
+               __pFileHeaderDetailList->Add(pNameHeading);
+
+
+               pFileName = new (std::nothrow) String(*(imageMediaMetaData->GetFileName()));
+               __pFileDetailList->Add(pFileName);
+
+
+               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);
+               pSizeHeading = new (std::nothrow) String(sizeHeading);
+
+               __pFileHeaderDetailList->Add(pSizeHeading);
+
+               size = MfUtility::ConvertFileSizeToString(imageMediaMetaData->GetFileSize());
+               pSize = new (std::nothrow) String(size);
+               __pFileDetailList->Add(pSize);
+
+               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);
+               pFormatHeading = new (std::nothrow) String(formatHeading);
+               __pFileHeaderDetailList->Add(pFormatHeading);
+
+               pFormat = new (std::nothrow) String(*(imageMediaMetaData->GetFileFormat()));
+               __pFileDetailList->Add(pFormat);
+
+               pAppResource->GetString(L"IDS_IDLE_BODY_RESOLUTION", resolutionHeading);
+               pResolutionHeading = new (std::nothrow) String(resolutionHeading);
+               __pFileHeaderDetailList->Add(pResolutionHeading);
+
+
+               pResolution = new (std::nothrow) String(*(imageMediaMetaData->GetFileResolution()));
+               __pFileDetailList->Add(pResolution);
+
+
+               String dateAndTime = MfUtility::ConvertDateTimeToString(imageMediaMetaData->GetFileCreationTime());
+               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);
+               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);
+               __pFileHeaderDetailList->Add(pDateCreateHeading);
+
+
+               pDateAndTime = new (std::nothrow) String(dateAndTime);
+               __pFileDetailList->Add(pDateAndTime);
+
+
+               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);
+               pLocationHeading = new (std::nothrow) String(locationHeading);
+               __pFileHeaderDetailList->Add(pLocationHeading);
+
+
+               pFilePath = new (std::nothrow) String(*(imageMediaMetaData->GetFilePath()));
+               __pFileDetailList->Add(pFilePath);
+
+               //if (imageMediaMetaData != null)
+               //{
+
+               delete imageMediaMetaData;
+               imageMediaMetaData = null;
+               //}
+
+       }
+       break;
+
+       case FILE_TYPE_AUDIO_TYPE:
+       {
+               String nameHeading;
+               String sizeHeading;
+               String formatHeading;
+               String dateCreatedHeading;
+               String locationHeading;
+               String size;
+
+               AudioMediaMetaData* audioMediaMetaData = static_cast< AudioMediaMetaData* >(__pMediaMetaData);
+               TryCatch(audioMediaMetaData != null, , "Failed to allocate Audio Media Meta Data");
+
+               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);
+               pNameHeading = new (std::nothrow) String(nameHeading);
+               __pFileHeaderDetailList->Add(pNameHeading);
+
+               pFileName = new (std::nothrow) String(*(audioMediaMetaData->GetFileName()));
+               __pFileDetailList->Add(pFileName);
+
+
+               size = MfUtility::ConvertFileSizeToString(audioMediaMetaData->GetFileSize());
+               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);
+               pSizeHeading = new (std::nothrow) String(sizeHeading);
+               __pFileHeaderDetailList->Add(pSizeHeading);
+
+               pSize = new (std::nothrow) String(size);
+               __pFileDetailList->Add(pSize);
+
+               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);
+               pFormatHeading = new (std::nothrow) String(formatHeading);
+               __pFileHeaderDetailList->Add(pFormatHeading);
+
+               pFormat = new (std::nothrow) String(*(audioMediaMetaData->GetFileFormat()));
+               __pFileDetailList->Add(pFormat);
+
+               String dateAndTime = MfUtility::ConvertDateTimeToString(audioMediaMetaData->GetFileCreationTime());
+               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);
+               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);
+               __pFileHeaderDetailList->Add(pDateCreateHeading);
+
+               pDateAndTime = new (std::nothrow) String(dateAndTime);
+               __pFileDetailList->Add(pDateAndTime);
+
+               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);
+               pLocationHeading = new (std::nothrow) String(locationHeading);
+               __pFileHeaderDetailList->Add(pLocationHeading);
+
+               pFilePath = new (std::nothrow) String(*(audioMediaMetaData->GetFilePath()));
+               __pFileDetailList->Add(pFilePath);
+
+               //if (audioMediaMetaData != null)
+               //{
+
+               delete audioMediaMetaData;
+               audioMediaMetaData = null;
+               //}
+
+       }
+       break;
+
+       case FILE_TYPE_VIDEO_TYPE:
+       {
+               String nameHeading;
+               String sizeHeading;
+               String formatHeading;
+               String resolutionHeading;
+               String dateCreatedHeading;
+               String locationHeading;
+               String size;
+
+               VideoMediaMetaData* videoMediaMetaData = static_cast< VideoMediaMetaData* >(__pMediaMetaData);
+               TryCatch(videoMediaMetaData != null, , "Failed to allocate Video Media Meta Data");
+
+               pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);
+               pNameHeading = new (std::nothrow) String(nameHeading);
+               __pFileHeaderDetailList->Add(pNameHeading);
+
+               pFileName = new (std::nothrow) String(*(videoMediaMetaData->GetFileName()));
+               __pFileDetailList->Add(pFileName);
+
+
+               pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);
+               pSizeHeading = new (std::nothrow) String(sizeHeading);
+               __pFileHeaderDetailList->Add(pSizeHeading);
+
+               size = MfUtility::ConvertFileSizeToString(videoMediaMetaData->GetFileSize());
+               pSize = new (std::nothrow) String(size);
+               __pFileDetailList->Add(pSize);
+
+
+               pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);
+               pFormatHeading = new (std::nothrow) String(formatHeading);
+               __pFileHeaderDetailList->Add(pFormatHeading);
+
+               pFormat = new (std::nothrow) String(*(videoMediaMetaData->GetFileFormat()));
+               __pFileDetailList->Add(pFormat);
+
+               pAppResource->GetString(L"IDS_IDLE_BODY_RESOLUTION", resolutionHeading);
+               pResolutionHeading = new (std::nothrow) String(resolutionHeading);
+               __pFileHeaderDetailList->Add(pResolutionHeading);
+
+               pResolution = new (std::nothrow) String(*(videoMediaMetaData->GetFileResolution()));
+               __pFileDetailList->Add(pResolution);
+
+               String dateAndTime = MfUtility::ConvertDateTimeToString(videoMediaMetaData->GetFileCreationTime());
+               pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);
+               pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);
+               __pFileHeaderDetailList->Add(pDateCreateHeading);
+
+               pDateAndTime = new (std::nothrow) String(dateAndTime);
+               __pFileDetailList->Add(pDateAndTime);
+
+               pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);
+               pLocationHeading = new (std::nothrow) String(locationHeading);
+               __pFileHeaderDetailList->Add(pLocationHeading);
+
+               pFilePath = new (std::nothrow) String(*(videoMediaMetaData->GetFilePath()));
+               __pFileDetailList->Add(pFilePath);
+
+               //if (videoMediaMetaData != null)
+               //{
+
+               delete videoMediaMetaData;
+               videoMediaMetaData = null;
+               //}
+
+       }
+       break;
+
+       case FILE_TYPE_OTHER_TYPE:
+       {
+               String nameHeading;
+               String sizeHeading;
+               String formatHeading;
+               String dateCreatedHeading;
+               String locationHeading;
+               String size;
+               OtherMediaMetaData* otherMediaMetaData = static_cast< OtherMediaMetaData* >(__pMediaMetaData);
+               TryCatch(otherMediaMetaData != null, , "Failed to allocate Other Media Meta Data");
+
+               if (otherMediaMetaData != null)
+               {
+                       pAppResource->GetString(L"IDS_MF_OPT_LISTBY_NAME", nameHeading);
+                       pNameHeading = new (std::nothrow) String(nameHeading);
+                       __pFileHeaderDetailList->Add(pNameHeading);
+
+                       pFileName = new (std::nothrow) String(*(otherMediaMetaData->GetFileName()));
+                       __pFileDetailList->Add(pFileName);
+
+                       size = MfUtility::ConvertFileSizeToString(otherMediaMetaData->GetFileSize());
+                       pAppResource->GetString(L"IDS_COM_BODY_SIZE", sizeHeading);
+                       pSizeHeading = new (std::nothrow) String(sizeHeading);
+                       __pFileHeaderDetailList->Add(pSizeHeading);
+
+                       pSize = new (std::nothrow) String(size);
+                       __pFileDetailList->Add(pSize);
+
+                       pAppResource->GetString(L"IDS_COM_BODY_FORMAT", formatHeading);
+                       pFormatHeading = new (std::nothrow) String(formatHeading);
+                       __pFileHeaderDetailList->Add(pFormatHeading);
+
+                       pFormat = new (std::nothrow) String(*(otherMediaMetaData->GetFileFormat()));
+                       __pFileDetailList->Add(pFormat);
+
+                       String dateAndTime = MfUtility::ConvertDateTimeToString(otherMediaMetaData->GetFileCreationTime());
+                       pAppResource->GetString(L"IDS_MF_BODY_CREATED_DATE", dateCreatedHeading);
+                       pDateCreateHeading = new (std::nothrow) String(dateCreatedHeading);
+                       __pFileHeaderDetailList->Add(pDateCreateHeading);
+
+                       pDateAndTime = new (std::nothrow) String(dateAndTime);
+                       __pFileDetailList->Add(pDateAndTime);
+
+                       pAppResource->GetString(L"IDS_COM_BODY_LOCATION", locationHeading);
+                       pLocationHeading = new (std::nothrow) String(locationHeading);
+                       __pFileHeaderDetailList->Add(pLocationHeading);
+
+                       pFilePath = new (std::nothrow) String(*(otherMediaMetaData->GetFilePath()));
+                       __pFileDetailList->Add(pFilePath);
+
+
+                       delete otherMediaMetaData;
+                       otherMediaMetaData = null;
+               }
+
+       }
+       break;
+
+       default:
+       {
+               //Do Nothing.
+       }
+       break;
+       }
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+       return;
+
+CATCH:
+       AppLogDebug("Exit");
+       return;
+}
+
+
+
+void
+DetailsForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+       Rectangle listViewBounds(GetClientAreaBounds().x, GetClientAreaBounds().y, GetClientAreaBounds().width, GetClientAreaBounds().height);
+
+       switch (orientationStatus)
+       {
+       case ORIENTATION_STATUS_PORTRAIT:
+       {
+               //Do Nothing
+       }
+       break;
+
+       case ORIENTATION_STATUS_LANDSCAPE:
+       {
+               //Do Nothing
+       }
+       break;
+
+       default:
+               //Do Nothing.
+               break;
+       }
+
+       Invalidate(true);
+}
+
+int
+DetailsForm::GetGroupCount(void)
+{
+       return 1;
+}
+
+int
+DetailsForm::GetItemCount(int groupIndex)
+{
+       if (__pFileDetailList != null)
+       {
+               AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+               return __pFileDetailList->GetCount();
+       }
+       else
+       {
+               return 0;
+       }
+}
+
+Tizen::Ui::Controls::GroupItem*
+DetailsForm::CreateGroupItem(int groupIndex,
+                                                        int itemWidth)
+{
+       GroupItem* pItem = new (std::nothrow) GroupItem();
+       pItem->Construct(Dimension(itemWidth, Y_DEFAULT));
+       pItem->SetElement(L"", null);
+
+       return pItem;
+}
+
+Tizen::Ui::Controls::ListItemBase*
+DetailsForm::CreateItem(int groupIndex,
+                                               int itemIndex,
+                                               int itemWidth)
+{
+
+       result r = E_SUCCESS;
+       ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+       String* pHeaderValue = null;
+       String* pValue = null;
+       CustomItem* pItem = null;
+       int w_Content = itemWidth - (2 * X_LISTVIEW);
+
+       pItem = new (std::nothrow) CustomItem();
+       TryCatch(pItem != null, , "Failed to allocate Memory to pItem");
+
+       pHeaderValue = static_cast< String* >(__pFileHeaderDetailList->GetAt(itemIndex));
+       pValue = static_cast< String* >(__pFileDetailList->GetAt(itemIndex));
+
+       pItem->Construct(Dimension(itemWidth, H_DETAIL_LISTVIEW), style);
+       pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW, w_Content, H_LISTVIEW_ITEM_DESCRIPTION),
+                                         ID_FORMAT_DETAIL_TYPE,
+                                         pHeaderValue->GetPointer(),
+                                         ID_FONT_SIZE_32,
+                                         Color::GetColor(COLOR_ID_GREY),
+                                         Color::GetColor(COLOR_ID_GREY),
+                                         Color::GetColor(COLOR_ID_GREY),
+                                         true);
+       pItem->AddElement(Rectangle(X_LISTVIEW, Y_LISTVIEW + H_LISTVIEW_ITEM_DESCRIPTION, w_Content, H_LISTVIEW_ITEM_TITLE),
+                                         ID_FORMAT_DETAIL_VALUE,
+                                         pValue->GetPointer(),
+                                         ID_FONT_SIZE_44,
+                                         Color::GetColor(COLOR_ID_BLACK),
+                                         Color::GetColor(COLOR_ID_BLACK),
+                                         Color::GetColor(COLOR_ID_BLACK), true);
+
+       pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,Color(246,249,239));
+       AppLogDebug("Exit %s", GetErrorMessage(r));
+       return pItem;
+
+CATCH:
+       AppLogDebug("Exit %s", GetErrorMessage(r));
+       return null;
+}
+
+bool
+DetailsForm::DeleteGroupItem(int groupIndex,
+                                                        Tizen::Ui::Controls::GroupItem* pItem,
+                                                        int itemWidth)
+{
+       delete pItem;
+       pItem = null;
+       return true;
+}
+
+bool
+DetailsForm::DeleteItem(int groupIndex,
+                                               int itemIndex,
+                                               Tizen::Ui::Controls::ListItemBase* pItem,
+                                               int itemWidth)
+{
+       delete pItem;
+       pItem = null;
+       return true;
+}
+
+void
+DetailsForm::OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
+{
+       //Empty Implementation.
+}
+void
+DetailsForm::OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView,
+                                                                                          int groupIndex,
+                                                                                          int itemIndex,
+                                                                                          int elementId,
+                                                                                          Tizen::Ui::Controls::ListItemStatus state)
+{
+       //Empty Implementation.
+}
+void
+DetailsForm::OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView,
+                                                                               int groupIndex,
+                                                                               int itemIndex,
+                                                                               Tizen::Ui::Controls::SweepDirection direction)
+{
+       //Empty Implementation.
+}
+
+void
+DetailsForm::OnGroupedListViewItemLongPressed(Tizen::Ui::Controls::GroupedListView& listView,
+                                                                                         int groupIndex,
+                                                                                         int itemIndex,
+                                                                                         int elementId,
+                                                                                         bool& invokeListViewItemCallback)
+{
+       //Empty Implementation.
+}
+
+void
+DetailsForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
+               const Tizen::Ui::Scenes::SceneId &currentSceneId)
+{
+       SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
+
+       if (__pGroupedDetailListView != null)
+       {
+               __pGroupedDetailListView->UpdateList();
+       }
+}
+
+void
+DetailsForm::OnSceneTransitionStarted(const Tizen::Ui::Scenes::SceneId &currentSceneId,
+               const Tizen::Ui::Scenes::SceneId &nextSceneId)
+{
+       //Empty Implementation.
+}
+
+void
+DetailsForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
+{
+       AppLogDebug("DetailsForm::OnDeviceChange");
+
+       bool setMediaPath = false;
+       bool searchHistoryStatus = false;
+       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
+       String unmounted = sdCardStatusUnmounted;
+       String removed = usbDeviceStatusRemoved;
+       String currentPath;
+       String searchScene;
+       SceneManager* pSceneManager = null;
+       IListT< SceneId >* pSceneList = null;
+       int itemCount = 0;
+
+       pSceneManager = SceneManager::GetInstance();
+
+       if (state == unmounted || state == removed)
+       {
+               currentPath = FolderNavigationPresentationModel::GetCurrentPath();
+               if (state == unmounted)
+               {
+                       if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
+                       {
+                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
+                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
+                               setMediaPath = true;
+                       }
+               }
+
+               if (state == removed)
+               {
+                       if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
+                       {
+                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
+                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
+                               setMediaPath = true;
+                       }
+               }
+
+               if (setMediaPath)
+               {
+                       if (pSceneManager != null)
+                       {
+                               pSceneList = pSceneManager->GetSceneHistoryN();
+                       }
+
+                       if (pSceneList != null)
+                       {
+                               itemCount = pSceneList->GetCount() - 1;
+                               pSceneList->GetAt(itemCount, searchScene);
+                               while (searchScene != IDSCN_SEARCH_FORM && itemCount >= 0)
+                               {
+                                       itemCount--;
+                                       pSceneList->GetAt(itemCount, searchScene);
+                               }
+                       }
+
+                       if (searchScene == IDSCN_SEARCH_FORM)
+                       {
+                               AppLogDebug("Search scene present");
+                               searchHistoryStatus = true;
+                       }
+                       else
+                       {
+                               AppLogDebug("Search scene not present");
+                               searchHistoryStatus = false;
+                       }
+
+                       if(pSceneList)
+                       {
+                               pSceneList->RemoveAll();
+                               delete pSceneList;
+                               pSceneList = null;
+                       }
+
+                       if (searchHistoryStatus == true)
+                       {
+                               if (pSceneManager != null)
+                               {
+                                       pSceneManager->DestroyScene(IDSCN_SEARCH_FORM);
+                                       pSceneManager->ClearSceneHistory();
+                               }
+                       }
+
+                       if (pSceneManager != null)
+                       {
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+                       }
+               }
+       }
+}
+
+void
+DetailsForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
+{
+       AppLogDebug("DetailsForm::OnDeviceStateChanged");
+
+       ComponentType currentDeviceType;
+       switch (deviceType)
+       {
+       case StorageCard:
+       {
+               currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
+       }
+       break;
+
+       case UsbClient:
+       {
+               currentDeviceType = COMPONENT_TYPE_USB;
+       }
+       break;
+
+       default:
+       {
+               //Do Nothing.
+       }
+       break;
+       }
+       OnDeviceChange(currentDeviceType, state);
+}
index 1e96cf1..c7d3b09 100644 (file)
@@ -397,7 +397,7 @@ FileManageWorkerThread::DeleteFolderEntry(void)
        ArrayList* pDeletedFolderEntry = null;
        int count = 0;
 
-       TryCatch(__pListOfFiles!=null ,r= E_FAILURE,"Checked map is null");
+/*     TryCatch(__pListOfFiles!=null ,r= E_FAILURE,"Checked map is null");*/
        pMapEnum = __pListOfFiles->GetMapEnumeratorN();
 
        pDeletedFolderEntry = new (std::nothrow) ArrayList();
index a76c66c..0b648b3 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.0 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-\r
-/**\r
- * @file: MfMyFilesApp.cpp\r
- * @brief:  This file contains the declaration of MyFilesApp Class,\r
- * which provides basic features necessary to define an UiApp.\r
- */\r
-\r
-#include <FSystem.h>\r
-#include <FUiScenes.h>\r
-\r
-#include "MfCustomAppControl.h"\r
-#include "MfFolderEntryPresentationModel.h"\r
-#include "MfFormFactory.h"\r
-#include "MfMainFrame.h"\r
-#include "MfMyFilesApp.h"\r
-#include "MfPanelFactory.h"\r
-#include "MfSceneRegister.h"\r
-\r
-\r
-using namespace Tizen::App;\r
-using namespace Tizen::Base;\r
-using namespace Tizen::Base::Collection;\r
-using namespace Tizen::Base::Utility;\r
-using namespace Tizen::System;\r
-using namespace Tizen::Ui;\r
-using namespace Tizen::Ui::Controls;\r
-using namespace Tizen::Ui::Scenes;\r
-\r
-MyFilesApp::MyFilesApp(void)\r
-       : __pResultList(null)\r
-       , __pCurrentListToUpdate(null)\r
-       , __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
-       __currentSelectionMode = SELECTION_MODE_SINGE;\r
-       __currentView = APPCONTROL_VIEW_DEFAULT;\r
-       __currentExportFileType = EXPORT_TYPE_CONTACTS;\r
-       __bImgAppControlLaunched = true;\r
-       __currentAppControlResult = APP_CTRL_RESULT_FAILED;\r
-}\r
-\r
-MyFilesApp::~MyFilesApp(void)\r
-{\r
-       // Do Nothing\r
-}\r
-\r
-UiApp*\r
-MyFilesApp::CreateInstance(void)\r
-{\r
-       // Create the instance through the constructor.\r
-\r
-       return new (std::nothrow) MyFilesApp();\r
-}\r
-\r
-bool\r
-MyFilesApp::OnAppInitializing(AppRegistry& appRegistry)\r
-{\r
-       result r = E_SUCCESS;\r
-\r
-       InitializeListeners();\r
-       r = AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);\r
-       //r = AppControlProviderManager::GetInstance()->SendAppControlResult()\r
-       return true;\r
-}\r
-\r
-bool\r
-MyFilesApp::OnAppInitialized(void)\r
-{\r
-       result r = E_SUCCESS;\r
-\r
-       SceneManager* pSceneManager = null;\r
-       MfMainFrame* pMyFileMainFrame = null;\r
-       MessageBox messageBox;\r
-       String languageKey = L"http://tizen.org/setting/locale.language";\r
-\r
-       // Create a Frame\r
-       pMyFileMainFrame = new (std::nothrow) MfMainFrame();\r
-       TryCatch(pMyFileMainFrame != null, , "MainFrame pointer is null!");\r
-\r
-       r = pMyFileMainFrame->Construct();\r
-       TryCatch(r == E_SUCCESS, , "MainFrame creation failed!");\r
-\r
-       //pMyFileMainFrame->SetOperationIdAndInputSource(__operationId, __inputSource);\r
-       pMyFileMainFrame->SetName(L"MyFilesAppFrame");\r
-       AddFrame(*pMyFileMainFrame);\r
-\r
-       ThumbnailManager::GetInstance();\r
-\r
-       SceneRegister::RegisterAllScenes();\r
-       // Prepare Scene management.\r
-       pSceneManager = SceneManager::GetInstance();\r
-       TryCatch(pSceneManager != null, , "ScneManager is null!");\r
-\r
-       // Goto the scene.\r
-       if (pSceneManager != null)\r
-       {\r
-               if (__operationId.CompareTo("http://tizen.org/appcontrol/operation/pick") == 0)\r
-               {\r
-                       if (__currentView != APPCONTROL_VIEW_IMPORT)\r
-                       {\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_TOP_LEVEL_DIRECTORY_FORM), null);\r
-                       }\r
-\r
-#if 0\r
-                       else if (__currentView == APPCONTROL_VIEW_EXPORT)\r
-                       {\r
-                               if (__pResultList == null)\r
-                               {\r
-                                       __pResultList = new (std::nothrow) HashMap();\r
-                                       __pResultList->Construct();\r
-                               }\r
-                               ArrayList* pArgs = null;\r
-                               String currentFilePath;\r
-                               String headertitle;\r
-                               pArgs = new (std::nothrow) ArrayList();\r
-\r
-                               if (__currentExportFileType == EXPORT_TYPE_CALENDAR)\r
-                               {\r
-                                       currentFilePath = BasePresentationModel::GetMediaPath();\r
-                                       currentFilePath.Append("Backup/Calendar/");\r
-                                       headertitle.Append("Calendar");\r
-                               }\r
-                               if (__currentExportFileType == EXPORT_TYPE_CONTACTS)\r
-                               {\r
-                                       currentFilePath = BasePresentationModel::GetMediaPath();\r
-                                       currentFilePath.Append("Backup/Contacts/");\r
-                                       headertitle.Append("Contacts");\r
-                               }\r
-\r
-                               pArgs->Add(new String (headertitle));\r
-                               FolderNavigationPresentationModel::SetCurrentFilePath(currentFilePath);\r
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_FOLDER_SELECTION_FORM), pArgs);\r
-                       }\r
-                       else if (__currentView == APPCONTROL_VIEW_IMPORT)\r
-                       {\r
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM), null);\r
-                       }\r
-#endif\r
-               }\r
-               else\r
-               {\r
-                       //pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ROOT_DIRECTORY_FORM));\r
-                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM));\r
-                       __bAppControlMode = false;\r
-               }\r
-       }\r
-\r
-\r
-       //Setting Application setting change event listener.\r
-       SettingInfo::GetValue(languageKey, __currentDisplayLanguage);\r
-       SettingInfo::AddSettingEventListener(*this);\r
-       //Ends\r
-       return true;\r
-CATCH:\r
-       return false;           //Returning false changes app state to TERMINATING and app's OnAppTerminating function will be called.\r
-}\r
-\r
-void\r
-MyFilesApp::OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category,\r
-                                                                                const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-bool\r
-MyFilesApp::OnAppWillTerminate(void)\r
-{\r
-       return true;\r
-}\r
-\r
-bool\r
-MyFilesApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)\r
-{\r
-       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
-\r
-       if (__bAppControlEnabled == true)\r
-       {\r
-               if (__currentView == APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       if (__currentAppControlResult == APP_CTRL_RESULT_CANCELED)\r
-                       {\r
-                               if (__pResultList != null)\r
-                               {\r
-                                       __pResultList->RemoveAll(true);\r
-                                       delete __pResultList;\r
-                                       __pResultList = null;\r
-                               }\r
-                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, null);\r
-                       }\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(appcontroldataKey),pAppControlResultList);\r
-                               }\r
-                               AppLog("Result added is %S",resultList.GetPointer());\r
-                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, __pResultList);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       const HashMap* pResultHash = null;\r
-                       IMapEnumerator* pResultMapEnum = null;\r
-                       DirectoryEntry* pDirStr = null;\r
-\r
-               pResultHash = FolderEntryEditorPresentationModel::GetInstance()->GetCheckedList();\r
-\r
-                       if (__currentAppControlResult != APP_CTRL_RESULT_CANCELED)\r
-                       {\r
-                               if (pResultHash != null)\r
-                               {\r
-                                       pResultMapEnum = pResultHash->GetMapEnumeratorN();\r
-\r
-                                       if (pResultMapEnum != null)\r
-                                       {\r
-                                               pAppControlResultList = new (std::nothrow) ArrayList();\r
-                                               pAppControlResultList->Construct();\r
-\r
-                                               if (pResultHash->GetCount() != 0)\r
-                                               {\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
-                       }\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
-                               if (__pResultList != null)\r
-                               {\r
-                                       __pResultList->RemoveAll(true);\r
-                                       delete __pResultList;\r
-                                       __pResultList = null;\r
-                               }\r
-                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, null);\r
-                       }\r
-                       else\r
-                       {\r
-                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, __pResultList);\r
-                       }\r
-               }\r
-       }\r
-\r
-       //Following code stops FolderEntryEditor thread and thumbnail manager thread. Don't remove this code as it's must to gracefully terminate the spawned thread from main threads.\r
-       FolderEntryEditorPresentationModel::GetInstance()->StopFolderEntryEditorThread();\r
-       ThumbnailManager::GetInstance()->StopThumbnailManagerThread();\r
-\r
-       InitializeListeners();\r
-\r
-       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));\r
-       return true;\r
-}\r
-\r
-void\r
-MyFilesApp::OnForeground(void)\r
-{\r
-       // Start or resume drawing when the application is moved to the foreground.\r
-       Frame* pCurrentFrame = null;\r
-       CustomAppControl::GetInstance()->SetAppControlInUse(null);\r
-       pCurrentFrame =  Application::GetInstance()->GetAppFrame()->GetFrame();\r
-\r
-       if (pCurrentFrame != null)\r
-       {\r
-               pCurrentFrame->SetEnabled(true);\r
-       }\r
-\r
-       if (__pCurrentListToUpdate != null)\r
-       {\r
-       __pCurrentListToUpdate->OnAppControlCompleted();\r
-       }\r
-}\r
-\r
-void\r
-MyFilesApp::OnBackground(void)\r
-{\r
-       AppLogDebug("ENTER");\r
-       //Appcontrol Should not be terminated\r
-       /*if (__inputSource == APPCONTROL_STATE_SELECTED)\r
-       {\r
-               UiApp* pApp = UiApp::GetInstance();\r
-               if (pApp != null)\r
-               {\r
-                       pApp->Terminate();\r
-               }\r
-       }*/\r
-       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-void\r
-MyFilesApp::OnLowMemory(void)\r
-{\r
-       //Empty Implementation\r
-}\r
-\r
-void\r
-MyFilesApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)\r
-{\r
-       //Empty Implementation\r
-}\r
-\r
-void\r
-MyFilesApp::OnScreenOn(void)\r
-{\r
-       //Empty Implementation\r
-}\r
-\r
-void\r
-MyFilesApp::OnScreenOff(void)\r
-{\r
-       // Empty Implementation\r
-}\r
-void\r
-MyFilesApp::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)\r
-{\r
-       AppLogDebug("ENTER");\r
-       ThumbRequest* pCurrentThumbReq = null;\r
-\r
-       switch (requestId)\r
-       {\r
-       case THUMBNAIL_LAODED:\r
-       case THUMBNAIL_FAILED:\r
-       {\r
-               if (__pCurrentListToUpdate == null)\r
-               {\r
-                       if (pArgs != null)\r
-                       {\r
-                               pCurrentThumbReq = (ThumbRequest*) pArgs->GetAt(0);\r
-                               if (pCurrentThumbReq != null && pCurrentThumbReq->pBitmap != null)\r
-                                       delete pCurrentThumbReq->pBitmap;\r
-\r
-                               if (pArgs != null)\r
-                               {\r
-                                       pArgs->RemoveAll(true);\r
-                                       delete pArgs;\r
-                                       pArgs = null;\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if (pArgs != null)\r
-                       {\r
-                               pCurrentThumbReq = (ThumbRequest*) pArgs->GetAt(0);\r
-                               __pCurrentListToUpdate->OnThumbnailReceived(pCurrentThumbReq);\r
-\r
-                               if (pArgs != null)\r
-                               {\r
-                                       pArgs->RemoveAll(true);\r
-                                       delete pArgs;\r
-                                       pArgs = null;\r
-                               }\r
-                       }\r
-                       else\r
-                               __pCurrentListToUpdate->OnThumbnailReceived(null);\r
-               }\r
-       }\r
-       break;\r
-\r
-       case ID_COPY_COMPLETE:\r
-       case ID_FILE_RENAME_COMPLETE:\r
-       case ID_DELETE_COMPLETE:\r
-       case ID_MOVING_COMPLETE:\r
-       case ID_CREATE_FOLDER_COMPLETE:\r
-       case ID_FILE_MANAGING_FAILED:\r
-       case ID_FOLDER_SEARCH_STARTED:\r
-       case ID_SEARCH_COMPLETED:\r
-       case ID_SEARCH_RESULT_FOUND:\r
-       {\r
-               if (__pNotificationListener != null)\r
-               {\r
-                       __pNotificationListener->OnNotificationReceived((Tizen::Base::Collection::ArrayList*) pArgs);\r
-               }\r
-       }\r
-       break;\r
-\r
-       default:\r
-       {\r
-               //Empty Implementation.\r
-       }\r
-       break;\r
-       }\r
-\r
-       return;\r
-}\r
-\r
-void\r
-MyFilesApp::LaunchCacheManager(void)\r
-{\r
-       //Empty Implementation\r
-}\r
-\r
-void\r
-MyFilesApp::SetAppControlSelected(void)\r
-{\r
-       __bAppControlEnabled = true;\r
-}\r
-\r
-String\r
-MyFilesApp::ExtractType(Tizen::Base::String& inputType)\r
-{\r
-       AppLogDebug("ENTER");\r
-       String type = L"";\r
-       StringTokenizer strTok(inputType, L":");\r
-\r
-       while (strTok.HasMoreTokens())\r
-       {\r
-               type.Clear();\r
-               strTok.GetNextToken(type);\r
-       }\r
-       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));\r
-       return type;\r
-}\r
-\r
-void\r
-MyFilesApp::AddAppControlResult(Tizen::App::AppCtrlResult result)\r
-{\r
-       AppLogDebug("ENTER");\r
-       if (__pResultList != null)\r
-       {\r
-               //if (result.CompareTo(APPCONTROL_RESULT_CANCELED) == 0)\r
-               if (result == APP_CTRL_RESULT_CANCELED)\r
-               {\r
-                       FolderEntryEditorPresentationModel::GetInstance()->ClearCheckedList();\r
-               }\r
-               //__pResultList->Add(new (std::nothrow) String(result));\r
-               __currentAppControlResult = result;\r
-       }\r
-       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-SelectionMode\r
-MyFilesApp::GetCurrentSelectionMode(void)\r
-{\r
-       return __currentSelectionMode;\r
-}\r
-\r
-FileType\r
-MyFilesApp::GetCurrentFileType(void)\r
-{\r
-       return __currentFileType;\r
-}\r
-\r
-AppControlView\r
-MyFilesApp::GetCurrentView(void)\r
-{\r
-       return __currentView;\r
-}\r
-\r
-AppControlState\r
-MyFilesApp::GetCurrentState(void)\r
-{\r
-       return __inputSource;\r
-}\r
-\r
-ExportFileType\r
-MyFilesApp::GetCurrentExportFileType(void)\r
-{\r
-       return __currentExportFileType;\r
-}\r
-\r
-void\r
-MyFilesApp::SetNotifyListener(INotificationListener* listener)\r
-{\r
-       __pNotificationListener = listener;\r
-}\r
-\r
-void\r
-MyFilesApp::SetImageAppControlLanched(bool bAppControlLaunched)\r
-{\r
-       __bImgAppControlLaunched = bAppControlLaunched;\r
-}\r
-\r
-bool\r
-MyFilesApp::IsImageAppControlLanched(void)\r
-{\r
-       return __bImgAppControlLaunched;\r
-}\r
-\r
-result\r
-MyFilesApp::SetCurrentView(IListViewStateChangeListener* pListToUpdate)\r
-{\r
-       result res = E_SUCCESS;\r
-       __pCurrentListToUpdate = pListToUpdate;\r
-       return res;\r
-}\r
-\r
-IListViewStateChangeListener*\r
-MyFilesApp::GetCurrentViewToUpdate(void)\r
-{\r
-       return __pCurrentListToUpdate;\r
-}\r
-\r
-//End of changes\r
-void\r
-MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)\r
-{\r
-       __bAppControlEnabled = false;\r
-       __currentRequestId = reqId;\r
-       __operationId.Clear();\r
-       __operationId.Append(operationId);\r
-\r
-       if (operationId.CompareTo(L"http://tizen.org/appcontrol/operation/pick") == 0)\r
-       {\r
-\r
-               const String* inputSelectionType = null;\r
-               const String* inputFileType = null;\r
-\r
-               __bAppControlMode = true;\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"http://tizen.org/appcontrol/data/selection_mode")));\r
-               }\r
-\r
-               if (__pResultList == null)\r
-               {\r
-                       __pResultList = new (std::nothrow) HashMap();\r
-                       __pResultList->Construct();\r
-               }\r
-\r
-               __inputSource = APPCONTROL_STATE_SELECTED;\r
-\r
-               if (inputFileType != null)\r
-               {\r
-                       if (inputFileType->CompareTo("*/*") == 0)\r
-                       {\r
-                               __currentFileType = FILE_TYPE_ALL;\r
-                       }\r
-                       else if (inputFileType->CompareTo("image/*") == 0)\r
-                       {\r
-                               __currentFileType = FILE_TYPE_IMAGE_TYPE;\r
-                       }\r
-                       else if (inputFileType->CompareTo("audio/*") == 0)\r
-                       {\r
-                               __currentFileType = FILE_TYPE_AUDIO_TYPE;\r
-                       }\r
-                       else if (inputFileType->CompareTo("video/*") == 0)\r
-                       {\r
-                               __currentFileType = FILE_TYPE_VIDEO_TYPE;\r
-                       }\r
-                       else if (inputFileType->CompareTo("contacts") == 0)\r
-                       {\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
-                       __currentFileType = FILE_TYPE_ALL;\r
-               }\r
-\r
-               if (inputSelectionType != null)\r
-               {\r
-                       if (inputSelectionType->CompareTo("single") == 0)\r
-                       {\r
-                               __currentSelectionMode = SELECTION_MODE_SINGE;\r
-                       }\r
-                       else if (inputSelectionType->CompareTo("multiple") == 0)\r
-                       {\r
-                               __currentSelectionMode = SELECTION_MODE_MULTIPLE;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       __currentSelectionMode = SELECTION_MODE_SINGE;\r
-               }\r
-\r
-       }\r
-\r
-       if (__inputSource == APPCONTROL_STATE_SELECTED)\r
-       {\r
-               SceneManager* pSceneManager = null;\r
-               pSceneManager = SceneManager::GetInstance();\r
-\r
-               if (pSceneManager != null && __currentView != APPCONTROL_VIEW_IMPORT)\r
-               {\r
-                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM), null);\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
-               }\r
-               else if (pSceneManager != null && __currentView == APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_FOLDER_SELECTION_FORM), null);\r
-               }\r
-#endif\r
-       }\r
-\r
-}\r
-void\r
-MyFilesApp::InitializeListeners(void)\r
-{\r
-       __pCurrentListToUpdate = null;\r
-       __pNotificationListener = null;\r
-}\r
-void\r
-MyFilesApp::OnSettingChanged(Tizen::Base::String& key)\r
-{\r
-       String languageSettingKey = L"http://tizen.org/setting/locale.language";\r
-       String languageSelected;\r
-\r
-       AppLogDebug("SettingChanged++");\r
-       if ( key.CompareTo(languageSettingKey) == 0 )\r
-       {\r
-               SettingInfo::GetValue(languageSettingKey, languageSelected);\r
-\r
-               if ( __currentDisplayLanguage.CompareTo(languageSelected) !=0)\r
-               {\r
-                       Application::Terminate();\r
-               }\r
-       }\r
-       AppLogDebug("SettingChanged--");\r
-}\r
-bool\r
-MyFilesApp::IsAppControlMode(void)\r
-{\r
-       return __bAppControlMode;\r
-}\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file: MfMyFilesApp.cpp
+ * @brief:  This file contains the declaration of MyFilesApp Class,
+ * which provides basic features necessary to define an UiApp.
+ */
+
+#include <FSystem.h>
+#include <FUiScenes.h>
+
+#include "MfCustomAppControl.h"
+#include "MfFolderEntryPresentationModel.h"
+#include "MfFormFactory.h"
+#include "MfMainFrame.h"
+#include "MfMyFilesApp.h"
+#include "MfPanelFactory.h"
+#include "MfSceneRegister.h"
+
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+MyFilesApp::MyFilesApp(void)
+       : __pResultList(null)
+       , __pCurrentListToUpdate(null)
+       , __pNotificationListener(null)
+{
+       __operationId.Append(L"");
+       __mimeType.Append(L"");
+       __bAppControlEnabled = false;
+       __inputSource = APPCONTROL_STATE_MAINVIEW_SELECTED;
+       __currentFileType = FILE_TYPE_ALL;
+       __currentSelectionMode = SELECTION_MODE_SINGE;
+       __currentView = APPCONTROL_VIEW_DEFAULT;
+       __currentExportFileType = EXPORT_TYPE_CONTACTS;
+       __bImgAppControlLaunched = true;
+       __currentAppControlResult = APP_CTRL_RESULT_FAILED;
+}
+
+MyFilesApp::~MyFilesApp(void)
+{
+       // Do Nothing
+}
+
+UiApp*
+MyFilesApp::CreateInstance(void)
+{
+       // Create the instance through the constructor.
+
+       return new (std::nothrow) MyFilesApp();
+}
+
+bool
+MyFilesApp::OnAppInitializing(AppRegistry& appRegistry)
+{
+       result r = E_SUCCESS;
+
+       InitializeListeners();
+       r = AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);
+       //r = AppControlProviderManager::GetInstance()->SendAppControlResult()
+       return true;
+}
+
+bool
+MyFilesApp::OnAppInitialized(void)
+{
+       result r = E_SUCCESS;
+
+       SceneManager* pSceneManager = null;
+       MfMainFrame* pMyFileMainFrame = null;
+       MessageBox messageBox;
+       String languageKey = L"http://tizen.org/setting/locale.language";
+
+       // Create a Frame
+       pMyFileMainFrame = new (std::nothrow) MfMainFrame();
+       TryCatch(pMyFileMainFrame != null, , "MainFrame pointer is null!");
+
+       r = pMyFileMainFrame->Construct();
+       TryCatch(r == E_SUCCESS, , "MainFrame creation failed!");
+
+       //pMyFileMainFrame->SetOperationIdAndInputSource(__operationId, __inputSource);
+       pMyFileMainFrame->SetName(L"MyFilesAppFrame");
+       AddFrame(*pMyFileMainFrame);
+
+       ThumbnailManager::GetInstance();
+
+       SceneRegister::RegisterAllScenes();
+       // Prepare Scene management.
+       pSceneManager = SceneManager::GetInstance();
+       TryCatch(pSceneManager != null, , "ScneManager is null!");
+
+       // Goto the scene.
+       if (pSceneManager != null)
+       {
+               if (__operationId.CompareTo("http://tizen.org/appcontrol/operation/pick") == 0)
+               {
+                       if (__currentView != APPCONTROL_VIEW_IMPORT)
+                       {
+                               __inputSource = APPCONTROL_STATE_SELECTED;
+                               /*IList* pArgs = new (std::nothrow) ArrayList();
+                               pArgs->Add(new (std::nothrow) Integer(APPCONTROL_STATE_SELECTED));*/
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM), null);
+                       }
+
+#if 0
+                       else if (__currentView == APPCONTROL_VIEW_EXPORT)
+                       {
+                               if (__pResultList == null)
+                               {
+                                       __pResultList = new (std::nothrow) HashMap();
+                                       __pResultList->Construct();
+                               }
+                               ArrayList* pArgs = null;
+                               String currentFilePath;
+                               String headertitle;
+                               pArgs = new (std::nothrow) ArrayList();
+
+                               if (__currentExportFileType == EXPORT_TYPE_CALENDAR)
+                               {
+                                       currentFilePath = BasePresentationModel::GetMediaPath();
+                                       currentFilePath.Append("Backup/Calendar/");
+                                       headertitle.Append("Calendar");
+                               }
+                               if (__currentExportFileType == EXPORT_TYPE_CONTACTS)
+                               {
+                                       currentFilePath = BasePresentationModel::GetMediaPath();
+                                       currentFilePath.Append("Backup/Contacts/");
+                                       headertitle.Append("Contacts");
+                               }
+
+                               pArgs->Add(new String (headertitle));
+                               FolderNavigationPresentationModel::SetCurrentFilePath(currentFilePath);
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_FOLDER_SELECTION_FORM), pArgs);
+                       }
+                       else if (__currentView == APPCONTROL_VIEW_IMPORT)
+                       {
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM), null);
+                       }
+#endif
+               }
+               else
+               {
+                       //pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ROOT_DIRECTORY_FORM));
+                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM));
+                       __bAppControlMode = false;
+               }
+       }
+
+
+       //Setting Application setting change event listener.
+       SettingInfo::GetValue(languageKey, __currentDisplayLanguage);
+       SettingInfo::AddSettingEventListener(*this);
+       //Ends
+       return true;
+CATCH:
+       return false;           //Returning false changes app state to TERMINATING and app's OnAppTerminating function will be called.
+}
+
+void
+MyFilesApp::OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category,
+                                                                                const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs)
+{
+       //Empty Implementation.
+}
+
+bool
+MyFilesApp::OnAppWillTerminate(void)
+{
+       return true;
+}
+
+bool
+MyFilesApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
+{
+       AppLogDebug("ENTER");
+       String resultList;
+       result r = E_SUCCESS;
+       ArrayList* pAppControlResultList = null;
+
+       // Deallocate resources allocated by this App for termination.
+       // The App's permanent data and context can be saved via appRegistry.
+
+       if (__bAppControlEnabled == true)
+       {
+               if (__currentView == APPCONTROL_VIEW_EXPORT)
+               {
+                       if (__currentAppControlResult == APP_CTRL_RESULT_CANCELED)
+                       {
+                               if (__pResultList != null)
+                               {
+                                       __pResultList->RemoveAll(true);
+                                       delete __pResultList;
+                                       __pResultList = null;
+                               }
+                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, null);
+                       }
+                       else
+                       {
+                               pAppControlResultList = new (std::nothrow) ArrayList();
+                               pAppControlResultList->Construct();
+                               resultList = FolderNavigationPresentationModel::GetCurrentPath();
+                               pAppControlResultList->Add(new (std::nothrow) String(resultList));
+                               if (__pResultList != null && resultList.CompareTo("") != 0)
+                               {
+                                       __pResultList->Add(new (std::nothrow) String(appcontroldataKey),pAppControlResultList);
+                               }
+                               AppLog("Result added is %S",resultList.GetPointer());
+                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, __pResultList);
+                       }
+               }
+               else
+               {
+                       const HashMap* pResultHash = null;
+                       IMapEnumerator* pResultMapEnum = null;
+                       DirectoryEntry* pDirStr = null;
+
+               pResultHash = FolderEntryEditorPresentationModel::GetInstance()->GetCheckedList();
+
+                       if (__currentAppControlResult != APP_CTRL_RESULT_CANCELED)
+                       {
+                               if (pResultHash != null)
+                               {
+                                       pResultMapEnum = pResultHash->GetMapEnumeratorN();
+
+                                       if (pResultMapEnum != null)
+                                       {
+                                               pAppControlResultList = new (std::nothrow) ArrayList();
+                                               pAppControlResultList->Construct();
+
+                                               if (pResultHash->GetCount() != 0)
+                                               {
+                                                       //__pResultList->Add(*new (std::nothrow) String(APPCONTROL_RESULT_SUCCEEDED));
+
+                                                       while (pResultMapEnum->MoveNext() == E_SUCCESS)
+                                                       {
+                                                               pDirStr = static_cast< DirectoryEntry* >(pResultMapEnum->GetValue());
+
+                                                               if (pDirStr != null)
+                                                               {
+                                                                       pAppControlResultList->Add(new (std::nothrow) String(pDirStr->GetFullFilePath()));
+                                                               }
+                                                       }
+                                               }
+                                               delete pResultMapEnum;
+                                       }
+                               }
+                       }
+
+                       if (__pResultList != null && __currentAppControlResult != APP_CTRL_RESULT_CANCELED)
+                       {
+                               //__pResultList->Add(new (std::nothrow) String(appcontrolKey), new (std::nothrow) String(resultList));
+                               __pResultList->Add(new (std::nothrow) String(appcontroldataKey), pAppControlResultList);
+                       }
+
+                       if (__currentAppControlResult == APP_CTRL_RESULT_CANCELED)
+                       {
+                               if (__pResultList != null)
+                               {
+                                       __pResultList->RemoveAll(true);
+                                       delete __pResultList;
+                                       __pResultList = null;
+                               }
+                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, null);
+                       }
+                       else
+                       {
+                               r = AppControlProviderManager::GetInstance()->SendAppControlResult(__currentRequestId, __currentAppControlResult, __pResultList);
+                       }
+               }
+       }
+
+       //Following code stops FolderEntryEditor thread and thumbnail manager thread. Don't remove this code as it's must to gracefully terminate the spawned thread from main threads.
+       FolderEntryEditorPresentationModel::GetInstance()->StopFolderEntryEditorThread();
+       ThumbnailManager::GetInstance()->StopThumbnailManagerThread();
+
+       InitializeListeners();
+
+       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
+       return true;
+}
+
+void
+MyFilesApp::OnForeground(void)
+{
+       // Start or resume drawing when the application is moved to the foreground.
+       Frame* pCurrentFrame = null;
+       CustomAppControl::GetInstance()->SetAppControlInUse(null);
+       pCurrentFrame =  Application::GetInstance()->GetAppFrame()->GetFrame();
+
+       if (pCurrentFrame != null)
+       {
+               pCurrentFrame->SetEnabled(true);
+       }
+
+       if (__pCurrentListToUpdate != null)
+       {
+       __pCurrentListToUpdate->OnAppControlCompleted();
+       }
+}
+
+void
+MyFilesApp::OnBackground(void)
+{
+       AppLogDebug("ENTER");
+       //Appcontrol Should not be terminated
+       /*if (__inputSource == APPCONTROL_STATE_SELECTED)
+       {
+               UiApp* pApp = UiApp::GetInstance();
+               if (pApp != null)
+               {
+                       pApp->Terminate();
+               }
+       }*/
+       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
+}
+
+void
+MyFilesApp::OnLowMemory(void)
+{
+       //Empty Implementation
+}
+
+void
+MyFilesApp::OnBatteryLevelChanged(BatteryLevel batteryLevel)
+{
+       //Empty Implementation
+}
+
+void
+MyFilesApp::OnScreenOn(void)
+{
+       //Empty Implementation
+}
+
+void
+MyFilesApp::OnScreenOff(void)
+{
+       // Empty Implementation
+}
+void
+MyFilesApp::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+       AppLogDebug("ENTER");
+       ThumbRequest* pCurrentThumbReq = null;
+
+       switch (requestId)
+       {
+       case THUMBNAIL_LAODED:
+       case THUMBNAIL_FAILED:
+       {
+               if (__pCurrentListToUpdate == null)
+               {
+                       if (pArgs != null)
+                       {
+                               pCurrentThumbReq = (ThumbRequest*) pArgs->GetAt(0);
+                               if (pCurrentThumbReq != null && pCurrentThumbReq->pBitmap != null)
+                                       delete pCurrentThumbReq->pBitmap;
+
+                               if (pArgs != null)
+                               {
+                                       pArgs->RemoveAll(true);
+                                       delete pArgs;
+                                       pArgs = null;
+                               }
+                       }
+               }
+               else
+               {
+                       if (pArgs != null)
+                       {
+                               pCurrentThumbReq = (ThumbRequest*) pArgs->GetAt(0);
+                               __pCurrentListToUpdate->OnThumbnailReceived(pCurrentThumbReq);
+
+                               if (pArgs != null)
+                               {
+                                       pArgs->RemoveAll(true);
+                                       delete pArgs;
+                                       pArgs = null;
+                               }
+                       }
+                       else
+                               __pCurrentListToUpdate->OnThumbnailReceived(null);
+               }
+       }
+       break;
+
+       case ID_COPY_COMPLETE:
+       case ID_FILE_RENAME_COMPLETE:
+       case ID_DELETE_COMPLETE:
+       case ID_MOVING_COMPLETE:
+       case ID_CREATE_FOLDER_COMPLETE:
+       case ID_FILE_MANAGING_FAILED:
+       case ID_FOLDER_SEARCH_STARTED:
+       case ID_SEARCH_COMPLETED:
+       case ID_SEARCH_RESULT_FOUND:
+       {
+               if (__pNotificationListener != null)
+               {
+                       __pNotificationListener->OnNotificationReceived((Tizen::Base::Collection::ArrayList*) pArgs);
+               }
+       }
+       break;
+
+       default:
+       {
+               //Empty Implementation.
+       }
+       break;
+       }
+
+       return;
+}
+
+void
+MyFilesApp::LaunchCacheManager(void)
+{
+       //Empty Implementation
+}
+
+void
+MyFilesApp::SetAppControlSelected(void)
+{
+       __bAppControlEnabled = true;
+}
+
+String
+MyFilesApp::ExtractType(Tizen::Base::String& inputType)
+{
+       AppLogDebug("ENTER");
+       String type = L"";
+       StringTokenizer strTok(inputType, L":");
+
+       while (strTok.HasMoreTokens())
+       {
+               type.Clear();
+               strTok.GetNextToken(type);
+       }
+       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
+       return type;
+}
+
+void
+MyFilesApp::AddAppControlResult(Tizen::App::AppCtrlResult result)
+{
+       AppLogDebug("ENTER");
+       if (__pResultList != null)
+       {
+               //if (result.CompareTo(APPCONTROL_RESULT_CANCELED) == 0)
+               if (result == APP_CTRL_RESULT_CANCELED)
+               {
+                       FolderEntryEditorPresentationModel::GetInstance()->ClearCheckedList();
+               }
+               //__pResultList->Add(new (std::nothrow) String(result));
+               __currentAppControlResult = result;
+       }
+       AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
+}
+
+SelectionMode
+MyFilesApp::GetCurrentSelectionMode(void)
+{
+       return __currentSelectionMode;
+}
+
+FileType
+MyFilesApp::GetCurrentFileType(void)
+{
+       return __currentFileType;
+}
+
+AppControlView
+MyFilesApp::GetCurrentView(void)
+{
+       return __currentView;
+}
+
+AppControlState
+MyFilesApp::GetCurrentState(void)
+{
+       return __inputSource;
+}
+
+ExportFileType
+MyFilesApp::GetCurrentExportFileType(void)
+{
+       return __currentExportFileType;
+}
+
+void
+MyFilesApp::SetNotifyListener(INotificationListener* listener)
+{
+       __pNotificationListener = listener;
+}
+
+void
+MyFilesApp::SetImageAppControlLanched(bool bAppControlLaunched)
+{
+       __bImgAppControlLaunched = bAppControlLaunched;
+}
+
+bool
+MyFilesApp::IsImageAppControlLanched(void)
+{
+       return __bImgAppControlLaunched;
+}
+
+result
+MyFilesApp::SetCurrentView(IListViewStateChangeListener* pListToUpdate)
+{
+       result res = E_SUCCESS;
+       __pCurrentListToUpdate = pListToUpdate;
+       return res;
+}
+
+IListViewStateChangeListener*
+MyFilesApp::GetCurrentViewToUpdate(void)
+{
+       return __pCurrentListToUpdate;
+}
+
+//End of changes
+void
+MyFilesApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       __bAppControlEnabled = false;
+       __currentRequestId = reqId;
+       __operationId.Clear();
+       __operationId.Append(operationId);
+
+       if (operationId.CompareTo(L"http://tizen.org/appcontrol/operation/pick") == 0)
+       {
+
+               const String* inputSelectionType = null;
+               const String* inputFileType = null;
+
+               __bAppControlMode = true;
+
+               if (pMimeType != null)
+               {
+                       inputFileType = pMimeType;
+                       __mimeType.Clear();
+                       __mimeType.Append(*pMimeType);
+               }
+
+               if (pExtraData != null)
+               {
+                       inputSelectionType = static_cast< const String* >(pExtraData->GetValue(String(L"http://tizen.org/appcontrol/data/selection_mode")));
+               }
+
+               if (__pResultList == null)
+               {
+                       __pResultList = new (std::nothrow) HashMap();
+                       __pResultList->Construct();
+               }
+
+               __inputSource = APPCONTROL_STATE_SELECTED;
+
+               if (inputFileType != null)
+               {
+                       if (inputFileType->CompareTo("*/*") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_ALL;
+                       }
+                       else if (inputFileType->CompareTo("image/*") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_IMAGE_TYPE;
+                       }
+                       else if (inputFileType->CompareTo("audio/*") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_AUDIO_TYPE;
+                       }
+                       else if (inputFileType->CompareTo("video/*") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_VIDEO_TYPE;
+                       }
+                       else if (inputFileType->CompareTo("contacts") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_CONTACTS_TYPE;
+                       }
+                       else if(inputFileType->CompareTo("inode/directory") == 0)
+                       {
+                               __currentFileType = FILE_TYPE_ALL;
+                               __currentView = APPCONTROL_VIEW_EXPORT;
+                       }
+                       else
+                       {
+                               __currentFileType = FILE_TYPE_ALL;
+                       }
+               }
+               else
+               {
+                       __currentFileType = FILE_TYPE_ALL;
+               }
+
+               if (inputSelectionType != null)
+               {
+                       if (inputSelectionType->CompareTo("single") == 0)
+                       {
+                               __currentSelectionMode = SELECTION_MODE_SINGE;
+                       }
+                       else if (inputSelectionType->CompareTo("multiple") == 0)
+                       {
+                               __currentSelectionMode = SELECTION_MODE_MULTIPLE;
+                       }
+               }
+               else
+               {
+                       __currentSelectionMode = SELECTION_MODE_SINGE;
+               }
+
+       }
+
+       if (__inputSource == APPCONTROL_STATE_SELECTED)
+       {
+               SceneManager* pSceneManager = null;
+               pSceneManager = SceneManager::GetInstance();
+
+               if (pSceneManager != null && __currentView != APPCONTROL_VIEW_IMPORT)
+               {
+                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM), null);
+                       //pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM));
+               }
+#if 0
+               else if (pSceneManager != null && __currentView == APPCONTROL_VIEW_IMPORT)
+               {
+                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_MOST_SELECTION_FORM), null);
+               }
+               else if (pSceneManager != null && __currentView == APPCONTROL_VIEW_EXPORT)
+               {
+                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_FOLDER_SELECTION_FORM), null);
+               }
+#endif
+       }
+
+}
+void
+MyFilesApp::InitializeListeners(void)
+{
+       __pCurrentListToUpdate = null;
+       __pNotificationListener = null;
+}
+void
+MyFilesApp::OnSettingChanged(Tizen::Base::String& key)
+{
+       String languageSettingKey = L"http://tizen.org/setting/locale.language";
+       String languageSelected;
+
+       AppLogDebug("SettingChanged++");
+       if ( key.CompareTo(languageSettingKey) == 0 )
+       {
+               SettingInfo::GetValue(languageSettingKey, languageSelected);
+
+               if ( __currentDisplayLanguage.CompareTo(languageSelected) !=0)
+               {
+                       Application::Terminate();
+               }
+       }
+       AppLogDebug("SettingChanged--");
+}
+bool
+MyFilesApp::IsAppControlMode(void)
+{
+       return __bAppControlMode;
+}
index d9aa95b..b8f2dc4 100644 (file)
@@ -72,7 +72,7 @@ SearchForm::SearchForm(void)
 
        __selectedItemIndexForRename = 0;
        __selectedItemIndexForDelete = 0;
-       __SelectedTab = MEMORY_TYPE_NONE;
+
        __previouFormTab = MEMORY_TYPE_NONE;
 
        __pCancelDeletion = null;
@@ -324,7 +324,9 @@ SearchForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
 
        ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
 
+       FolderNavigationPresentationModel::SetCurrentFilePath(__previousFormPath);
        DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+
 #if 0
        DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
 #endif
@@ -484,21 +486,7 @@ SearchForm::OnListViewItemStateChanged(ListView& listView, int index, int elemen
                        return;
                }
 
-               __searchedAllFolders = true;
-
-               __searchItemIndex = INVALID_LIST_INDEX;
-               //Free the content of  __pSearchedContentList and Delete the same before searching again
-               if (__pSearchedContentList != null)
-               {
-                       __pSearchedContentList->RemoveAll(true);
-               }
-
-               __pListView->UpdateList();
-               __pFolderLabel->SetText(L"");
-               __pSearchPopup->SetShowState(true);
-               __pSearchPopup->Show();
-               __pSearchBar->SetEnabled(false);
-
+               //Set CurrentSearchDirectory to topLevelPath and StartSearch
                if (__SelectedTab == MEMORY_TYPE_PHONE)
                {
                        topLevelPath = __pFolderEntryPM->GetMediaPath();
@@ -507,10 +495,8 @@ SearchForm::OnListViewItemStateChanged(ListView& listView, int index, int elemen
                {
                        topLevelPath = __pFolderEntryPM->GetSdCardPath();
                }
-
-               __pSearchModel->SetFolderToSearch(topLevelPath);
-               __pSearchModel->SetStringToSearch(__searchText);
-               __pSearchModel->Start();
+               __currentSearchDirectoryPath = topLevelPath;
+               StartSearch();
        }
        else
        {
@@ -1373,6 +1359,8 @@ SearchForm::LoadDetailForm(String& fullFilePath)
        ArrayList* pList = null;
        String* pFullFilePath = null;
 
+       FolderNavigationPresentationModel::SetCurrentFilePath(fullFilePath);
+
        pList = new (std::nothrow) ArrayList();
        TryCatch(pList != null, , "Failed to create pList");
 
@@ -1418,6 +1406,8 @@ SearchForm::LoadRenameForm(int index, DirectoryEntry* pDirectory)
 
        __selectedItemIndexForRename = index;
 
+       FolderNavigationPresentationModel::SetCurrentFilePath(pDirectory->GetFullFilePath());
+
        if (pDirectory->IsDirectory() == true && (__currentSearchDirectoryPath == pDirectory->GetFullFilePath()))
                __isCurrentDirectoryRenamed = true;
 
@@ -1628,14 +1618,23 @@ SearchForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tiz
 {
        AppLogDebug("SearchForm::OnDeviceStateChanged");
 
-       __pSearchBar->SetMode(__searchBarMode);
+       HideDeleteConfirmationPopup();
+       HideFileProgressingPopup();
 
-       if (__searchText.IsEmpty() == false)
-               StartSearch();
+       if (__SelectedTab == MEMORY_TYPE_NONE )
+       {
+               __pSearchBar->SetMode(__searchBarMode);
 
-       if (__pListView != null)
-               __pListView->UpdateList();
+               if (__searchText.IsEmpty() == false)
+                       StartSearch();
 
+               if (__pListView != null)
+                       __pListView->UpdateList();
+       }
+       else if (__SelectedTab == MEMORY_TYPE_SD_CARD )
+       {
+               SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+       }
 }
 
 
@@ -1646,7 +1645,6 @@ SearchForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previou
        SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
        __pSearchBar->SetMode(__searchBarMode);
 
-       FolderNavigationPresentationModel::SetCurrentFilePath(__previousFormPath);
        if (__pFileEventManager != null)
        {
                delete __pFileEventManager;
@@ -1690,6 +1688,7 @@ SearchForm::StartSearch(void)
        __pSearchBar->HideKeypad();
        __pSearchBar->SetContentAreaVisible(true);
        __pSearchBar->SetEnabled(false);
+       __pSearchBar->SetMode(__searchBarMode);
 
        //Show Popup
        __pFolderLabel->SetText(folderToSearch);
@@ -1701,12 +1700,10 @@ SearchForm::StartSearch(void)
 
        if (__SelectedTab == MEMORY_TYPE_PHONE)
        {
-               //topLevelPath = folderEntryPM.GetMediaPath();
                topLevelPath = __pFolderEntryPM->GetMediaPath();
        }
        else if (__SelectedTab == MEMORY_TYPE_SD_CARD)
        {
-               //topLevelPath = folderEntryPM.GetSdCardPath();
                topLevelPath = __pFolderEntryPM->GetSdCardPath();
        }
 
@@ -1745,11 +1742,7 @@ SearchForm::GetFolderName(void)
        String delim(L"/");
        String token;
        String fullPath;
-       String folderName;
-
-       String finalGuideText;
-
-       AppResource::GetInstance()->GetString(L"IDS_MF_SK3_SEARCH", finalGuideText);
+       String folderName(L"Search ");
 
        fullPath = FolderNavigationPresentationModel::GetCurrentPath();
 
@@ -1773,17 +1766,14 @@ SearchForm::GetFolderName(void)
                }
                else
                {
-                       tokenizer.GetNextToken(folderName);
-                       //folderName.Append(token);
+                       tokenizer.GetNextToken(token);
+                       folderName.Append(token);
                }
        }
 
-       finalGuideText.Append(L" ");
-       finalGuideText.Append(folderName);
-
        if (__pSearchBar != null)
        {
-               __pSearchBar->SetGuideText(finalGuideText);
+               __pSearchBar->SetGuideText(folderName);
        }
 }
 
index cda4e90..e788cc7 100644 (file)
@@ -401,22 +401,13 @@ SubBaseFolderEntryForm::LoadRenameForm(int index)
 void
 SubBaseFolderEntryForm::LoadSearchForm(void)
 {
-       ArrayList* pTopLevelDirectoryList = new (std::nothrow) ArrayList();
-
-       //String* pDirectoryPath = null;
-       //String* pTabSelected = null;
+       ArrayList* pTopLevelDirectoryList = null;
        ArrayList* pFilepathList = null;
        SceneManager* pSceneManager = null;
 
-       //pDirectoryPath = new (std::nothrow) String();
-       //pDirectoryPath->Append(FolderNavigationPresentationModel::GetCurrentPath());
-
-       //pTabSelected = new (std::nothrow) String();
-       //pTabSelected->Append(tabSelected);
-
+       pTopLevelDirectoryList= new (std::nothrow) ArrayList();
        if (pTopLevelDirectoryList != null && _pFilenames != null)
        {
-               //pTopLevelDirectoryList->Add(*pDirectoryPath);
                pFilepathList = new (std::nothrow) ArrayList();
                if (pFilepathList != null)
                {
@@ -424,7 +415,6 @@ SubBaseFolderEntryForm::LoadSearchForm(void)
                        pFilepathList->AddItems(*_pFilenames);
                        pTopLevelDirectoryList->Add(pFilepathList);
                }
-               //pTopLevelDirectoryList->Add(*pTabSelected);
        }
 
        TryCatch(pTopLevelDirectoryList != null, , "failed to Get SceneManager instance");
@@ -432,23 +422,12 @@ SubBaseFolderEntryForm::LoadSearchForm(void)
        pSceneManager = SceneManager::GetInstance();
        TryCatch(pSceneManager != null, , "failed to Get SceneManager instance");
 
-       //pSceneManager->GoForward(SCENE_SEARCH_FORM, pTopLevelDirectoryList, SCENE_TRANSITION_ANIMATION_TYPE_LEFT);
        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pTopLevelDirectoryList);
 
        return;
-       CATCH:
+CATCH:
 
-       /*if (pDirectoryPath != null)
-       {
-           delete pDirectoryPath;
-           pDirectoryPath = null;
-       }
 
-       if (pTabSelected != null)
-       {
-           delete pTabSelected;
-           pTabSelected = null;
-       }*/
        if (pFilepathList != null)
        {
                delete pFilepathList;
@@ -2151,14 +2130,14 @@ SubBaseFolderEntryForm::SetFooterVisibility(int mode)
 
        if (mode == DISABLE_FOOTER_ITEM)
        {
-               if (folderCount ==0 )
+               if (folderCount ==0 && fileCount == 0)
                        _pFooter->SetItemEnabled(0, false);
-               if (fileCount ==0 )
+               if (fileCount == 0 )
                        _pFooter->SetItemEnabled(1, false);
        }
        else
        {
-               if(folderCount!=0)
+               if(folderCount!=0 || fileCount!=0)
                        _pFooter->SetItemEnabled(0, true);
                if (fileCount!=0)
                        _pFooter->SetItemEnabled(1, true);
index 9add3eb..a3825c9 100644 (file)
@@ -47,6 +47,7 @@ SubFolderFileListForm::SubFolderFileListForm(void)
 
 SubFolderFileListForm::~SubFolderFileListForm(void)
 {
+       DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD,*this);
        if (__pHomeButton != null)
        {
                delete __pHomeButton;
index 8c12277..d2eb61f 100644 (file)
@@ -468,6 +468,7 @@ TopLevelFolderFileListForm::OnActionPerformed(const Tizen::Ui::Control& source,
 
        case IDA_CONTEXT_MENU_BTN_SEARCH:
        {
+               FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_NONE);
                LoadSearchForm();
        }
        break;