NABI_SE issues resolved
authorchitta.rs <chitta.rs@samsung.com>
Fri, 3 May 2013 11:36:58 +0000 (17:06 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Fri, 3 May 2013 11:36:58 +0000 (17:06 +0530)
Change-Id: Ic3bc8ef0ef0a31554f0568ba77889db869c78bd1

inc/MfMyFilesApp.h
inc/MfSubBaseSelectionForm.h
inc/MfSubFolderSelection.h
src/MfCategorySearch.cpp
src/MfSubBaseSelectionForm.cpp
src/MfSubFolderFileListForm.cpp
src/MfSubFolderSelection.cpp
src/MfTopMostFileSelectionForm.cpp

index 20a20ee..7acbeba 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (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.h\r
- * @brief:  This file contains the declaration of MyFilesApp Class, which provides basic features necessary to define an UiApp.\r
- */\r
-\r
-#ifndef _MY_FILES_H_\r
-#define _MY_FILES_H_\r
-\r
-#include <FApp.h>\r
-#include <FBase.h>\r
-#include <FMedia.h>\r
-#include <FSystem.h>\r
-#include <FUi.h>\r
-\r
-#include "MfIListViewStateChangeListener.h"\r
-#include "MfIAudioNotificationListener.h"\r
-#include "MfINotificationListener.h"\r
-#include "MfFolderEntryEditorPresentationModel.h"\r
-#include "MfTypes.h"\r
-\r
-class MyFilesApp\r
-       : public Tizen::App::IAppControlProviderEventListener\r
-       , public Tizen::App::UiApp\r
-       , public Tizen::System::IScreenEventListener\r
-       , public Tizen::System::ISettingEventListener\r
-{\r
-public:\r
-       //! Constructor of the class.\r
-       /*!@fn MyFilesApp()\r
-        * @brief A public member taking no arguments which initializes the member variables of the class.\r
-        * @param Takes no parameters\r
-        * @return No value returned */\r
-       MyFilesApp(void);\r
-\r
-       //! Destructor of the class.\r
-       /*!@fn ~MyFilesApp()\r
-        * @brief A public virtual member taking no arguments, frees the memory allocated to the member variables.\r
-        * @param Takes no parameters\r
-        * @return No value returned\r
-        * */\r
-       virtual ~MyFilesApp(void);\r
-\r
-public:\r
-       void AddAppControlResult(Tizen::App::AppCtrlResult result);\r
-\r
-       Tizen::Base::String ExtractType(Tizen::Base::String& inputType);\r
-\r
-       FileType GetCurrentFileType(void);\r
-\r
-       MyFilesApp* GetCurrentInstance(void);\r
-\r
-       SelectionMode GetCurrentSelectionMode(void);\r
-\r
-       AppControlView GetCurrentView(void);\r
-\r
-       AppControlState GetCurrentState(void);\r
-\r
-       ExportFileType GetCurrentExportFileType(void);\r
-\r
-       IListViewStateChangeListener* GetCurrentViewToUpdate(void);\r
-\r
-       bool IsImageAppControlLanched(void);\r
-\r
-       void LaunchCacheManager(void);\r
-\r
-       void SetAppControlSelected(void);\r
-\r
-       result SetCurrentView(IListViewStateChangeListener* pListToUpdate);\r
-\r
-       void SetImageAppControlLanched(bool bAppControlLaunched);\r
-\r
-       void SetNotifyListener(INotificationListener* listener);\r
-\r
-       // Called when the UiApp is initializing.\r
-       bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);\r
-\r
-       // Called when the UiApp initializing is finished.\r
-       bool OnAppInitialized(void);\r
-\r
-       // Called when the UiApp is requested to terminate.\r
-       bool OnAppWillTerminate(void);\r
-\r
-       // Called when the UiApp is terminating.\r
-       bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);\r
-\r
-       // Called when the UiApp's frame moves to the top of the screen.\r
-       void OnForeground(void);\r
-\r
-       // Called when this UiApp's frame is moved from top of the screen to the background.\r
-       void OnBackground(void);\r
-\r
-       // Called when the system memory is not sufficient to run the UiApp any further.\r
-       void OnLowMemory(void);\r
-\r
-       // Called when the battery level changes.\r
-       void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);\r
-\r
-       // Called when the screen turns on.\r
-       void OnScreenOn(void);\r
-\r
-       // Called when the screen turns off.\r
-       void OnScreenOff(void);\r
-\r
-       virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);\r
-\r
-       virtual void 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);\r
-\r
-       virtual void 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
-       virtual void OnSettingChanged(Tizen::Base::String& key) ;\r
-       void InitializeListeners(void);\r
-       bool IsAppControlMode(void);\r
-       void SetAudioNotificationListener(IAudioNotificationListener* listener);\r
-\r
-public:\r
-       /**\r
-        * [Test] UiApp must have a factory method that creates an instance of itself.\r
-        */\r
-       static Tizen::App::UiApp* CreateInstance(void);\r
-\r
-private:\r
-       bool __bAppControlEnabled;\r
-       bool __bImgAppControlLaunched;\r
-\r
-       bool __bAppControlMode;\r
-       Tizen::Base::String     __currentDisplayLanguage;\r
-\r
-       RequestId __currentRequestId;\r
-       Tizen::App::AppCtrlResult __currentAppControlResult;\r
-\r
-       Tizen::Base::Collection::HashMap* __pResultList;\r
-       Tizen::Base::String __operationId;\r
-       Tizen::Base::String __mimeType;\r
-\r
-       IListViewStateChangeListener* __pCurrentListToUpdate;\r
-       INotificationListener* __pNotificationListener;\r
-       IAudioNotificationListener* __pAudioNotificationListener;\r
-\r
-       AppControlState __inputSource;\r
-       AppControlView __currentView;\r
-\r
-       FileType __currentFileType;\r
-       SelectionMode __currentSelectionMode;\r
-       ExportFileType __currentExportFileType;\r
-};\r
-\r
-#endif //_MY_FILES_H_\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     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.h
+ * @brief:  This file contains the declaration of MyFilesApp Class, which provides basic features necessary to define an UiApp.
+ */
+
+#ifndef _MY_FILES_H_
+#define _MY_FILES_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FMedia.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+#include "MfIListViewStateChangeListener.h"
+#include "MfIAudioNotificationListener.h"
+#include "MfINotificationListener.h"
+#include "MfFolderEntryEditorPresentationModel.h"
+#include "MfTypes.h"
+
+class MyFilesApp
+       : public Tizen::App::IAppControlProviderEventListener
+       , public Tizen::App::UiApp
+       , public Tizen::System::IScreenEventListener
+       , public Tizen::System::ISettingEventListener
+{
+public:
+       //! Constructor of the class.
+       /*!@fn MyFilesApp()
+        * @brief A public member taking no arguments which initializes the member variables of the class.
+        * @param Takes no parameters
+        * @return No value returned */
+       MyFilesApp(void);
+
+       //! Destructor of the class.
+       /*!@fn ~MyFilesApp()
+        * @brief A public virtual member taking no arguments, frees the memory allocated to the member variables.
+        * @param Takes no parameters
+        * @return No value returned
+        * */
+       virtual ~MyFilesApp(void);
+
+public:
+       void AddAppControlResult(Tizen::App::AppCtrlResult result);
+
+       Tizen::Base::String ExtractType(Tizen::Base::String& inputType);
+
+       FileType GetCurrentFileType(void);
+
+       MyFilesApp* GetCurrentInstance(void);
+
+       SelectionMode GetCurrentSelectionMode(void);
+
+       AppControlView GetCurrentView(void);
+
+       AppControlState GetCurrentState(void);
+
+       ExportFileType GetCurrentExportFileType(void);
+
+       IListViewStateChangeListener* GetCurrentViewToUpdate(void);
+
+       bool IsImageAppControlLanched(void);
+
+       void LaunchCacheManager(void);
+
+       void SetAppControlSelected(void);
+
+       result SetCurrentView(IListViewStateChangeListener* pListToUpdate);
+
+       void SetImageAppControlLanched(bool bAppControlLaunched);
+
+       void SetNotifyListener(INotificationListener* listener);
+
+       // Called when the UiApp is initializing.
+       bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
+
+       // Called when the UiApp initializing is finished.
+       bool OnAppInitialized(void);
+
+       // Called when the UiApp is requested to terminate.
+       bool OnAppWillTerminate(void);
+
+       // Called when the UiApp is terminating.
+       bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
+
+       // Called when the UiApp's frame moves to the top of the screen.
+       void OnForeground(void);
+
+       // Called when this UiApp's frame is moved from top of the screen to the background.
+       void OnBackground(void);
+
+       // Called when the system memory is not sufficient to run the UiApp any further.
+       void OnLowMemory(void);
+
+       // Called when the battery level changes.
+       void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
+
+       // Called when the screen turns on.
+       void OnScreenOn(void);
+
+       // Called when the screen turns off.
+       void OnScreenOff(void);
+
+       virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+
+       virtual void 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);
+
+       virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData);
+
+       virtual void OnSettingChanged(Tizen::Base::String& key) ;
+       void InitializeListeners(void);
+       bool IsAppControlMode(void);
+       void SetAudioNotificationListener(IAudioNotificationListener* listener);
+
+public:
+       /**
+        * [Test] UiApp must have a factory method that creates an instance of itself.
+        */
+       static Tizen::App::UiApp* CreateInstance(void);
+
+private:
+       bool __bAppControlEnabled;
+       bool __bImgAppControlLaunched;
+
+       bool __bAppControlMode;
+       Tizen::Base::String     __currentDisplayLanguage;
+
+       RequestId __currentRequestId;
+       Tizen::App::AppCtrlResult __currentAppControlResult;
+
+       Tizen::Base::Collection::HashMap* __pResultList;
+       Tizen::Base::String __operationId;
+       Tizen::Base::String __mimeType;
+
+       IListViewStateChangeListener* __pCurrentListToUpdate;
+       INotificationListener* __pNotificationListener;
+       IAudioNotificationListener* __pAudioNotificationListener;
+
+       AppControlState __inputSource;
+       AppControlView __currentView;
+
+       FileType __currentFileType;
+       SelectionMode __currentSelectionMode;
+       ExportFileType __currentExportFileType;
+};
+
+#endif //_MY_FILES_H_
index cb90ab0..3c5cbdc 100644 (file)
@@ -24,6 +24,7 @@
 #define _MF_SUB_BASE_SELECTION_FORM\r
 \r
 #include <FMedia.h>\r
+#include <FTelephony.h>\r
 \r
 #include "MfBaseForm.h"\r
 #include "MfContentListItem.h"\r
@@ -32,6 +33,7 @@
 class SubBaseSelection\r
        : public BaseForm\r
        , public Tizen::Media::IPlayerEventListener\r
+       , public Tizen::Telephony::ITelephonyCallEventListener\r
 {\r
 public:\r
        //! Constructor of the class.\r
@@ -72,6 +74,9 @@ public:
 \r
        virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);\r
 \r
+       //ITelephonyCallEventListener\r
+       virtual void OnTelephonyCallStatusChangedN(Tizen::Telephony::CallStatus callStatus, Tizen::Telephony::CallInfo * pCallInfo);\r
+\r
        //IListViewItemProvider\r
        virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);\r
        virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);\r
@@ -222,7 +227,9 @@ protected:
        FolderEntryEditorPresentationModel* _pFileManager;\r
        FolderEntryPresentationModel* _pFolderEntryPM;\r
        ThumbnailManager* _pThumbnailManager;\r
-       Tizen::Graphics::Rectangle __defaultListViewBounds;\r
+       Tizen::Graphics::Rectangle _defaultListViewBounds;\r
+\r
+        Tizen::Telephony::CallManager* _pCallManager;\r
 };\r
 \r
 #endif\r
index 9351154..e171903 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (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: MfSubFolderSelection.h\r
- * @brief: This file contains the declaration of SubFolderSelection class,\r
- *  which acts an AppControl for the SubDirectories.\r
- */\r
-\r
-#ifndef _MF_SUB_FOLDER_FILE_SELECTION_H_\r
-#define _MF_SUB_FOLDER_FILE_SELECTION_H_\r
-\r
-#include "MfSubBaseSelectionForm.h"\r
-#include "MfIAudioNotificationListener.h"\r
-\r
-class SubFolderSelection\r
-       : public SubBaseSelection\r
-       , public Tizen::Io::IFileEventListener\r
-       , public Tizen::Ui::IDataBindingListener\r
-       , public IAudioNotificationListener\r
-{\r
-public:\r
-       //Default constructor for the class\r
-       /*!\r
-        * @fn FileListSelectionForm()\r
-        * @param Takes no parameters\r
-        * @return No value returned\r
-        */\r
-       SubFolderSelection(void);\r
-\r
-       //Default Destructor for the class\r
-       /*!\r
-        * @fn ~FileListSelectionForm()\r
-        * @param Takes no parameters\r
-        * @return No value returned\r
-        */\r
-       virtual ~SubFolderSelection(void);\r
-\r
-       /*!\r
-        * @fn Initialize()\r
-        * @param Takes no parameters\r
-        * @return bool value\r
-        */\r
-       bool Initialize(void);\r
-\r
-       //Initialises all the members of the class\r
-       /*!\r
-        * @fn OnInitializing()\r
-        * @param Takes no parameters\r
-        * @return result value\r
-        */\r
-       result OnInitializing(void);\r
-\r
-       /*!\r
-        * @fn OnTerminating()\r
-        * @param Takes no parameters\r
-        * @return result value\r
-        */\r
-       result OnTerminating(void);\r
-\r
-       //IPlayerEventListener\r
-       virtual void OnPlayerEndOfClip(void);\r
-       virtual void OnPlayerAudioFocusChanged (void);\r
-\r
-       //IDeviceEventListener\r
-       virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);\r
-\r
-       //!IActionEventListener\r
-       /*! @fn OnActionPerformed(const Tizen::Ui::Control& source, int actionId)\r
-        * @brief   Called when an action event occurs on the source control.\r
-        */\r
-       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);\r
-\r
-       //IListViewItemEventListener\r
-       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);\r
-\r
-       virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);\r
-       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);\r
-       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);\r
-\r
-       //! IDataBindingEventListener\r
-       /*! @fn OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)\r
-        * @brief Called when the data transfer for source is completed by the data binding.\r
-        */\r
-       virtual void OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName\r
-                                                                                  , const Tizen::Base::String& propertyName);\r
-\r
-       /*! @fn OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)\r
-        * @brief  Called when the data transfer for target is completed by the data binding.\r
-        */\r
-       virtual void OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName\r
-                                                                                  , const Tizen::Base::String& propertyName);\r
-\r
-       /*! @fn OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)\r
-        * @brief Called when a validation has failed during data transfer.\r
-        */\r
-       virtual void OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName\r
-                                                                                         , const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType);\r
-\r
-       //! ISceneEventListener\r
-       /*! @fn OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)\r
-        * @brief  Called after setting as current scene.\r
-        */\r
-       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);\r
-\r
-       /*! @fn OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)\r
-        * @brief  Called when the current scene is deactivated.\r
-        */\r
-       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);\r
-\r
-       /*!IDeviceNotificationListener\r
-        * A public callback from the IDeviceNotificationListener taking deviceType and state as argument and returning nothing\r
-        * @fn OnDeviceChange\r
-        * @brief Used to handle device event changes. When memory card is inserted, removed then this method will be called\r
-        * @param ComponentType, String\r
-        * @return no return value\r
-        */\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
-       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
-\r
-       //IFileEventListener\r
-       virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId);\r
-\r
-       virtual void OnAudioNotificationReceived(void);\r
-\r
-private:\r
-       /*\r
-        * A private member function returning no arguments.\r
-        * @fn SetHeaderTitleText(Tizen::Base::String& fileName)\r
-        * @brief Called to set the title text of the header within the form.\r
-        * @param [String&] fileName, filename of the current Directory.\r
-        * @return Void return type\r
-        */\r
-       void SetHeaderTitleText(Tizen::Base::String& filePath);\r
-\r
-       /*\r
-        * A private member function taking and returning no arguments.\r
-        * @fn SetNextDisplayPath\r
-        * @brief Called OnListItemStateChanged to change the path displayed in the label.\r
-        * @param No parameters.\r
-        * @return Void return type.\r
-        */\r
-       void SetNextDisplayPath(void);\r
-\r
-       /*\r
-        * A private member function taking and returning no arguments.\r
-        * @fn SetParentDisplayPath\r
-        * @brief Called within ShowParentDirectoryView() to change the path displayed on the display label.\r
-        * @param No parameters.\r
-        * @return Void return type\r
-        */\r
-       void SetParentDisplayPath(void);\r
-\r
-       /*\r
-        * A private member function taking and returning no arguments.\r
-        * @fn ShowParentDirectoryView\r
-        * @brief Called during OnActionPerformed() on Up HeaderItem, refreshes the view to the\r
-        * list of files within the parent directory\r
-        * @param No parameters\r
-        * @return Void return type\r
-        */\r
-       void ShowParentDirectoryView(void);\r
-\r
-       // Copy Constructor of the class.\r
-       /*@fn SubFolderSelection(const SubFolderSelection&)\r
-        * @brief Copy Constructor\r
-        * @param Takes Reference of the class\r
-        * @return No value returned\r
-        * */\r
-       SubFolderSelection(const SubFolderSelection&);\r
-\r
-       // Assignment operator of the class.\r
-       /*@fn SubFolderSelection& operator = (const SubFolderSelection& pSubFolderSelection)\r
-        * @brief Assignment operator of the class.\r
-        * @param Takes Reference of the class\r
-        * @return No value returned\r
-        * */\r
-       SubFolderSelection& operator =(const SubFolderSelection& pSubFolderSelection);\r
-\r
-public:\r
-       Tizen::Base::String text;\r
-\r
-private:\r
-       static const int IDA_BTN_HOME = 200;\r
-       static const int IDA_BTN_UP = 201;\r
-\r
-       Tizen::Base::String __displayPath;\r
-       //Tizen::Base::String __currentDirectoryPath;\r
-       Tizen::Base::String __tabSelected;\r
-       Tizen::Base::String* __pReceivedFilename;\r
-\r
-       Tizen::Ui::Controls::ButtonItem* __pHomeButton;\r
-       Tizen::Ui::Controls::ButtonItem* __pUpButton;\r
-       Tizen::Ui::Controls::ContextMenu* __pMoreContextMenu;\r
-       Tizen::Ui::Controls::Label* __pLabelDisplayPath;\r
-\r
-       //FileEventManager\r
-       Tizen::Io::FileEventManager* __pFileEventManager;\r
-};\r
-\r
-#endif\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     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: MfSubFolderSelection.h
+ * @brief: This file contains the declaration of SubFolderSelection class,
+ *  which acts an AppControl for the SubDirectories.
+ */
+
+#ifndef _MF_SUB_FOLDER_FILE_SELECTION_H_
+#define _MF_SUB_FOLDER_FILE_SELECTION_H_
+
+#include "MfSubBaseSelectionForm.h"
+#include "MfIAudioNotificationListener.h"
+
+class SubFolderSelection
+       : public SubBaseSelection
+       , public Tizen::Io::IFileEventListener
+       , public Tizen::Ui::IDataBindingListener
+       , public IAudioNotificationListener
+{
+public:
+       //Default constructor for the class
+       /*!
+        * @fn FileListSelectionForm()
+        * @param Takes no parameters
+        * @return No value returned
+        */
+       SubFolderSelection(void);
+
+       //Default Destructor for the class
+       /*!
+        * @fn ~FileListSelectionForm()
+        * @param Takes no parameters
+        * @return No value returned
+        */
+       virtual ~SubFolderSelection(void);
+
+       /*!
+        * @fn Initialize()
+        * @param Takes no parameters
+        * @return bool value
+        */
+       bool Initialize(void);
+
+       //Initialises all the members of the class
+       /*!
+        * @fn OnInitializing()
+        * @param Takes no parameters
+        * @return result value
+        */
+       result OnInitializing(void);
+
+       /*!
+        * @fn OnTerminating()
+        * @param Takes no parameters
+        * @return result value
+        */
+       result OnTerminating(void);
+
+       //IPlayerEventListener
+       virtual void OnPlayerEndOfClip(void);
+       virtual void OnPlayerAudioFocusChanged (void);
+
+       //IDeviceEventListener
+       virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+
+       //!IActionEventListener
+       /*! @fn OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+        * @brief   Called when an action event occurs on the source control.
+        */
+       virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+       //IListViewItemEventListener
+       virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
+
+       virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
+       virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
+       virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
+
+       //! IDataBindingEventListener
+       /*! @fn OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
+        * @brief Called when the data transfer for source is completed by the data binding.
+        */
+       virtual void OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName
+                                                                                  , const Tizen::Base::String& propertyName);
+
+       /*! @fn OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
+        * @brief  Called when the data transfer for target is completed by the data binding.
+        */
+       virtual void OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName
+                                                                                  , const Tizen::Base::String& propertyName);
+
+       /*! @fn OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
+        * @brief Called when a validation has failed during data transfer.
+        */
+       virtual void OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName
+                                                                                         , const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType);
+
+       //! ISceneEventListener
+       /*! @fn OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+        * @brief  Called after setting as current scene.
+        */
+       virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
+
+       /*! @fn OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
+        * @brief  Called when the current scene is deactivated.
+        */
+       virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
+
+       /*!IDeviceNotificationListener
+        * A public callback from the IDeviceNotificationListener taking deviceType and state as argument and returning nothing
+        * @fn OnDeviceChange
+        * @brief Used to handle device event changes. When memory card is inserted, removed then this method will be called
+        * @param ComponentType, String
+        * @return no return value
+        */
+
+       //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);
+
+       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);
+
+       //IFileEventListener
+       virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId);
+
+       virtual void OnAudioNotificationReceived(void);
+
+private:
+       /*
+        * A private member function returning no arguments.
+        * @fn SetHeaderTitleText(Tizen::Base::String& fileName)
+        * @brief Called to set the title text of the header within the form.
+        * @param [String&] fileName, filename of the current Directory.
+        * @return Void return type
+        */
+       void SetHeaderTitleText(Tizen::Base::String& filePath);
+
+       /*
+        * A private member function taking and returning no arguments.
+        * @fn SetNextDisplayPath
+        * @brief Called OnListItemStateChanged to change the path displayed in the label.
+        * @param No parameters.
+        * @return Void return type.
+        */
+       void SetNextDisplayPath(void);
+
+       /*
+        * A private member function taking and returning no arguments.
+        * @fn SetParentDisplayPath
+        * @brief Called within ShowParentDirectoryView() to change the path displayed on the display label.
+        * @param No parameters.
+        * @return Void return type
+        */
+       void SetParentDisplayPath(void);
+
+       /*
+        * A private member function taking and returning no arguments.
+        * @fn ShowParentDirectoryView
+        * @brief Called during OnActionPerformed() on Up HeaderItem, refreshes the view to the
+        * list of files within the parent directory
+        * @param No parameters
+        * @return Void return type
+        */
+       void ShowParentDirectoryView(void);
+
+       // Copy Constructor of the class.
+       /*@fn SubFolderSelection(const SubFolderSelection&)
+        * @brief Copy Constructor
+        * @param Takes Reference of the class
+        * @return No value returned
+        * */
+       SubFolderSelection(const SubFolderSelection&);
+
+       // Assignment operator of the class.
+       /*@fn SubFolderSelection& operator = (const SubFolderSelection& pSubFolderSelection)
+        * @brief Assignment operator of the class.
+        * @param Takes Reference of the class
+        * @return No value returned
+        * */
+       SubFolderSelection& operator =(const SubFolderSelection& pSubFolderSelection);
+
+public:
+       Tizen::Base::String text;
+
+private:
+       static const int IDA_BTN_HOME = 200;
+       static const int IDA_BTN_UP = 201;
+
+       Tizen::Base::String __displayPath;
+       //Tizen::Base::String __currentDirectoryPath;
+       Tizen::Base::String __tabSelected;
+       Tizen::Base::String* __pReceivedFilename;
+
+       Tizen::Ui::Controls::ButtonItem* __pHomeButton;
+       Tizen::Ui::Controls::ButtonItem* __pUpButton;
+       Tizen::Ui::Controls::ContextMenu* __pMoreContextMenu;
+       Tizen::Ui::Controls::Label* __pLabelDisplayPath;
+
+       //FileEventManager
+       Tizen::Io::FileEventManager* __pFileEventManager;
+};
+
+#endif
index a7b5ba2..49d2fb9 100644 (file)
@@ -441,7 +441,7 @@ CategorySearch::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &pr
                        _bIsDirectoryEmpty = false;
 
                        SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
-
+                       _pLongPressGestureDetector->AddLongPressGestureEventListener(*this);
                        if (_pIconListView != null && _pIconListView->IsVisible())
                        {
                                _pIconListView->AddGestureDetector(*_pLongPressGestureDetector);
@@ -843,6 +843,7 @@ CategorySearch::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const
 void
 CategorySearch::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
 {
+       AppLogDebug("CategorySearch::OnDeviceChange");
        if (_pFolderEntryPM != null)
        {
                _pFolderEntryPM->CreateTraversalTree();
@@ -853,10 +854,12 @@ CategorySearch::OnDeviceChange(ComponentType deviceType, const Tizen::Base::Stri
        {
                if (_pFilenames->GetCount() == 0)
                {
+                       _bIsDirectoryEmpty = true;
                        SetFooterItemsVisibility(DISABLE_FOOTER_ITEM);
                }
                else
                {
+                       _bIsDirectoryEmpty = false;
                        SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
                }
        }
@@ -867,6 +870,12 @@ CategorySearch::OnDeviceChange(ComponentType deviceType, const Tizen::Base::Stri
                _pListView->Invalidate(true);
        }
 
+       if (_pIconListView != null && _pIconListView->IsVisible())
+       {
+               _pIconListView->UpdateList();
+               _pIconListView->Invalidate(true);
+       }
+
        if (_pFolderEntryPM != null)
        {
                _pFolderEntryPM->InitThumbnailManager();
index 17e951f..4879419 100644 (file)
@@ -34,6 +34,7 @@ using namespace Tizen::Io;
 using namespace Tizen::Locales;
 using namespace Tizen::Media;
 using namespace Tizen::System;
+using namespace Tizen::Telephony;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
@@ -58,6 +59,7 @@ SubBaseSelection::SubBaseSelection(void)
 , _pFileManager(null)
 , _pFolderEntryPM(null)
 , _pThumbnailManager(null)
+, _pCallManager(null)
 {
        //,_listAnnexStyle(null)
        _selectionMode = SELECTION_MODE_MULTIPLE;
@@ -70,16 +72,11 @@ SubBaseSelection::SubBaseSelection(void)
        _annexStyle = ANNEX_STYLE_NORMAL;
        _storageType = MEMORY_TYPE_PHONE;
        _currentAudioPlayIndex = -1;
-       __defaultListViewBounds = Rectangle(0,0,0,0);
+       _defaultListViewBounds = Rectangle(0,0,0,0);
 }
 
 SubBaseSelection::~SubBaseSelection(void)
 {
-/*     if (_pCancel != null)
-       {
-               delete _pCancel;
-       }*/
-
        if (_pAttach != null)
        {
                delete _pAttach;
@@ -134,6 +131,12 @@ SubBaseSelection::~SubBaseSelection(void)
        {
                delete _pDummyImage;
        }
+
+       if (_pCallManager != null)
+       {
+               delete _pCallManager;
+               _pCallManager = null;
+       }
 }
 
 SubBaseSelection&
@@ -249,7 +252,7 @@ SubBaseSelection::GetItemCount(void)
 
                                if (_selectionMode == SELECTION_MODE_MULTIPLE)
                                {
-                                       _pListView->SetSize(__defaultListViewBounds.width, __defaultListViewBounds.height);
+                                       _pListView->SetSize(_defaultListViewBounds.width, _defaultListViewBounds.height);
                                        _pListView->Invalidate(true);
                                }
                        }
@@ -263,7 +266,7 @@ SubBaseSelection::GetItemCount(void)
 
                        if (_selectionMode == SELECTION_MODE_MULTIPLE)
                        {
-                               _pListView->SetSize(__defaultListViewBounds.width, __defaultListViewBounds.height - _pLabelNumberOfItems->GetHeight());
+                               _pListView->SetSize(_defaultListViewBounds.width, _defaultListViewBounds.height - _pLabelNumberOfItems->GetHeight());
                                _pListView->Invalidate(true);
                        }
                        _itemSelectedCount.Clear();
@@ -298,6 +301,7 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
        String cacheImagePath;
 
        PlayerState audioPlayerStatus;
+       CallStatus callStatus;
        ContentType contentType = CONTENT_TYPE_UNKNOWN;
 
        ContentListItem* pCustomItem = null;
@@ -345,7 +349,6 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
                                                if (pFileDetails != null)
                                                {
                                                        cacheImagePath = pFileDetails->GetFullFilePath();
-                                                       AppLogDebug("cache path is %S",cacheImagePath.GetPointer());
                                                }
 
                                                if ((pCacheList->GetValue(cacheImagePath)) != null)
@@ -356,7 +359,6 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
 
                                        if (pFetchedCacheImage != null)
                                        {
-                                               AppLogDebug("image taken from cachemanager");
                                                pThumbnailImage = CacheManager::GetInstance()->GetCacheBitmapN(cacheImagePath);
                                                pCustomItem->SetThumbnail(pThumbnailImage);
                                        }
@@ -364,7 +366,6 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
                                        {
                                                pFileDetails->SetDummy(true);
                                                pCustomItem->SetThumbnail(_pDummyImage);
-                                               AppLogDebug("call to thumbnail manager");
                                        }
 
                                        //r = _pFolderEntryPM->InitThumbnailManager(index);
@@ -390,24 +391,36 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
                                        pCustomItem->SetListAnnexStyle(_annexStyle);
                                }
 
+
                                if (contentType == CONTENT_TYPE_AUDIO)
                                {
-                                       if (_pAudioPlayer != null)
+                                       callStatus = _pCallManager->GetCurrentCallStatus();
+                                       if (callStatus != CALL_STATUS_UNDEFINED && callStatus == CALL_STATUS_IDLE)
                                        {
-                                               audioPlayerStatus = _pAudioPlayer->GetState();
-
-                                               if (audioPlayerStatus == PLAYER_STATE_CLOSED)
+                                               InitializePlayer();
+                                               if (_pAudioPlayer != null)
                                                {
-                                                       pCustomItem->SetAudioBitmap(_pAudioPlay, null);
-                                               }
+                                                       audioPlayerStatus = _pAudioPlayer->GetState();
+                                                       AppLogDebug("SubBaseSelection::CreateDefaultContentItem:%d", audioPlayerStatus);
 
-                                               if (_currentAudioPlayIndex == index)
-                                               {
-                                                       if (audioPlayerStatus == PLAYER_STATE_PLAYING)
+
+                                                       if (audioPlayerStatus == PLAYER_STATE_CLOSED)
+                                                       {
+                                                               pCustomItem->SetAudioBitmap(_pAudioPlay, null);
+                                                       }
+
+                                                       if (_currentAudioPlayIndex == index)
                                                        {
-                                                               pCustomItem->SetAudioBitmap(null, _pAudioPause);
+                                                               if (audioPlayerStatus == PLAYER_STATE_PLAYING)
+                                                               {
+                                                                       pCustomItem->SetAudioBitmap(null, _pAudioPause);
+                                                               }
+                                                               //else if (audioPlayerStatus == PLAYER_STATE_PAUSED || audioPlayerStatus == PLAYER_STATE_ENDOFCLIP)
+                                                               else
+                                                               {
+                                                                       pCustomItem->SetAudioBitmap(_pAudioPlay, null);
+                                                               }
                                                        }
-                                                       //else if (audioPlayerStatus == PLAYER_STATE_PAUSED || audioPlayerStatus == PLAYER_STATE_ENDOFCLIP)
                                                        else
                                                        {
                                                                pCustomItem->SetAudioBitmap(_pAudioPlay, null);
@@ -417,10 +430,7 @@ SubBaseSelection::CreateDefaultContentItem(int index, int itemWidth)
                                                {
                                                        pCustomItem->SetAudioBitmap(_pAudioPlay, null);
                                                }
-                                       }
-                                       else
-                                       {
-                                               pCustomItem->SetAudioBitmap(_pAudioPlay, null);
+
                                        }
                                }
                        }
@@ -507,17 +517,22 @@ SubBaseSelection::OnListViewItemStateChangedNotify(ViewType viewType)
 void
 SubBaseSelection::InitializePlayer(void)
 {
-       _pAudioPlayer = new (std::nothrow) Player();
-
-       if (_pAudioPlayer != null)
+       AppLogDebug("SubFolderSelection::OnListViewItemStateChanged");
+       if (_pAudioPlayer == null)
        {
-               _pAudioPlayer->Construct(*this);
+               _pAudioPlayer = new (std::nothrow) Player();
+
+               if (_pAudioPlayer != null)
+               {
+                       _pAudioPlayer->Construct(*this);
+               }
        }
 }
 
 void
 SubBaseSelection::LoadMusicPlayer(const Tizen::Base::String& mediaFilepath, Tizen::Media::PlayerState PlayerCurrentState)
 {
+       AppLogDebug("SubFolderSelection::OnListViewItemStateChanged");
        result r = E_SUCCESS;
        if (_pAudioPlayer != null && mediaFilepath.IsEmpty() == false)
        {
@@ -922,3 +937,10 @@ CATCH:
        }
        return null;
 }
+
+void
+SubBaseSelection::OnTelephonyCallStatusChangedN        (CallStatus     callStatus, CallInfo * pCallInfo)
+{
+       AppLogDebug("SubBaseSelection::OnTelephonyCallStatusChangedN");
+       _pListView->UpdateList();
+}
index f85f35f..8a65d10 100644 (file)
@@ -100,8 +100,6 @@ SubFolderFileListForm::OnInitializing(void)
        String ThumbnailProviderPath;
        String rootParentPath;
        String displayPath;
-       //String buttonHome;
-       //String buttonUp;
        String extensionVisibility;
 
        SceneId currentSceneId;
@@ -111,8 +109,6 @@ SubFolderFileListForm::OnInitializing(void)
        Bitmap* pBitmapHomeButtonPress = null;
        Bitmap* pBitmapUpButtonPress = null;
 
-       //AddOrientationEventListener(*this);
-       //SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
 
        String  SubDirectorySceneOne(L"ScnSubDirectoryForm"), SubDirecorySceneTwo(L"ScnSubDirectoryForm1");
 
@@ -136,10 +132,6 @@ SubFolderFileListForm::OnInitializing(void)
        //Set FormBackEvent Listener
        SetFormBackEventListener(this);
 
-       //Set Orientation Event Listener
-       //      AddOrientationEventListener(*this);
-       //      SetOrientation(ORIENTATION_AUTOMATIC_FOUR_DIRECTION);
-
        //Get the label control from IDL_SUB_DIRECTORY
        _pLabelDisplayPath = static_cast< Label* >(GetControl("IDC_LABEL_DISPLAY_PATH"));
        TryCatch(_pLabelDisplayPath != null, , "Label is Null");
index 56d02f7..873835c 100644 (file)
-//\r
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (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: MfSubFolderSelection.cpp\r
- * @brief: This file contains the implementation of SubFolderSelection class,\r
- *  which acts an AppControl for the SubDirectories.\r
- */\r
-\r
-#include "MfMyFilesApp.h"\r
-#include "MfSubFolderSelection.h"\r
-#include "MfSceneRegister.h"\r
-#include "MfUtility.h"\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::Content;\r
-using namespace Tizen::Graphics;\r
-using namespace Tizen::Locales;\r
-using namespace Tizen::Media;\r
-using namespace Tizen::System;\r
-using namespace Tizen::Ui;\r
-using namespace Tizen::Ui::Controls;\r
-using namespace Tizen::Ui::Scenes;\r
-using namespace Tizen::Io;\r
-\r
-SubFolderSelection::SubFolderSelection(void)\r
-       : __pReceivedFilename(null)\r
-       , __pHomeButton(null)\r
-       , __pUpButton(null)\r
-       , __pMoreContextMenu(null)\r
-       , __pLabelDisplayPath(null)\r
-       , __pFileEventManager(null)\r
-{\r
-       //Do Nothing\r
-}\r
-\r
-SubFolderSelection::~SubFolderSelection(void)\r
-{\r
-       if (__pHomeButton != null)\r
-       {\r
-               delete __pHomeButton;\r
-       }\r
-\r
-       if (__pUpButton != null)\r
-       {\r
-               delete __pUpButton;\r
-       }\r
-       if (__pMoreContextMenu != null)\r
-       {\r
-               delete __pMoreContextMenu;\r
-       }\r
-       if (__pFileEventManager != null)\r
-       {\r
-               delete __pFileEventManager;\r
-       }\r
-}\r
-\r
-SubFolderSelection&\r
-SubFolderSelection::operator =(const SubFolderSelection& pSubFolderSelection)\r
-{\r
-       return *this;\r
-}\r
-\r
-SubFolderSelection::SubFolderSelection(const SubFolderSelection& pSubFolderSelection)\r
-{\r
-       //Do Nothing\r
-}\r
-\r
-\r
-bool\r
-SubFolderSelection::Initialize(void)\r
-{\r
-       AppLogDebug("Entry");\r
-       Form::Construct(L"IDL_SUB_FOLDER_FILE_SELECTION");\r
-       AppLogDebug("Exit");\r
-       return true;\r
-}\r
-\r
-result\r
-SubFolderSelection::OnInitializing(void)\r
-{\r
-       AppLogDebug("Entry");\r
-       result r = E_SUCCESS;\r
-       String buttonCancel;\r
-       String buttonAttach;\r
-       String buttonCreate;\r
-       String buttonFolder;\r
-       String buttonHome;\r
-       String buttonUp;\r
-       String buttonExport;\r
-       String buttonHere;\r
-       String buttonExportHere;\r
-       String displayPath;\r
-       ButtonItem footerItemMenu;\r
-       int xPos = 0, yPos = 0;\r
-\r
-       CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_SELECTION;\r
-\r
-       AppResource* pAppResource = null;\r
-       Bitmap* pBitmapHomeButton = null;\r
-       Bitmap* pBitmapUpButton = null;\r
-       Bitmap* pBitmapHomeButtonPress = null;\r
-       Bitmap* pBitmapUpButtonPress = null;\r
-       Bitmap* pBitmap = null;\r
-       Bitmap* pBitmapPress = null;\r
-       Bitmap* pBitmapDisabled = null;\r
-\r
-       __pReceivedFilename = new (std::nothrow) String();\r
-\r
-       _pListView = static_cast< ListView* >(GetControl("IDC_SUB_FOLDER_SELECTION_LISTVIEW"));\r
-       TryCatch(_pListView != null, , "Failed to get list view control");\r
-\r
-       _pListView->AddListViewItemEventListener(*this);\r
-       _pListView->SetItemProvider(*this);\r
-       _pListView->SetShowState(false);\r
-\r
-       _selectionMode = ((MyFilesApp*) Application::GetInstance())->GetCurrentSelectionMode();\r
-       _currentFileType = ((MyFilesApp*) Application::GetInstance())->GetCurrentFileType();\r
-       _currentViewStyle = ((MyFilesApp*) Application::GetInstance())->GetCurrentView();\r
-       _currentExportFileType = ((MyFilesApp*) Application::GetInstance())->GetCurrentExportFileType();\r
-\r
-       __pLabelDisplayPath = static_cast< Label* >(GetControl("IDC_SUB_FOLDER_SELECTION_LABEL_DISPLAY_PATH"));\r
-       TryCatch(__pLabelDisplayPath != null, , "Label is Null");\r
-\r
-       pAppResource = UiApp::GetInstance()->GetAppResource();\r
-       TryCatch(pAppResource != null, , "Resource manager not found!");\r
-\r
-       displayPath = defaultPhoneBody;\r
-       displayPath.Append("/");\r
-\r
-       //pAppResource->GetString(L"IDS_MF_BUTTON_HOME", buttonHome);\r
-       pAppResource->GetString(L"IDS_COM_POP_ATTACH", buttonAttach);\r
-       pAppResource->GetString(L"IDS_COM_POP_CANCEL", buttonCancel);\r
-       pAppResource->GetString(L"IDS_EXPORT_HERE", buttonExportHere);\r
-       //pAppResource->GetString(L"IDS_MF_TAB_UP", buttonUp);\r
-       pBitmap = pAppResource->GetBitmapN(IDB_MORE, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapPress = pAppResource->GetBitmapN(IDB_MORE_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapDisabled = pAppResource->GetBitmapN(IDB_MORE_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapHomeButton = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapUpButton = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapHomeButtonPress = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       pBitmapUpButtonPress = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-\r
-       __displayPath = displayPath;\r
-\r
-       _pFolderBitmap = pAppResource->GetBitmapN(IDB_FOLDER, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       _pDummyImage = pAppResource->GetBitmapN(IDB_DUMMY_IMG, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-\r
-       _pAudioPlay = MfUtility::MergeBitmapN(IDB_PLAY_OUTER_CIRCLE, IDB_PLAY, 64, 64);\r
-       _pAudioPause = MfUtility::MergeBitmapN(IDB_PLAY_OUTER_CIRCLE, IDB_PAUSE, 64, 64);\r
-\r
-       _pFooter = GetFooter();\r
-\r
-       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)\r
-       {\r
-               pAppResource->GetString(L"IDS_EXPORT", buttonExport);\r
-\r
-               footerItemMenu.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BTN_MORE);\r
-               if (pBitmap != null)\r
-               {\r
-                       pBitmap->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));\r
-                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmap);\r
-               }\r
-               if (pBitmapPress != null)\r
-               {\r
-                       pBitmapPress->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));\r
-                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapPress);\r
-               }\r
-               if (pBitmapDisabled != null)\r
-               {\r
-                       pBitmapDisabled->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));\r
-                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapDisabled);\r
-               }\r
-               if (_pFooter != null)\r
-               {\r
-                       _pFooter->GetPosition(xPos, yPos);\r
-               }\r
-               __pMoreContextMenu = new (std::nothrow) ContextMenu();\r
-           __pMoreContextMenu->Construct(Point(0 , yPos), CONTEXT_MENU_STYLE_LIST);\r
-               __pMoreContextMenu->AddActionEventListener(*this);\r
-               __pMoreContextMenu->SetShowState(true);\r
-       }\r
-\r
-       _pHeader = GetHeader();\r
-       TryCatch(_pHeader != null, , "Header is Null");\r
-\r
-       __pHomeButton = new (std::nothrow) ButtonItem();\r
-       __pHomeButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_HOME);\r
-       __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapHomeButton);\r
-       __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapHomeButtonPress);\r
-\r
-       __pUpButton = new (std::nothrow) ButtonItem();\r
-       __pUpButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_UP);\r
-       __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapUpButton);\r
-       __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapUpButtonPress);\r
-\r
-       _pHeader->SetButton(BUTTON_POSITION_LEFT, *__pHomeButton);\r
-       _pHeader->SetButton(BUTTON_POSITION_RIGHT, *__pUpButton);\r
-       _pHeader->AddActionEventListener(*this);\r
-\r
-       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)\r
-       {\r
-               _pExport = new (std::nothrow) FooterItem();\r
-               r = _pExport->Construct(IDA_BTN_EXPORT);\r
-               _pExport->SetText(buttonExportHere);\r
-\r
-       }\r
-       else\r
-       {\r
-               _pAttach = new (std::nothrow) FooterItem();\r
-               r = _pAttach->Construct(IDA_BTN_ATTACH);\r
-               _pAttach->SetText(buttonAttach);\r
-       }\r
-\r
-       TryCatch(_pFooter != null, , "Footer is Null");\r
-\r
-       if (_pFooter != null)\r
-       {\r
-               _pFooter->RemoveAllButtons();\r
-               _pFooter->RemoveAllItems();\r
-               _pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);\r
-\r
-               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       _pFooter->AddItem(*_pExport);\r
-                       _pFooter->SetButton(BUTTON_POSITION_LEFT, footerItemMenu);\r
-                       //_pFooter->AddItem(*_pCreateFolder);\r
-               }\r
-               else\r
-               {\r
-                       _pFooter->AddItem(*_pAttach);\r
-               }\r
-\r
-               //_pFooter->AddItem(*_pCancel);\r
-               _pFooter->AddActionEventListener(*this);\r
-               _pFooter->SetBackButton();\r
-               SetFormBackEventListener(this);\r
-               if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       _pFooter->SetItemEnabled(0, false);\r
-               }\r
-               _pFooter->Invalidate(true);\r
-       }\r
-\r
-       CreateLabelControl();\r
-\r
-       __defaultListViewBounds = _pListView->GetBounds();\r
-\r
-       _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();\r
-       TryCatch(_pFolderEntryPM != null, , "Failed to allocate memory");\r
-       _pFolderEntryPM->Construct();\r
-       _pFolderEntryPM->SetSourceForm(createitemsource);\r
-\r
-       _rootMediaPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-       _rootStoragePath = BasePresentationModel::GetSdCardPath();\r
-\r
-       if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)\r
-       {\r
-       _pFolderEntryPM->SetFolderEntryType(_currentFileType);\r
-       _pFolderEntryPM->SetFolderEntryPath(_rootMediaPath);\r
-       _pFilenames = _pFolderEntryPM->GetFolderEntryList();\r
-       TryCatch(_pFilenames != null, , "MfMyFilesApp::Failed to allocate Memory to Filenames ArrayList");\r
-       }\r
-\r
-       _pThumbnailManager = ThumbnailManager::GetInstance();\r
-       TryCatch(_pThumbnailManager != null, , "Thumbnail Manager not found!");\r
-\r
-       _pFileManager = FolderEntryEditorPresentationModel::GetInstance();\r
-       TryCatch(_pFileManager != null, , "File Manager not found!");\r
-\r
-       InitializeAppRegistry();\r
-\r
-       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)\r
-       {\r
-               __pLabelDisplayPath->SetShowState(true);\r
-               _pLabelNumberOfItems->SetShowState(false);\r
-       }\r
-\r
-       AppLogDebug("Exit %s", GetErrorMessage(r));\r
-\r
-#if 0\r
-       DataBindingContext* pContext = null;\r
-\r
-       pContext = GetDataBindingContextN();\r
-       TryCatch(pContext != null, , "Failed to Fetch the DataBinding Context");\r
-\r
-       pContext->Bind(L"ID_APPCONTROL_DISPLAY_PATH", L"IDC_SUB_FOLDER_SELECTION_LABEL_DISPLAY_PATH", L"text", __displayPath, DATA_BINDING_DATA_TYPE_STRING, DATA_BINDING_FLOW_TWO_WAY, DATA_BINDING_TRIGGER_EXPLICIT, null, null, null);\r
-\r
-       delete pContext;\r
-\r
-#endif\r
-\r
-       delete pBitmapHomeButton;\r
-       delete pBitmapUpButton;\r
-       delete pBitmapHomeButtonPress;\r
-       delete pBitmapUpButtonPress;\r
-       delete pBitmapDisabled;\r
-       delete pBitmap;\r
-       delete pBitmapPress;\r
-       AppLogDebug("Exit: %s", GetErrorMessage(r));\r
-       return r;\r
-\r
-CATCH:\r
-       if (pBitmapHomeButton != null)\r
-       {\r
-               delete pBitmapHomeButton;\r
-               pBitmapHomeButton = null;\r
-       }\r
-\r
-       if (pBitmapUpButton != null)\r
-       {\r
-               delete pBitmapUpButton;\r
-               pBitmapUpButton = null;\r
-       }\r
-       if (pBitmapHomeButtonPress != null)\r
-       {\r
-               delete pBitmapHomeButtonPress;\r
-               pBitmapHomeButtonPress = null;\r
-       }\r
-       if (pBitmapUpButtonPress != null)\r
-       {\r
-               delete pBitmapUpButtonPress;\r
-               pBitmapUpButtonPress = null;\r
-       }\r
-       r = E_FAILURE;\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-       return r;\r
-}\r
-\r
-result\r
-SubFolderSelection::OnTerminating(void)\r
-{\r
-       result r = E_SUCCESS;\r
-\r
-       _pHeader = GetHeader();\r
-       if (_pHeader != null)\r
-       {\r
-               _pHeader->RemoveAllButtons();\r
-               _pHeader->RemoveAllItems();\r
-       }\r
-\r
-       _pFooter = GetFooter();\r
-       if (_pFooter != null)\r
-       {\r
-               _pFooter->RemoveAllButtons();\r
-               _pFooter->RemoveAllItems();\r
-       }\r
-\r
-       return r;\r
-}\r
-\r
-void\r
-SubFolderSelection::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)\r
-{\r
-       //empty implementation\r
-}\r
-\r
-void\r
-SubFolderSelection::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)\r
-{\r
-       //empty implementation\r
-}\r
-\r
-void\r
-SubFolderSelection::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)\r
-{\r
-       AppLogDebug("Entry");\r
-       result r = E_SUCCESS;\r
-       String selectFiles;\r
-       String selectedCount;\r
-       String selectedRootMediaPath;\r
-       DirectoryEntry* pDirStr = null;\r
-       String nextFilename;\r
-       int selectedItemsCount = 0;\r
-       int itemcount = 0;\r
-       AppResource* pAppResource = null;\r
-       SceneManager* pSceneManager = null;\r
-       ArrayList* pArgs = null;\r
-       bool itemStatus = false;\r
-       Integer currentIndex = index;\r
-       RelativeLayout* pLayout = null;\r
-\r
-       pArgs = new (std::nothrow) ArrayList();\r
-       pArgs->Construct();\r
-\r
-       pSceneManager = SceneManager::GetInstance();\r
-       pAppResource = Application::GetInstance()->GetAppResource();\r
-       TryCatch(pAppResource != null, , "Resource manager not found!");\r
-\r
-       pAppResource->GetString(L"IDS_SELECT_FILES", selectFiles);\r
-       pAppResource->GetString(L"IDS_COM_BODY_SELECTED", selectedCount);\r
-\r
-       itemStatus = _pFileManager->GetCheckedList()->ContainsKey(currentIndex /*,itemStatus*/);\r
-\r
-       if (elementId == CONTENT_LIST_ITEM_TYPE_PLAY || elementId == CONTENT_LIST_ITEM_TYPE_PAUSE)\r
-       {\r
-               pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));\r
-               TryCatch(pDirStr != null, , "pDirStr is null");\r
-\r
-               if (!itemStatus)\r
-               {\r
-                       listView.SetItemChecked(index, false);\r
-               }\r
-               else\r
-               {\r
-                       listView.SetItemChecked(index, true);\r
-               }\r
-\r
-               if (_pAudioPlayer == null)\r
-               {\r
-                       InitializePlayer();\r
-                       LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_INITIALIZED);\r
-                       _previousAudioSelected = index;\r
-                       _currentAudioPlayIndex = index;\r
-                       _pListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-\r
-                       return;\r
-               }\r
-\r
-               if (_previousAudioSelected == index)\r
-               {\r
-                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING)\r
-                       {\r
-                               _pAudioPlayer->Pause();\r
-                       }\r
-                       else\r
-                       {\r
-                               LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_INITIALIZED);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       _pAudioPlayer->Stop();\r
-                       _pAudioPlayer->Close();\r
-                       _pListView->RefreshList(_previousAudioSelected, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-                       _previousAudioSelected = index;\r
-\r
-                       LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_STOPPED);\r
-               }\r
-               _currentAudioPlayIndex = index;\r
-               _pListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-               //listView.SetItemChecked(index, false);\r
-               return;\r
-       }\r
-\r
-       if (_pFilenames != null) //start of FILENAME check if\r
-       {\r
-               pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));\r
-\r
-               if (pDirStr != null) //start of NULL check if\r
-               {\r
-                       if (pDirStr->IsDirectory()) // start of DIRECTORY CHECK if\r
-                       {\r
-                               selectedRootMediaPath = pDirStr->GetFullFilePath();\r
-                               nextFilename = pDirStr->GetFileName();\r
-\r
-                               if (_rootMediaPath != null)\r
-                               {\r
-                                       _rootMediaPath.Clear();\r
-                                       _rootMediaPath.Append(selectedRootMediaPath);\r
-                               }\r
-\r
-                               if (_pAudioPlayer != null)\r
-                               {\r
-                                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING || _pAudioPlayer->GetState() == PLAYER_STATE_PAUSED)\r
-                                       {\r
-                                               _pAudioPlayer->Stop();\r
-                                               _pAudioPlayer->Close();\r
-                                       }\r
-                               }\r
-                               FolderNavigationPresentationModel::SetCurrentFilePath(_rootMediaPath);\r
-\r
-                               pArgs->Add(&nextFilename);\r
-                               pArgs->Add(&_rootMediaPath);\r
-                               ClearSelectedItems(listView);\r
-                               pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);\r
-                       } // end of DIRECTORY CHECK if\r
-                       else //start of FILE CHECK else\r
-                       {\r
-                               if (listView.IsItemChecked(index) == true)\r
-                               {\r
-                                       _pFileManager->AddCheckedListEntry(index, pDirStr);\r
-                               }\r
-                               else\r
-                               {\r
-                                       _pFileManager->RemoveCheckedListEntry(index);\r
-                               }\r
-\r
-                               if (_selectionMode == SELECTION_MODE_SINGE)\r
-                               {\r
-                                       if (listView.IsItemChecked(_storePreviousIndex) == true && _storePreviousIndex != index)\r
-                                       {\r
-                                               listView.SetItemChecked(_storePreviousIndex, false);\r
-                                               _pListView->RefreshList(_storePreviousIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-                                               _pFileManager->RemoveCheckedListEntry(_storePreviousIndex);\r
-                                       }\r
-                                       _storePreviousIndex = index;\r
-                               }\r
-                       } //end of FILE CHECK else\r
-               } //end of NULL check if\r
-\r
-               for (itemcount = 0; itemcount <= GetItemCount(); itemcount++)\r
-               {\r
-                       if (listView.IsItemChecked(itemcount) == true)\r
-                       {\r
-                               selectedItemsCount++;\r
-                       }\r
-               }\r
-\r
-               if (selectedItemsCount != 0)\r
-               {\r
-                       r = _pFooter->SetItemEnabled(0, true);\r
-               }\r
-               else\r
-               {\r
-                       if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)\r
-                       {\r
-                       _pFooter->SetItemEnabled(0, false);\r
-                       }\r
-               }\r
-\r
-               if (_selectionMode == SELECTION_MODE_MULTIPLE) // start of MULTIPLE_MODE_SELECTION if\r
-               {\r
-\r
-                       pLayout = dynamic_cast <RelativeLayout*> (Form::GetLayoutN());\r
-                       if (pLayout != null)\r
-                       {\r
-                               pLayout->SetRelation(*_pListView, _pLabelNumberOfItems,RECT_EDGE_RELATION_BOTTOM_TO_TOP);\r
-                       }\r
-\r
-                       if (selectedItemsCount > 0)\r
-                       {\r
-                               _itemSelectedCount.Clear();\r
-                               _itemSelectedCount.Append(selectedCount);\r
-                               _itemSelectedCount.Append(L"\x200E");\r
-                               _itemSelectedCount.Append(L"(");\r
-                               _itemSelectedCount.Append(selectedItemsCount);\r
-                               _itemSelectedCount.Append(L")");\r
-                               _itemSelectedCount.Append(L"\x200E");\r
-                               _pLabelNumberOfItems->SetText(_itemSelectedCount);\r
-                       }\r
-                       else\r
-                       {\r
-                               _itemSelectedCount.Clear();\r
-                               _itemSelectedCount.Append(selectFiles);\r
-                               _pLabelNumberOfItems->SetText(_itemSelectedCount);\r
-                       }\r
-\r
-                       _pLabelNumberOfItems->Invalidate(true);\r
-\r
-                       delete pLayout;\r
-               }\r
-       } //end of FILENAME check if\r
-\r
-       _pFooter->Invalidate(true);\r
-\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-       return;\r
-CATCH:\r
-       r = GetLastResult();\r
-       if (_pFolderEntryPM != null)\r
-       {\r
-               delete _pFolderEntryPM;\r
-               _pFolderEntryPM = null;\r
-       }\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-void\r
-SubFolderSelection::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)\r
-{\r
-       //empty implementation\r
-}\r
-\r
-void\r
-SubFolderSelection::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,\r
-                                                                         const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)\r
-{\r
-\r
-       RelativeLayout* pLayout = null;\r
-\r
-       SceneManager::GetInstance()->AddSceneManagerEventListener(*this);\r
-\r
-       ((MyFilesApp*) Application::GetInstance())->SetAudioNotificationListener(this);\r
-       _itemSelectedCount.Clear();\r
-\r
-       if (_pFileManager != null)\r
-       {\r
-               if (!_pFileManager->IsCheckedListNull())\r
-               {\r
-                       _pFileManager->ClearCheckedList();\r
-               }\r
-       }\r
-       if (_selectionMode == SELECTION_MODE_SINGE) // start of MULTIPLE_MODE_SELECTION if\r
-       {\r
-               pLayout  = dynamic_cast <RelativeLayout*> (Form::GetLayoutN());\r
-               if (pLayout != null)\r
-               {\r
-                       pLayout->SetRelation(*_pListView, this ,RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);\r
-               }\r
-\r
-               delete pLayout;\r
-\r
-       }\r
-       if (pArgs != null)\r
-       {\r
-               __pReceivedFilename->Clear();\r
-               __pReceivedFilename->Append(*static_cast<String*>(pArgs->GetAt(0)));\r
-       }\r
-       else\r
-       {\r
-               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       String headerDisplayPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-                       SetHeaderTitleText(headerDisplayPath);\r
-                       __pReceivedFilename->Clear();\r
-               }\r
-       }\r
-\r
-       ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);\r
-\r
-       if (pArgs != null)\r
-       {\r
-               pArgs->RemoveAll(false);\r
-               delete pArgs;\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,\r
-                                                                          const Tizen::Ui::Scenes::SceneId& nextSceneId)\r
-{\r
-       DeviceManager::RemoveAllDeviceEventListeners();\r
-       ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);\r
-       ((MyFilesApp*) Application::GetInstance())->SetAudioNotificationListener(null);\r
-       _pFolderEntryPM->StopThumbnailManager(true);\r
-\r
-       if(__pFileEventManager != null)\r
-       {\r
-               __pFileEventManager->RemovePath(_rootMediaPath);\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)\r
-{\r
-       AppLogDebug("Entry");\r
-\r
-       String createFolder;\r
-       Bitmap* pBitmapCreateFolder = null;\r
-       AppResource* pAppResource = null;\r
-       pAppResource = UiApp::GetInstance()->GetAppResource();\r
-       if (pAppResource != null)\r
-       {\r
-               pAppResource->GetString(L"IDS_COM_BODY_CREATE_FOLDER", createFolder);\r
-               pBitmapCreateFolder = pAppResource->GetBitmapN(IDB_POPUP_CREATE_FOLDER_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);\r
-       }\r
-\r
-       switch (actionId)\r
-       {\r
-       case IDA_BTN_HOME:\r
-       {\r
-               ShowHomeView();\r
-               _pFolderEntryPM->InitThumbnailManager();\r
-       }\r
-       break;\r
-\r
-       case IDA_BTN_UP:\r
-       {\r
-               ShowParentDirectoryView();\r
-               _pFolderEntryPM->InitThumbnailManager();\r
-       }\r
-       break;\r
-\r
-       case IDA_BTN_MORE:\r
-       {\r
-               __pMoreContextMenu->RemoveAllItems();\r
-               __pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_NORMAL, Color::GetColor(COLOR_ID_WHITE));\r
-               __pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_PRESSED, Color::GetColor(COLOR_ID_WHITE));\r
-               __pMoreContextMenu->AddItem(createFolder, IDA_BTN_CREATE_FOLDER, *pBitmapCreateFolder, null, null);\r
-               __pMoreContextMenu->SetShowState(true);\r
-               __pMoreContextMenu->Show();\r
-       }\r
-       break;\r
-\r
-       default:\r
-       {\r
-               SubBaseOnActionPerformed(source, actionId);\r
-       }\r
-       break;\r
-       }\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-void\r
-SubFolderSelection::ShowParentDirectoryView(void)\r
-{\r
-       AppLogDebug("Entry");\r
-       result r = E_SUCCESS;\r
-       String displayPath;\r
-       String ParentPath;\r
-\r
-       displayPath = defaultPhoneBody;\r
-       displayPath.Append("/");\r
-\r
-       ParentPath = FolderNavigationPresentationModel::GetParentPath();\r
-       //_pFileManager->ClearCheckedList();\r
-\r
-       if (FolderNavigationPresentationModel::GetCurrentPath() == BasePresentationModel::GetMediaPath() || FolderNavigationPresentationModel::GetCurrentPath() == BasePresentationModel::GetSdCardPath())\r
-       {\r
-               _pFileManager->ClearCheckedList();\r
-               ShowHomeView();\r
-       }\r
-       else\r
-       {\r
-               if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)\r
-               {\r
-                       ResetFooter();\r
-               }\r
-\r
-               if (_pAudioPlayer != null)\r
-               {\r
-                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING || _pAudioPlayer->GetState() == PLAYER_STATE_PAUSED)\r
-                       {\r
-                               _pAudioPlayer->Stop();\r
-                               _pAudioPlayer->Close();\r
-                       }\r
-               }\r
-               _rootMediaPath.Clear();\r
-               _rootMediaPath.Append(ParentPath);\r
-\r
-               FolderNavigationPresentationModel::SetCurrentFilePath(_rootMediaPath);\r
-\r
-               SetParentDisplayPath();\r
-               SetHeaderTitleText(ParentPath);\r
-\r
-               //Remove the current files from the filenames list\r
-               if (_pFolderEntryPM != null)\r
-               {\r
-                       _pFolderEntryPM->SetFolderEntryPath(ParentPath);\r
-                       //Get the files in the parent path of the current view\r
-                       _pFilenames = _pFolderEntryPM->GetFolderEntryList();\r
-                       TryCatch(_pFilenames != null, , "Failed to fetch ArrayList from the ContentBrowser!");\r
-               }\r
-\r
-               if (_pListView != null)\r
-               {\r
-                       _pListView->UpdateList();\r
-                       _storePreviousIndex = 0;\r
-                       }\r
-       }\r
-\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-       return;\r
-CATCH:\r
-       r = E_FAILURE;\r
-       if (_pFolderEntryPM != null)\r
-       {\r
-               delete _pFolderEntryPM;\r
-               _pFolderEntryPM = null;\r
-       }\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-void\r
-SubFolderSelection::SetParentDisplayPath(void)\r
-{\r
-       String dislayPath;\r
-       String delim(L"/");\r
-       String parentDisplayPath;\r
-       String token;\r
-\r
-#if 0\r
-       DataBindingContext* pContext = null;\r
-       pContext = GetDataBindingContextN();\r
-\r
-       if (pContext != null)\r
-       {\r
-               //Update binding on the source to fetch the current display path.\r
-               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_SOURCE);\r
-       }\r
-#endif\r
-\r
-       StringTokenizer tokenizer(__displayPath, delim);\r
-\r
-       //Use a string tokenizer to get the filepath until it's the last token, break the loop when\r
-       //it is the last token\r
-       while (tokenizer.HasMoreTokens())\r
-       {\r
-               int tokenCount = tokenizer.GetTokenCount();\r
-\r
-               if (tokenCount != 1)\r
-               {\r
-                       tokenizer.GetNextToken(token);\r
-                       parentDisplayPath.Append(token);\r
-                       parentDisplayPath.Append(L"/");\r
-               }\r
-               else\r
-               {\r
-                       break;\r
-               }\r
-       }\r
-\r
-       //Set the display path to that of the generated filepath from the tokenizer\r
-       __displayPath = parentDisplayPath;\r
-\r
-#if 0\r
-       if (pContext != null)\r
-       {\r
-               //Update Binding on the Target control to display the currently constructed path.\r
-               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);\r
-       }\r
-\r
-       if (pContext != null)\r
-       {\r
-               delete pContext;\r
-       }\r
-#endif\r
-\r
-       if (__pLabelDisplayPath != null)\r
-       {\r
-               __pLabelDisplayPath->SetText(__displayPath);\r
-               __pLabelDisplayPath->Invalidate(true);\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::SetHeaderTitleText(Tizen::Base::String& filePath)\r
-{\r
-       String token;\r
-       String parentFileName;\r
-       String delimiter(L"/");\r
-       StringTokenizer tokenizer(filePath, delimiter);\r
-\r
-       AppResource* pAppResource = null;\r
-\r
-       pAppResource = UiApp::App::GetInstance()->GetAppResource();\r
-\r
-       if (filePath == BasePresentationModel::GetMediaPath())\r
-       {\r
-               if (pAppResource != null)\r
-               {\r
-                       pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);\r
-               }\r
-       }\r
-       else if (filePath == BasePresentationModel::GetSdCardPath())\r
-       {\r
-               if (pAppResource != null)\r
-               {\r
-                       pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);\r
-               }\r
-       }\r
-       else\r
-       {\r
-               while (tokenizer.HasMoreTokens())\r
-               {\r
-                       int tokenCount = tokenizer.GetTokenCount();\r
-\r
-                       if (tokenCount == 1)\r
-                       {\r
-                               tokenizer.GetNextToken(parentFileName);\r
-                       }\r
-                       else\r
-                       {\r
-                               tokenizer.GetNextToken(token);\r
-                       }\r
-               }\r
-       }\r
-\r
-       if (_pHeader != null)\r
-       {\r
-               if (!parentFileName.IsEmpty())\r
-               {\r
-                       _pHeader->SetTitleText(parentFileName);\r
-                       _pHeader->Invalidate(true);\r
-               }\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::SetNextDisplayPath(void)\r
-{\r
-       String displayPath;\r
-       String delim(L"/");\r
-       String token;\r
-       String fullPath;\r
-#if 0\r
-       DataBindingContext* pContext = null;\r
-       pContext = GetDataBindingContextN();\r
-#endif\r
-\r
-       fullPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-       //fullPath = __rootMediaPath;\r
-\r
-       StringTokenizer tokenizer(fullPath, delim);\r
-\r
-       int Counter = 0;\r
-       switch (_storageType)\r
-       {\r
-       case MEMORY_TYPE_PHONE:\r
-       {\r
-               Counter = 3;\r
-       }\r
-       break;\r
-\r
-       case MEMORY_TYPE_SD_CARD:\r
-       {\r
-               Counter = 3;\r
-       }\r
-       break;\r
-\r
-       default:\r
-               //Do Nothing.\r
-               break;\r
-       }\r
-\r
-       //Use a string tokenizer to get the filepath until it's the last token, break the loop when\r
-       //it is the last token\r
-       while (tokenizer.HasMoreTokens())\r
-       {\r
-               if (Counter > 0)\r
-               {\r
-                       Counter--;\r
-                       tokenizer.GetNextToken(token);\r
-               }\r
-               else\r
-               {\r
-                       tokenizer.GetNextToken(token);\r
-                       //dislayPath.Append(L"/");\r
-                       displayPath.Append(token);\r
-                       displayPath.Append(L"/");\r
-               }\r
-       }\r
-\r
-       if (__pLabelDisplayPath != null)\r
-       {\r
-               __displayPath.Append(displayPath);\r
-               __pLabelDisplayPath->SetText(__displayPath);\r
-               __pLabelDisplayPath->Invalidate(true);\r
-       }\r
-\r
-\r
-#if 0\r
-       if (pContext != null)\r
-       {\r
-               //UpdateBinding on the target label control.\r
-               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);\r
-       }\r
-\r
-       if (pContext != null)\r
-       {\r
-               delete pContext;\r
-       }\r
-#endif\r
-}\r
-\r
-void\r
-SubFolderSelection::OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-SubFolderSelection::OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-SubFolderSelection::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)\r
-{\r
-       //Empty Implementation.\r
-}\r
-\r
-void\r
-SubFolderSelection::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)\r
-{\r
-       bool setMediaPath = false;\r
-       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;\r
-       String unmounted = sdCardStatusUnmounted;\r
-       String removed = usbDeviceStatusRemoved;\r
-       String currentPath;\r
-       IList* pArgs = null;\r
-\r
-       SceneManager* pSceneManager = null;\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
-                       pSceneManager = SceneManager::GetInstance();\r
-                       pArgs = new (std::nothrow) ArrayList();\r
-                       pArgs->Add(new (std::nothrow) Integer(APPCONTROL_STATE_SELECTED));\r
-\r
-                       if (pSceneManager != null)\r
-                       {\r
-                               pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), pArgs);\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)\r
-{\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
-\r
-void\r
-SubFolderSelection::OnPlayerEndOfClip(void)\r
-{\r
-       if (_pListView != null)\r
-       {\r
-               _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-       }\r
-}\r
-\r
-\r
-void\r
-SubFolderSelection::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId &currentSceneId)\r
-{\r
-       AppLogDebug("ENTER");\r
-       SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);\r
-       AppResource* pAppResource = null;\r
-       String importText;\r
-       String displayPath;\r
-       String phone;\r
-       String sdCard;\r
-       String external;\r
-       String received_Filepath;\r
-       int receivedStorageType = -1;\r
-       Tizen::Base::String parentPath;\r
-       result r = E_SUCCESS;\r
-       pAppResource = Application::GetInstance()->GetAppResource();\r
-       TryCatch(pAppResource != null, , "Resource manager not found!");\r
-\r
-               pAppResource->GetString(L"IDS_COM_OPT_IMPORT", importText);\r
-               pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);\r
-               pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);\r
-               pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", external);\r
-               phone.Append(L"/");\r
-               sdCard.Append(L"/");\r
-               external.Append(L"/");\r
-\r
-       if (_pListView != null)\r
-       {\r
-               _pListView->SetShowState(true);\r
-       }\r
-\r
-       if (__pFileEventManager != null)\r
-       {\r
-               delete __pFileEventManager;\r
-               __pFileEventManager = null;\r
-\r
-       }\r
-       __pFileEventManager = new (std::nothrow)FileEventManager();\r
-       __pFileEventManager->Construct(*this);\r
-\r
-       r = __pFileEventManager->AddPath(_rootMediaPath, FILE_EVENT_TYPE_ATTRIBUTE | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_DELETE );\r
-       AppLogDebug("Result is %s",GetErrorMessage(r));\r
-\r
-#if 0\r
-               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT || _currentViewStyle == APPCONTROL_VIEW_IMPORT)\r
-       {\r
-               AppLogDebug("inside view check");\r
-               String backupPath;\r
-               String backupCalendarpath;\r
-               String backupContactpath;\r
-               backupPath = BasePresentationModel::GetMediaPath();\r
-               backupPath.Append("Backup");\r
-               if (!File::IsFileExist(backupPath))\r
-               {\r
-                       Directory::Create(backupPath, true);\r
-               }\r
-\r
-               if ((_currentViewStyle == APPCONTROL_VIEW_IMPORT && _currentFileType == FILE_TYPE_CALENDER_TYPE)\r
-                               || (_currentViewStyle == APPCONTROL_VIEW_EXPORT && _currentExportFileType == EXPORT_TYPE_CALENDAR))\r
-               {\r
-                       backupCalendarpath.Append(backupPath);\r
-                       backupCalendarpath.Append("/");\r
-                       backupCalendarpath.Append("Calendar");\r
-                       if (!File::IsFileExist(backupCalendarpath))\r
-                       {\r
-                               r = Directory::Create(backupCalendarpath, true);\r
-                               AppLogDebug("Result is %s",GetErrorMessage(r));\r
-                       }\r
-               }\r
-               if ((_currentViewStyle == APPCONTROL_VIEW_IMPORT && _currentFileType == FILE_TYPE_CONTACTS_TYPE)\r
-                               || (_currentViewStyle == APPCONTROL_VIEW_EXPORT && _currentExportFileType == EXPORT_TYPE_CONTACTS))\r
-               {\r
-                       backupContactpath.Append(backupPath);\r
-                       backupContactpath.Append("/");\r
-                       backupContactpath.Append("Contacts");\r
-                       if (!File::IsFileExist(backupContactpath))\r
-                       {\r
-                               r = Directory::Create(backupContactpath, true);\r
-                               AppLogDebug("Result is %s",GetErrorMessage(r));\r
-                       }\r
-               }\r
-\r
-               /*_pFolderEntryPM->SetFolderEntryType(_currentFileType);\r
-                               _pFolderEntryPM->SetFolderEntryPath(_rootMediaPath);\r
-                               _pFilenames = _pFolderEntryPM->GetFolderEntryList();\r
-                */\r
-       }\r
-#endif\r
-       if (__pReceivedFilename != null)\r
-       {\r
-               //pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));\r
-               received_Filepath = FolderNavigationPresentationModel::GetCurrentPath();\r
-               receivedStorageType = FolderNavigationPresentationModel::GetStorageType();\r
-\r
-               if (__pReceivedFilename != null && !__pReceivedFilename->IsEmpty())\r
-               {\r
-                       _pHeader = GetHeader();\r
-                       if (_pHeader != null)\r
-                       {\r
-                               _pHeader->SetTitleText(*__pReceivedFilename);\r
-                               _pHeader->Invalidate(true);\r
-                       }\r
-               }\r
-               if (received_Filepath != null)\r
-               {\r
-\r
-                       //Clear the rootMediaPath and set it to the received filepath.\r
-                       //if (_rootMediaPath != null)\r
-                       {\r
-                               _rootMediaPath.Clear();\r
-                               _rootMediaPath.Append(received_Filepath);\r
-                       }\r
-\r
-                               if (__pLabelDisplayPath != null)\r
-                               {\r
-                                       switch (receivedStorageType)\r
-                                       {\r
-                                       case MEMORY_TYPE_PHONE:\r
-                                       {\r
-                                               __displayPath = phone;\r
-                                               _storageType = MEMORY_TYPE_PHONE;\r
-                                               //AppResource::GetInstance()->GetString(L"IDS_MF_TAB_PHONE", __tabSelected);\r
-                                       }\r
-                                       break;\r
-\r
-                                       case MEMORY_TYPE_SD_CARD:\r
-                                       {\r
-                                               __displayPath = sdCard;\r
-                                               _storageType = MEMORY_TYPE_SD_CARD;\r
-                                               //AppResource::GetInstance()->GetString(L"IDS_SD_CARD", __tabSelected);\r
-                                       }\r
-                                       break;\r
-\r
-                                       case MEMORY_TYPE_EXTERNAL:\r
-                                       {\r
-                                               __displayPath = external;\r
-                                               _storageType = MEMORY_TYPE_EXTERNAL;\r
-                                       }\r
-                                       break;\r
-\r
-                                       default:\r
-                                       {\r
-                                               //Empty Implementation.\r
-                                       }\r
-                                       break;\r
-                                       }\r
-\r
-                                       //Call the function to set the DisplayPath of the label.\r
-                                       SetNextDisplayPath();\r
-                               }\r
-\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       _rootMediaPath = FolderNavigationPresentationModel::GetCurrentPath();\r
-               }\r
-\r
-               parentPath.Append(_rootMediaPath);\r
-\r
-               if (_pFolderEntryPM != null)\r
-               {\r
-                       _pFolderEntryPM->SetFolderEntryPath(parentPath);\r
-                       _pFilenames = _pFolderEntryPM->GetFolderEntryList();\r
-                       TryCatch(_pFilenames != null, , "Failed to allocate Memory to Filenames ArrayList");\r
-                       _pFolderEntryPM->InitThumbnailManager();\r
-               }\r
-\r
-       if (_pListView != null)\r
-       {\r
-               _pListView->UpdateList();\r
-       }\r
-\r
-       DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-       return;\r
-CATCH:\r
-       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));\r
-}\r
-\r
-void\r
-SubFolderSelection::OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId &currentSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId)\r
-{\r
-\r
-}\r
-void SubFolderSelection::OnPlayerAudioFocusChanged (void)\r
-{\r
-       int AudioPlayerState = _pAudioPlayer->GetState();\r
-\r
-       AppLogDebug("SubFolderSelectionForm %d ++", AudioPlayerState);\r
-       if (AudioPlayerState == PLAYER_STATE_PAUSED)\r
-       {\r
-               AppLogDebug("Pause");\r
-               AppLogDebug("Refreshing  %d", _currentAudioPlayIndex);\r
-               _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-       }\r
-\r
-       AppLogDebug("SubFolderSelectionForm--");\r
-}\r
-\r
-void\r
-SubFolderSelection::OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId)\r
-{\r
-       AppLogDebug("SubFolderSelection::OnFileEventOccured:%S", path.GetPointer());\r
-\r
-       if ((events & FILE_EVENT_TYPE_ATTRIBUTE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_TO ))\r
-       {\r
-               if (_pFolderEntryPM!=null)\r
-               {\r
-                       _pFolderEntryPM->RefreshFolderEntries();\r
-               }\r
-\r
-               if (_pListView != null && _pListView->IsVisible())\r
-               {\r
-                       _pListView->UpdateList();\r
-               }\r
-\r
-               if (_pFolderEntryPM!=null)\r
-               {\r
-                       AppLogDebug("inside file event");\r
-                       _pFolderEntryPM->InitThumbnailManager();\r
-               }\r
-       }\r
-}\r
-\r
-void\r
-SubFolderSelection::OnAudioNotificationReceived(void)\r
-{\r
-       int AudioPlayerState;\r
-\r
-       if (_pAudioPlayer != null)\r
-       {\r
-               AudioPlayerState = _pAudioPlayer->GetState();\r
-               if (AudioPlayerState == PLAYER_STATE_PLAYING)\r
-               {\r
-                       _pAudioPlayer->Pause();\r
-                       _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);\r
-               }\r
-       }\r
-}\r
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     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: MfSubFolderSelection.cpp
+ * @brief: This file contains the implementation of SubFolderSelection class,
+ *  which acts an AppControl for the SubDirectories.
+ */
+
+#include "MfMyFilesApp.h"
+#include "MfSubFolderSelection.h"
+#include "MfSceneRegister.h"
+#include "MfUtility.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Content;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Locales;
+using namespace Tizen::Media;
+using namespace Tizen::System;
+using namespace Tizen::Telephony;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+SubFolderSelection::SubFolderSelection(void)
+       : __pReceivedFilename(null)
+       , __pHomeButton(null)
+       , __pUpButton(null)
+       , __pMoreContextMenu(null)
+       , __pLabelDisplayPath(null)
+       , __pFileEventManager(null)
+{
+       //Do Nothing
+}
+
+SubFolderSelection::~SubFolderSelection(void)
+{
+       if (__pHomeButton != null)
+       {
+               delete __pHomeButton;
+       }
+
+       if (__pUpButton != null)
+       {
+               delete __pUpButton;
+       }
+       if (__pMoreContextMenu != null)
+       {
+               delete __pMoreContextMenu;
+       }
+       if (__pFileEventManager != null)
+       {
+               delete __pFileEventManager;
+       }
+}
+
+SubFolderSelection&
+SubFolderSelection::operator =(const SubFolderSelection& pSubFolderSelection)
+{
+       return *this;
+}
+
+SubFolderSelection::SubFolderSelection(const SubFolderSelection& pSubFolderSelection)
+{
+       //Do Nothing
+}
+
+
+bool
+SubFolderSelection::Initialize(void)
+{
+       AppLogDebug("Entry");
+       Form::Construct(L"IDL_SUB_FOLDER_FILE_SELECTION");
+       AppLogDebug("Exit");
+       return true;
+}
+
+result
+SubFolderSelection::OnInitializing(void)
+{
+       AppLogDebug("Entry");
+       result r = E_SUCCESS;
+       String buttonCancel;
+       String buttonAttach;
+       String buttonCreate;
+       String buttonFolder;
+       String buttonHome;
+       String buttonUp;
+       String buttonExport;
+       String buttonHere;
+       String buttonExportHere;
+       String displayPath;
+       ButtonItem footerItemMenu;
+       int xPos = 0, yPos = 0;
+
+       CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_SELECTION;
+
+       AppResource* pAppResource = null;
+       Bitmap* pBitmapHomeButton = null;
+       Bitmap* pBitmapUpButton = null;
+       Bitmap* pBitmapHomeButtonPress = null;
+       Bitmap* pBitmapUpButtonPress = null;
+       Bitmap* pBitmap = null;
+       Bitmap* pBitmapPress = null;
+       Bitmap* pBitmapDisabled = null;
+
+       __pReceivedFilename = new (std::nothrow) String();
+
+       _pListView = static_cast< ListView* >(GetControl("IDC_SUB_FOLDER_SELECTION_LISTVIEW"));
+       TryCatch(_pListView != null, , "Failed to get list view control");
+
+       _pListView->AddListViewItemEventListener(*this);
+       _pListView->SetItemProvider(*this);
+       _pListView->SetShowState(false);
+
+       _selectionMode = ((MyFilesApp*) Application::GetInstance())->GetCurrentSelectionMode();
+       _currentFileType = ((MyFilesApp*) Application::GetInstance())->GetCurrentFileType();
+       _currentViewStyle = ((MyFilesApp*) Application::GetInstance())->GetCurrentView();
+       _currentExportFileType = ((MyFilesApp*) Application::GetInstance())->GetCurrentExportFileType();
+
+       __pLabelDisplayPath = static_cast< Label* >(GetControl("IDC_SUB_FOLDER_SELECTION_LABEL_DISPLAY_PATH"));
+       TryCatch(__pLabelDisplayPath != null, , "Label is Null");
+
+       pAppResource = UiApp::GetInstance()->GetAppResource();
+       TryCatch(pAppResource != null, , "Resource manager not found!");
+
+       displayPath = defaultPhoneBody;
+       displayPath.Append("/");
+
+       //pAppResource->GetString(L"IDS_MF_BUTTON_HOME", buttonHome);
+       pAppResource->GetString(L"IDS_COM_POP_ATTACH", buttonAttach);
+       pAppResource->GetString(L"IDS_COM_POP_CANCEL", buttonCancel);
+       pAppResource->GetString(L"IDS_EXPORT_HERE", buttonExportHere);
+       //pAppResource->GetString(L"IDS_MF_TAB_UP", buttonUp);
+       pBitmap = pAppResource->GetBitmapN(IDB_MORE, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapPress = pAppResource->GetBitmapN(IDB_MORE_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapDisabled = pAppResource->GetBitmapN(IDB_MORE_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapHomeButton = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapUpButton = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapHomeButtonPress = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
+       pBitmapUpButtonPress = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
+
+       __displayPath = displayPath;
+
+       _pFolderBitmap = pAppResource->GetBitmapN(IDB_FOLDER, BITMAP_PIXEL_FORMAT_ARGB8888);
+       _pDummyImage = pAppResource->GetBitmapN(IDB_DUMMY_IMG, BITMAP_PIXEL_FORMAT_ARGB8888);
+
+       _pAudioPlay = MfUtility::MergeBitmapN(IDB_PLAY_OUTER_CIRCLE, IDB_PLAY, 64, 64);
+       _pAudioPause = MfUtility::MergeBitmapN(IDB_PLAY_OUTER_CIRCLE, IDB_PAUSE, 64, 64);
+
+       _pFooter = GetFooter();
+
+       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)
+       {
+               pAppResource->GetString(L"IDS_EXPORT", buttonExport);
+
+               footerItemMenu.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BTN_MORE);
+               if (pBitmap != null)
+               {
+                       pBitmap->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
+                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmap);
+               }
+               if (pBitmapPress != null)
+               {
+                       pBitmapPress->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
+                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapPress);
+               }
+               if (pBitmapDisabled != null)
+               {
+                       pBitmapDisabled->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
+                       footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapDisabled);
+               }
+               if (_pFooter != null)
+               {
+                       _pFooter->GetPosition(xPos, yPos);
+               }
+               __pMoreContextMenu = new (std::nothrow) ContextMenu();
+           __pMoreContextMenu->Construct(Point(0 , yPos), CONTEXT_MENU_STYLE_LIST);
+               __pMoreContextMenu->AddActionEventListener(*this);
+               __pMoreContextMenu->SetShowState(true);
+       }
+
+       _pHeader = GetHeader();
+       TryCatch(_pHeader != null, , "Header is Null");
+
+       __pHomeButton = new (std::nothrow) ButtonItem();
+       __pHomeButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_HOME);
+       __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapHomeButton);
+       __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapHomeButtonPress);
+
+       __pUpButton = new (std::nothrow) ButtonItem();
+       __pUpButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_UP);
+       __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapUpButton);
+       __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapUpButtonPress);
+
+       _pHeader->SetButton(BUTTON_POSITION_LEFT, *__pHomeButton);
+       _pHeader->SetButton(BUTTON_POSITION_RIGHT, *__pUpButton);
+       _pHeader->AddActionEventListener(*this);
+
+       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)
+       {
+               _pExport = new (std::nothrow) FooterItem();
+               r = _pExport->Construct(IDA_BTN_EXPORT);
+               _pExport->SetText(buttonExportHere);
+
+       }
+       else
+       {
+               _pAttach = new (std::nothrow) FooterItem();
+               r = _pAttach->Construct(IDA_BTN_ATTACH);
+               _pAttach->SetText(buttonAttach);
+       }
+
+       TryCatch(_pFooter != null, , "Footer is Null");
+
+       if (_pFooter != null)
+       {
+               _pFooter->RemoveAllButtons();
+               _pFooter->RemoveAllItems();
+               _pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
+
+               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)
+               {
+                       _pFooter->AddItem(*_pExport);
+                       _pFooter->SetButton(BUTTON_POSITION_LEFT, footerItemMenu);
+                       //_pFooter->AddItem(*_pCreateFolder);
+               }
+               else
+               {
+                       _pFooter->AddItem(*_pAttach);
+               }
+
+               //_pFooter->AddItem(*_pCancel);
+               _pFooter->AddActionEventListener(*this);
+               _pFooter->SetBackButton();
+               SetFormBackEventListener(this);
+               if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)
+               {
+                       _pFooter->SetItemEnabled(0, false);
+               }
+               _pFooter->Invalidate(true);
+       }
+
+       CreateLabelControl();
+
+       _defaultListViewBounds = _pListView->GetBounds();
+
+       _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();
+       TryCatch(_pFolderEntryPM != null, , "Failed to allocate memory");
+       _pFolderEntryPM->Construct();
+       _pFolderEntryPM->SetSourceForm(createitemsource);
+
+       _rootMediaPath = FolderNavigationPresentationModel::GetCurrentPath();
+       _rootStoragePath = BasePresentationModel::GetSdCardPath();
+
+       if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)
+       {
+       _pFolderEntryPM->SetFolderEntryType(_currentFileType);
+       _pFolderEntryPM->SetFolderEntryPath(_rootMediaPath);
+       _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+       TryCatch(_pFilenames != null, , "MfMyFilesApp::Failed to allocate Memory to Filenames ArrayList");
+       }
+
+       _pThumbnailManager = ThumbnailManager::GetInstance();
+       TryCatch(_pThumbnailManager != null, , "Thumbnail Manager not found!");
+
+       _pFileManager = FolderEntryEditorPresentationModel::GetInstance();
+       TryCatch(_pFileManager != null, , "File Manager not found!");
+
+       InitializeAppRegistry();
+
+       if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)
+       {
+               __pLabelDisplayPath->SetShowState(true);
+               _pLabelNumberOfItems->SetShowState(false);
+       }
+
+       _pCallManager = new (std::nothrow) CallManager();
+
+    r = _pCallManager->Construct(*this);
+    TryCatch(r == E_SUCCESS, , "Failed to Construct CallManager");
+
+       AppLogDebug("Exit %s", GetErrorMessage(r));
+
+#if 0
+       DataBindingContext* pContext = null;
+
+       pContext = GetDataBindingContextN();
+       TryCatch(pContext != null, , "Failed to Fetch the DataBinding Context");
+
+       pContext->Bind(L"ID_APPCONTROL_DISPLAY_PATH", L"IDC_SUB_FOLDER_SELECTION_LABEL_DISPLAY_PATH", L"text", __displayPath, DATA_BINDING_DATA_TYPE_STRING, DATA_BINDING_FLOW_TWO_WAY, DATA_BINDING_TRIGGER_EXPLICIT, null, null, null);
+
+       delete pContext;
+
+#endif
+
+       delete pBitmapHomeButton;
+       delete pBitmapUpButton;
+       delete pBitmapHomeButtonPress;
+       delete pBitmapUpButtonPress;
+       delete pBitmapDisabled;
+       delete pBitmap;
+       delete pBitmapPress;
+       AppLogDebug("Exit: %s", GetErrorMessage(r));
+       return r;
+
+CATCH:
+       if (pBitmapHomeButton != null)
+       {
+               delete pBitmapHomeButton;
+               pBitmapHomeButton = null;
+       }
+
+       if (pBitmapUpButton != null)
+       {
+               delete pBitmapUpButton;
+               pBitmapUpButton = null;
+       }
+       if (pBitmapHomeButtonPress != null)
+       {
+               delete pBitmapHomeButtonPress;
+               pBitmapHomeButtonPress = null;
+       }
+       if (pBitmapUpButtonPress != null)
+       {
+               delete pBitmapUpButtonPress;
+               pBitmapUpButtonPress = null;
+       }
+       r = E_FAILURE;
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+       return r;
+}
+
+result
+SubFolderSelection::OnTerminating(void)
+{
+       result r = E_SUCCESS;
+
+       _pHeader = GetHeader();
+       if (_pHeader != null)
+       {
+               _pHeader->RemoveAllButtons();
+               _pHeader->RemoveAllItems();
+       }
+
+       _pFooter = GetFooter();
+       if (_pFooter != null)
+       {
+               _pFooter->RemoveAllButtons();
+               _pFooter->RemoveAllItems();
+       }
+
+       return r;
+}
+
+void
+SubFolderSelection::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
+{
+       //empty implementation
+}
+
+void
+SubFolderSelection::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
+{
+       //empty implementation
+}
+
+void
+SubFolderSelection::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
+{
+       AppLogDebug("Entry");
+       result r = E_SUCCESS;
+       String selectFiles;
+       String selectedCount;
+       String selectedRootMediaPath;
+       DirectoryEntry* pDirStr = null;
+       String nextFilename;
+       int selectedItemsCount = 0;
+       int itemcount = 0;
+       AppResource* pAppResource = null;
+       SceneManager* pSceneManager = null;
+       ArrayList* pArgs = null;
+       bool itemStatus = false;
+       Integer currentIndex = index;
+       RelativeLayout* pLayout = null;
+
+       pArgs = new (std::nothrow) ArrayList();
+       pArgs->Construct();
+
+       pSceneManager = SceneManager::GetInstance();
+       pAppResource = Application::GetInstance()->GetAppResource();
+       TryCatch(pAppResource != null, , "Resource manager not found!");
+
+       pAppResource->GetString(L"IDS_SELECT_FILES", selectFiles);
+       pAppResource->GetString(L"IDS_COM_BODY_SELECTED", selectedCount);
+
+       itemStatus = _pFileManager->GetCheckedList()->ContainsKey(currentIndex /*,itemStatus*/);
+
+       if (elementId == CONTENT_LIST_ITEM_TYPE_PLAY || elementId == CONTENT_LIST_ITEM_TYPE_PAUSE)
+       {
+               pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));
+               TryCatch(pDirStr != null, , "pDirStr is null");
+
+               if (!itemStatus)
+               {
+                       listView.SetItemChecked(index, false);
+               }
+               else
+               {
+                       listView.SetItemChecked(index, true);
+               }
+
+               if (_pAudioPlayer == null)
+               {
+                       InitializePlayer();
+                       LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_INITIALIZED);
+                       _previousAudioSelected = index;
+                       _currentAudioPlayIndex = index;
+                       _pListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
+
+                       return;
+               }
+
+               if (_previousAudioSelected == index)
+               {
+                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING)
+                       {
+                               _pAudioPlayer->Pause();
+                       }
+                       else
+                       {
+                               LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_INITIALIZED);
+                       }
+               }
+               else
+               {
+                       _pAudioPlayer->Stop();
+                       _pAudioPlayer->Close();
+                       _pListView->RefreshList(_previousAudioSelected, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       _previousAudioSelected = index;
+
+                       LoadMusicPlayer(pDirStr->GetFullFilePath(), PLAYER_STATE_STOPPED);
+               }
+               _currentAudioPlayIndex = index;
+               _pListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
+               //listView.SetItemChecked(index, false);
+               return;
+       }
+
+       if (_pFilenames != null) //start of FILENAME check if
+       {
+               pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));
+
+               if (pDirStr != null) //start of NULL check if
+               {
+                       if (pDirStr->IsDirectory()) // start of DIRECTORY CHECK if
+                       {
+                               selectedRootMediaPath = pDirStr->GetFullFilePath();
+                               nextFilename = pDirStr->GetFileName();
+
+                               if (_rootMediaPath != null)
+                               {
+                                       _rootMediaPath.Clear();
+                                       _rootMediaPath.Append(selectedRootMediaPath);
+                               }
+
+                               if (_pAudioPlayer != null)
+                               {
+                                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING || _pAudioPlayer->GetState() == PLAYER_STATE_PAUSED)
+                                       {
+                                               _pAudioPlayer->Stop();
+                                               _pAudioPlayer->Close();
+                                       }
+                               }
+                               FolderNavigationPresentationModel::SetCurrentFilePath(_rootMediaPath);
+
+                               pArgs->Add(&nextFilename);
+                               pArgs->Add(&_rootMediaPath);
+                               ClearSelectedItems(listView);
+                               pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
+                       } // end of DIRECTORY CHECK if
+                       else //start of FILE CHECK else
+                       {
+                               if (listView.IsItemChecked(index) == true)
+                               {
+                                       _pFileManager->AddCheckedListEntry(index, pDirStr);
+                               }
+                               else
+                               {
+                                       _pFileManager->RemoveCheckedListEntry(index);
+                               }
+
+                               if (_selectionMode == SELECTION_MODE_SINGE)
+                               {
+                                       if (listView.IsItemChecked(_storePreviousIndex) == true && _storePreviousIndex != index)
+                                       {
+                                               listView.SetItemChecked(_storePreviousIndex, false);
+                                               _pListView->RefreshList(_storePreviousIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                                               _pFileManager->RemoveCheckedListEntry(_storePreviousIndex);
+                                       }
+                                       _storePreviousIndex = index;
+                               }
+                       } //end of FILE CHECK else
+               } //end of NULL check if
+
+               for (itemcount = 0; itemcount <= GetItemCount(); itemcount++)
+               {
+                       if (listView.IsItemChecked(itemcount) == true)
+                       {
+                               selectedItemsCount++;
+                       }
+               }
+
+               if (selectedItemsCount != 0)
+               {
+                       r = _pFooter->SetItemEnabled(0, true);
+               }
+               else
+               {
+                       if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)
+                       {
+                       _pFooter->SetItemEnabled(0, false);
+                       }
+               }
+
+               if (_selectionMode == SELECTION_MODE_MULTIPLE) // start of MULTIPLE_MODE_SELECTION if
+               {
+
+                       pLayout = dynamic_cast <RelativeLayout*> (Form::GetLayoutN());
+                       if (pLayout != null)
+                       {
+                               pLayout->SetRelation(*_pListView, _pLabelNumberOfItems,RECT_EDGE_RELATION_BOTTOM_TO_TOP);
+                       }
+
+                       if (selectedItemsCount > 0)
+                       {
+                               _itemSelectedCount.Clear();
+                               _itemSelectedCount.Append(selectedCount);
+                               _itemSelectedCount.Append(L"\x200E");
+                               _itemSelectedCount.Append(L"(");
+                               _itemSelectedCount.Append(selectedItemsCount);
+                               _itemSelectedCount.Append(L")");
+                               _itemSelectedCount.Append(L"\x200E");
+                               _pLabelNumberOfItems->SetText(_itemSelectedCount);
+                       }
+                       else
+                       {
+                               _itemSelectedCount.Clear();
+                               _itemSelectedCount.Append(selectFiles);
+                               _pLabelNumberOfItems->SetText(_itemSelectedCount);
+                       }
+
+                       _pLabelNumberOfItems->Invalidate(true);
+
+                       delete pLayout;
+               }
+       } //end of FILENAME check if
+
+       _pFooter->Invalidate(true);
+
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+       return;
+CATCH:
+       r = GetLastResult();
+       if (_pFolderEntryPM != null)
+       {
+               delete _pFolderEntryPM;
+               _pFolderEntryPM = null;
+       }
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+}
+
+void
+SubFolderSelection::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
+{
+       //empty implementation
+}
+
+void
+SubFolderSelection::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
+                                                                         const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
+{
+
+       RelativeLayout* pLayout = null;
+
+       SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
+
+       ((MyFilesApp*) Application::GetInstance())->SetAudioNotificationListener(this);
+       _itemSelectedCount.Clear();
+
+       if (_pFileManager != null)
+       {
+               if (!_pFileManager->IsCheckedListNull())
+               {
+                       _pFileManager->ClearCheckedList();
+               }
+       }
+       if (_selectionMode == SELECTION_MODE_SINGE) // start of MULTIPLE_MODE_SELECTION if
+       {
+               pLayout  = dynamic_cast <RelativeLayout*> (Form::GetLayoutN());
+               if (pLayout != null)
+               {
+                       pLayout->SetRelation(*_pListView, this ,RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
+               }
+
+               delete pLayout;
+
+       }
+       if (pArgs != null)
+       {
+               __pReceivedFilename->Clear();
+               __pReceivedFilename->Append(*static_cast<String*>(pArgs->GetAt(0)));
+       }
+       else
+       {
+               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT)
+               {
+                       String headerDisplayPath = FolderNavigationPresentationModel::GetCurrentPath();
+                       SetHeaderTitleText(headerDisplayPath);
+                       __pReceivedFilename->Clear();
+               }
+       }
+
+       ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
+
+       if (pArgs != null)
+       {
+               pArgs->RemoveAll(false);
+               delete pArgs;
+       }
+}
+
+void
+SubFolderSelection::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
+                                                                          const Tizen::Ui::Scenes::SceneId& nextSceneId)
+{
+       DeviceManager::RemoveAllDeviceEventListeners();
+       ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
+       ((MyFilesApp*) Application::GetInstance())->SetAudioNotificationListener(null);
+       _pFolderEntryPM->StopThumbnailManager(true);
+
+       if(__pFileEventManager != null)
+       {
+               __pFileEventManager->RemovePath(_rootMediaPath);
+       }
+}
+
+void
+SubFolderSelection::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+{
+       AppLogDebug("Entry");
+
+       String createFolder;
+       Bitmap* pBitmapCreateFolder = null;
+       AppResource* pAppResource = null;
+       pAppResource = UiApp::GetInstance()->GetAppResource();
+       if (pAppResource != null)
+       {
+               pAppResource->GetString(L"IDS_COM_BODY_CREATE_FOLDER", createFolder);
+               pBitmapCreateFolder = pAppResource->GetBitmapN(IDB_POPUP_CREATE_FOLDER_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
+       }
+
+       switch (actionId)
+       {
+       case IDA_BTN_HOME:
+       {
+               ShowHomeView();
+               _pFolderEntryPM->InitThumbnailManager();
+       }
+       break;
+
+       case IDA_BTN_UP:
+       {
+               ShowParentDirectoryView();
+               _pFolderEntryPM->InitThumbnailManager();
+       }
+       break;
+
+       case IDA_BTN_MORE:
+       {
+               __pMoreContextMenu->RemoveAllItems();
+               __pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_NORMAL, Color::GetColor(COLOR_ID_WHITE));
+               __pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_PRESSED, Color::GetColor(COLOR_ID_WHITE));
+               __pMoreContextMenu->AddItem(createFolder, IDA_BTN_CREATE_FOLDER, *pBitmapCreateFolder, null, null);
+               __pMoreContextMenu->SetShowState(true);
+               __pMoreContextMenu->Show();
+       }
+       break;
+
+       default:
+       {
+               SubBaseOnActionPerformed(source, actionId);
+       }
+       break;
+       }
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+}
+
+void
+SubFolderSelection::ShowParentDirectoryView(void)
+{
+       AppLogDebug("Entry");
+       result r = E_SUCCESS;
+       String displayPath;
+       String ParentPath;
+
+       displayPath = defaultPhoneBody;
+       displayPath.Append("/");
+
+       ParentPath = FolderNavigationPresentationModel::GetParentPath();
+       //_pFileManager->ClearCheckedList();
+
+       if (FolderNavigationPresentationModel::GetCurrentPath() == BasePresentationModel::GetMediaPath() || FolderNavigationPresentationModel::GetCurrentPath() == BasePresentationModel::GetSdCardPath())
+       {
+               _pFileManager->ClearCheckedList();
+               ShowHomeView();
+       }
+       else
+       {
+               if (_currentViewStyle != APPCONTROL_VIEW_EXPORT)
+               {
+                       ResetFooter();
+               }
+
+               if (_pAudioPlayer != null)
+               {
+                       if (_pAudioPlayer->GetState() == PLAYER_STATE_PLAYING || _pAudioPlayer->GetState() == PLAYER_STATE_PAUSED)
+                       {
+                               _pAudioPlayer->Stop();
+                               _pAudioPlayer->Close();
+                       }
+               }
+               _rootMediaPath.Clear();
+               _rootMediaPath.Append(ParentPath);
+
+               FolderNavigationPresentationModel::SetCurrentFilePath(_rootMediaPath);
+
+               SetParentDisplayPath();
+               SetHeaderTitleText(ParentPath);
+
+               //Remove the current files from the filenames list
+               if (_pFolderEntryPM != null)
+               {
+                       _pFolderEntryPM->SetFolderEntryPath(ParentPath);
+                       //Get the files in the parent path of the current view
+                       _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+                       TryCatch(_pFilenames != null, , "Failed to fetch ArrayList from the ContentBrowser!");
+               }
+
+               if (_pListView != null)
+               {
+                       _pListView->UpdateList();
+                       _storePreviousIndex = 0;
+                       }
+       }
+
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+       return;
+CATCH:
+       r = E_FAILURE;
+       if (_pFolderEntryPM != null)
+       {
+               delete _pFolderEntryPM;
+               _pFolderEntryPM = null;
+       }
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+}
+
+void
+SubFolderSelection::SetParentDisplayPath(void)
+{
+       String dislayPath;
+       String delim(L"/");
+       String parentDisplayPath;
+       String token;
+
+#if 0
+       DataBindingContext* pContext = null;
+       pContext = GetDataBindingContextN();
+
+       if (pContext != null)
+       {
+               //Update binding on the source to fetch the current display path.
+               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_SOURCE);
+       }
+#endif
+
+       StringTokenizer tokenizer(__displayPath, delim);
+
+       //Use a string tokenizer to get the filepath until it's the last token, break the loop when
+       //it is the last token
+       while (tokenizer.HasMoreTokens())
+       {
+               int tokenCount = tokenizer.GetTokenCount();
+
+               if (tokenCount != 1)
+               {
+                       tokenizer.GetNextToken(token);
+                       parentDisplayPath.Append(token);
+                       parentDisplayPath.Append(L"/");
+               }
+               else
+               {
+                       break;
+               }
+       }
+
+       //Set the display path to that of the generated filepath from the tokenizer
+       __displayPath = parentDisplayPath;
+
+#if 0
+       if (pContext != null)
+       {
+               //Update Binding on the Target control to display the currently constructed path.
+               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
+       }
+
+       if (pContext != null)
+       {
+               delete pContext;
+       }
+#endif
+
+       if (__pLabelDisplayPath != null)
+       {
+               __pLabelDisplayPath->SetText(__displayPath);
+               __pLabelDisplayPath->Invalidate(true);
+       }
+}
+
+void
+SubFolderSelection::SetHeaderTitleText(Tizen::Base::String& filePath)
+{
+       String token;
+       String parentFileName;
+       String delimiter(L"/");
+       StringTokenizer tokenizer(filePath, delimiter);
+
+       AppResource* pAppResource = null;
+
+       pAppResource = UiApp::App::GetInstance()->GetAppResource();
+
+       if (filePath == BasePresentationModel::GetMediaPath())
+       {
+               if (pAppResource != null)
+               {
+                       pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);
+               }
+       }
+       else if (filePath == BasePresentationModel::GetSdCardPath())
+       {
+               if (pAppResource != null)
+               {
+                       pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);
+               }
+       }
+       else
+       {
+               while (tokenizer.HasMoreTokens())
+               {
+                       int tokenCount = tokenizer.GetTokenCount();
+
+                       if (tokenCount == 1)
+                       {
+                               tokenizer.GetNextToken(parentFileName);
+                       }
+                       else
+                       {
+                               tokenizer.GetNextToken(token);
+                       }
+               }
+       }
+
+       if (_pHeader != null)
+       {
+               if (!parentFileName.IsEmpty())
+               {
+                       _pHeader->SetTitleText(parentFileName);
+                       _pHeader->Invalidate(true);
+               }
+       }
+}
+
+void
+SubFolderSelection::SetNextDisplayPath(void)
+{
+       String displayPath;
+       String delim(L"/");
+       String token;
+       String fullPath;
+#if 0
+       DataBindingContext* pContext = null;
+       pContext = GetDataBindingContextN();
+#endif
+
+       fullPath = FolderNavigationPresentationModel::GetCurrentPath();
+       //fullPath = __rootMediaPath;
+
+       StringTokenizer tokenizer(fullPath, delim);
+
+       int Counter = 0;
+       switch (_storageType)
+       {
+       case MEMORY_TYPE_PHONE:
+       {
+               Counter = 3;
+       }
+       break;
+
+       case MEMORY_TYPE_SD_CARD:
+       {
+               Counter = 3;
+       }
+       break;
+
+       default:
+               //Do Nothing.
+               break;
+       }
+
+       //Use a string tokenizer to get the filepath until it's the last token, break the loop when
+       //it is the last token
+       while (tokenizer.HasMoreTokens())
+       {
+               if (Counter > 0)
+               {
+                       Counter--;
+                       tokenizer.GetNextToken(token);
+               }
+               else
+               {
+                       tokenizer.GetNextToken(token);
+                       //dislayPath.Append(L"/");
+                       displayPath.Append(token);
+                       displayPath.Append(L"/");
+               }
+       }
+
+       if (__pLabelDisplayPath != null)
+       {
+               __displayPath.Append(displayPath);
+               __pLabelDisplayPath->SetText(__displayPath);
+               __pLabelDisplayPath->Invalidate(true);
+       }
+
+
+#if 0
+       if (pContext != null)
+       {
+               //UpdateBinding on the target label control.
+               pContext->UpdateBinding(L"ID_APPCONTROL_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
+       }
+
+       if (pContext != null)
+       {
+               delete pContext;
+       }
+#endif
+}
+
+void
+SubFolderSelection::OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
+{
+       //Empty Implementation.
+}
+
+void
+SubFolderSelection::OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
+{
+       //Empty Implementation.
+}
+
+void
+SubFolderSelection::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
+{
+       //Empty Implementation.
+}
+
+void
+SubFolderSelection::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
+{
+       bool setMediaPath = false;
+       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
+       String unmounted = sdCardStatusUnmounted;
+       String removed = usbDeviceStatusRemoved;
+       String currentPath;
+       IList* pArgs = null;
+
+       SceneManager* pSceneManager = null;
+
+       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)
+               {
+                       pSceneManager = SceneManager::GetInstance();
+                       pArgs = new (std::nothrow) ArrayList();
+                       pArgs->Add(new (std::nothrow) Integer(APPCONTROL_STATE_SELECTED));
+
+                       if (pSceneManager != null)
+                       {
+                               pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), pArgs);
+                       }
+               }
+       }
+}
+
+void
+SubFolderSelection::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
+{
+
+       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);
+}
+
+void
+SubFolderSelection::OnPlayerEndOfClip(void)
+{
+       if (_pListView != null)
+       {
+               _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
+       }
+}
+
+
+void
+SubFolderSelection::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId &currentSceneId)
+{
+       AppLogDebug("ENTER");
+       SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
+       AppResource* pAppResource = null;
+       String importText;
+       String displayPath;
+       String phone;
+       String sdCard;
+       String external;
+       String received_Filepath;
+       int receivedStorageType = -1;
+       Tizen::Base::String parentPath;
+       result r = E_SUCCESS;
+       pAppResource = Application::GetInstance()->GetAppResource();
+       TryCatch(pAppResource != null, , "Resource manager not found!");
+
+               pAppResource->GetString(L"IDS_COM_OPT_IMPORT", importText);
+               pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
+               pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
+               pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", external);
+               phone.Append(L"/");
+               sdCard.Append(L"/");
+               external.Append(L"/");
+
+       if (_pListView != null)
+       {
+               _pListView->SetShowState(true);
+       }
+
+       if (__pFileEventManager != null)
+       {
+               delete __pFileEventManager;
+               __pFileEventManager = null;
+
+       }
+       __pFileEventManager = new (std::nothrow)FileEventManager();
+       __pFileEventManager->Construct(*this);
+
+       r = __pFileEventManager->AddPath(_rootMediaPath, FILE_EVENT_TYPE_ATTRIBUTE | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_DELETE );
+       AppLogDebug("Result is %s",GetErrorMessage(r));
+
+#if 0
+               if (_currentViewStyle == APPCONTROL_VIEW_EXPORT || _currentViewStyle == APPCONTROL_VIEW_IMPORT)
+       {
+               AppLogDebug("inside view check");
+               String backupPath;
+               String backupCalendarpath;
+               String backupContactpath;
+               backupPath = BasePresentationModel::GetMediaPath();
+               backupPath.Append("Backup");
+               if (!File::IsFileExist(backupPath))
+               {
+                       Directory::Create(backupPath, true);
+               }
+
+               if ((_currentViewStyle == APPCONTROL_VIEW_IMPORT && _currentFileType == FILE_TYPE_CALENDER_TYPE)
+                               || (_currentViewStyle == APPCONTROL_VIEW_EXPORT && _currentExportFileType == EXPORT_TYPE_CALENDAR))
+               {
+                       backupCalendarpath.Append(backupPath);
+                       backupCalendarpath.Append("/");
+                       backupCalendarpath.Append("Calendar");
+                       if (!File::IsFileExist(backupCalendarpath))
+                       {
+                               r = Directory::Create(backupCalendarpath, true);
+                               AppLogDebug("Result is %s",GetErrorMessage(r));
+                       }
+               }
+               if ((_currentViewStyle == APPCONTROL_VIEW_IMPORT && _currentFileType == FILE_TYPE_CONTACTS_TYPE)
+                               || (_currentViewStyle == APPCONTROL_VIEW_EXPORT && _currentExportFileType == EXPORT_TYPE_CONTACTS))
+               {
+                       backupContactpath.Append(backupPath);
+                       backupContactpath.Append("/");
+                       backupContactpath.Append("Contacts");
+                       if (!File::IsFileExist(backupContactpath))
+                       {
+                               r = Directory::Create(backupContactpath, true);
+                               AppLogDebug("Result is %s",GetErrorMessage(r));
+                       }
+               }
+
+               /*_pFolderEntryPM->SetFolderEntryType(_currentFileType);
+                               _pFolderEntryPM->SetFolderEntryPath(_rootMediaPath);
+                               _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+                */
+       }
+#endif
+       if (__pReceivedFilename != null)
+       {
+               //pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));
+               received_Filepath = FolderNavigationPresentationModel::GetCurrentPath();
+               receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
+
+               if (__pReceivedFilename != null && !__pReceivedFilename->IsEmpty())
+               {
+                       _pHeader = GetHeader();
+                       if (_pHeader != null)
+                       {
+                               _pHeader->SetTitleText(*__pReceivedFilename);
+                               _pHeader->Invalidate(true);
+                       }
+               }
+               if (received_Filepath != null)
+               {
+
+                       //Clear the rootMediaPath and set it to the received filepath.
+                       //if (_rootMediaPath != null)
+                       {
+                               _rootMediaPath.Clear();
+                               _rootMediaPath.Append(received_Filepath);
+                       }
+
+                               if (__pLabelDisplayPath != null)
+                               {
+                                       switch (receivedStorageType)
+                                       {
+                                       case MEMORY_TYPE_PHONE:
+                                       {
+                                               __displayPath = phone;
+                                               _storageType = MEMORY_TYPE_PHONE;
+                                               //AppResource::GetInstance()->GetString(L"IDS_MF_TAB_PHONE", __tabSelected);
+                                       }
+                                       break;
+
+                                       case MEMORY_TYPE_SD_CARD:
+                                       {
+                                               __displayPath = sdCard;
+                                               _storageType = MEMORY_TYPE_SD_CARD;
+                                               //AppResource::GetInstance()->GetString(L"IDS_SD_CARD", __tabSelected);
+                                       }
+                                       break;
+
+                                       case MEMORY_TYPE_EXTERNAL:
+                                       {
+                                               __displayPath = external;
+                                               _storageType = MEMORY_TYPE_EXTERNAL;
+                                       }
+                                       break;
+
+                                       default:
+                                       {
+                                               //Empty Implementation.
+                                       }
+                                       break;
+                                       }
+
+                                       //Call the function to set the DisplayPath of the label.
+                                       SetNextDisplayPath();
+                               }
+
+                       }
+               }
+               else
+               {
+                       _rootMediaPath = FolderNavigationPresentationModel::GetCurrentPath();
+               }
+
+               parentPath.Append(_rootMediaPath);
+
+               if (_pFolderEntryPM != null)
+               {
+                       _pFolderEntryPM->SetFolderEntryPath(parentPath);
+                       _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+                       TryCatch(_pFilenames != null, , "Failed to allocate Memory to Filenames ArrayList");
+                       _pFolderEntryPM->InitThumbnailManager();
+               }
+
+       if (_pListView != null)
+       {
+               _pListView->UpdateList();
+       }
+
+       DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+       return;
+CATCH:
+       AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
+}
+
+void
+SubFolderSelection::OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId &currentSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId)
+{
+
+}
+void SubFolderSelection::OnPlayerAudioFocusChanged (void)
+{
+       int AudioPlayerState = _pAudioPlayer->GetState();
+
+       AppLogDebug("SubFolderSelectionForm %d ++", AudioPlayerState);
+       if (AudioPlayerState == PLAYER_STATE_PAUSED)
+       {
+               AppLogDebug("Pause");
+               AppLogDebug("Refreshing  %d", _currentAudioPlayIndex);
+               _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
+       }
+
+       AppLogDebug("SubFolderSelectionForm--");
+}
+
+void
+SubFolderSelection::OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId)
+{
+       AppLogDebug("SubFolderSelection::OnFileEventOccured:%S", path.GetPointer());
+
+       if ((events & FILE_EVENT_TYPE_ATTRIBUTE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_TO ))
+       {
+               if (_pFolderEntryPM!=null)
+               {
+                       _pFolderEntryPM->RefreshFolderEntries();
+               }
+
+               if (_pListView != null && _pListView->IsVisible())
+               {
+                       _pListView->UpdateList();
+               }
+
+               if (_pFolderEntryPM!=null)
+               {
+                       AppLogDebug("inside file event");
+                       _pFolderEntryPM->InitThumbnailManager();
+               }
+       }
+}
+
+void
+SubFolderSelection::OnAudioNotificationReceived(void)
+{
+       int AudioPlayerState;
+
+       if (_pAudioPlayer != null)
+       {
+               AudioPlayerState = _pAudioPlayer->GetState();
+               if (AudioPlayerState == PLAYER_STATE_PLAYING)
+               {
+                       _pAudioPlayer->Pause();
+                       _pListView->RefreshList(_currentAudioPlayIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
+               }
+       }
+}
index 93d07ee..4d9f0d0 100644 (file)
@@ -37,6 +37,7 @@ using namespace Tizen::System;
 using namespace Tizen::Ui;\r
 using namespace Tizen::Ui::Controls;\r
 using namespace Tizen::Ui::Scenes;\r
+using namespace Tizen::Telephony;\r
 \r
 TopMostFileSelectionForm::TopMostFileSelectionForm(void)\r
        : __pMoreContextMenu(null)\r
@@ -268,7 +269,7 @@ TopMostFileSelectionForm::OnInitializing(void)
                CreateLabelControl();\r
        }\r
 \r
-       __defaultListViewBounds = _pListView->GetBounds();\r
+       _defaultListViewBounds = _pListView->GetBounds();\r
 \r
        _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();\r
        TryCatch(_pFolderEntryPM != null, r = E_FAILURE, "Failed to allocate memory");\r
@@ -309,6 +310,11 @@ TopMostFileSelectionForm::OnInitializing(void)
                _pLabelNumberOfItems->SetShowState(false);\r
        }\r
 \r
+       _pCallManager = new (std::nothrow) CallManager();\r
+       r = _pCallManager->Construct(*this);\r
+       TryCatch(r == E_SUCCESS, , "Failed to Construct CallManager");\r
+\r
+\r
        delete pBitmap;\r
        delete pBitmapPress;\r
        delete pBitmapHomeButton;\r