N_SE-36744 N_SE-36750 N_SE-36754 N_SE-36743
[apps/osp/MyFiles.git] / src / MfFileManageForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file: MfFileManageForm.cpp
19  * @brief: This file contains the implementation of FileManageForm class,
20  * and is responsible for creating the Edit View form.
21  * Operations like copy, move, delete can be performed in this form.
22  */
23
24 #include <FApp.h>
25
26 #include "MfDirectoryEntry.h"
27 #include "MfFileManageForm.h"
28 #include "MfSceneRegister.h"
29 #include "MfTypes.h"
30
31 using namespace Tizen::App;
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Collection;
34 using namespace Tizen::Base::Runtime;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Locales;
37 using namespace Tizen::System;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Animations;
40 using namespace Tizen::Ui::Controls;
41 using namespace Tizen::Ui::Scenes;
42
43 /*Constructor for the Edit Form.
44  * Variable are initialised to null or other default values
45  */
46 FileManageForm::FileManageForm(void)
47 {
48         __bScrollFlag = false;
49         __bCheckNullArgs = false;
50         _fileProcessedCount = 0;
51         __storageType = MEMORY_TYPE_NONE;
52         _renameItemIndex = 0;
53         _viewType = VIEW_TYPE_AS_NORMAL_LIST;
54 }
55
56 FileManageForm::~FileManageForm(void)
57 {
58         DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
59 }
60
61 FileManageForm::FileManageForm(const FileManageForm& editForm)
62 {
63         //empty Implementation
64 }
65
66 FileManageForm&
67 FileManageForm::operator =(const FileManageForm& editForm)
68 {
69         if (this != &editForm)
70         {
71                 _pStrItemSelectedCount = editForm._pStrItemSelectedCount;
72                 _currentDirectoryPath = editForm._currentDirectoryPath;
73                 _pFilenames = editForm._pFilenames;
74                 _pFooter = editForm._pFooter;
75                 _pEditListView = editForm._pEditListView;
76                 _pThumbnailManager = editForm._pThumbnailManager;
77                 _pFileManager = editForm._pFileManager;
78                 _pFolderEntryPM = editForm._pFolderEntryPM;
79                 _pLabelNumberOfItems = editForm._pLabelNumberOfItems;
80         }
81         return *this;
82 }
83
84 bool
85 FileManageForm::Initialize(void)
86 {
87         Form::Construct(L"IDL_EDIT");
88         return true;
89 }
90
91 result
92 FileManageForm::OnInitializing(void)
93 {
94         AppLogDebug("Entry");
95         result r = E_SUCCESS;
96         int h_EditIconListView = 0;
97         String headerText;
98         String selectAll;
99         Header* pHeader = null;
100         SceneManager* pSceneManager = null;
101
102         pSceneManager = SceneManager::GetInstance();
103
104         pSceneManager->SetFormTransitionAnimationDefaultValues(SCENE_TRANSITION_ANIMATION_TYPE_FADE_IN_OUT, 500, ANIMATION_INTERPOLATOR_EASE_IN_OUT);
105
106         AppResource* pAppResource = null;
107
108         h_EditIconListView = GetClientAreaBounds().height - H_CHECK_BUTTON;
109
110         Rectangle checkButtonBounds(X_DEFAULT, Y_DEFAULT, GetClientAreaBounds().width, H_CHECK_BUTTON);
111         Rectangle iconListViewBounds(X_DEFAULT, checkButtonBounds.height, GetClientAreaBounds().width, h_EditIconListView);
112         Rectangle listViewBounds(X_DEFAULT, checkButtonBounds.height, GetClientAreaBounds().width, h_EditIconListView);
113
114         pAppResource = UiApp::GetInstance()->GetAppResource();
115         TryCatch(pAppResource != null, , "MfMyFilesApp::Resource manager not found!");
116
117         pAppResource->GetString(L"IDS_COM_BODY_SELECT_ALL", selectAll);
118         pAppResource->GetString(L"IDS_MF_SK3_EDIT" , headerText);
119
120         pHeader = GetHeader();
121
122         //Set FormBackEvent Listener
123         SetFormBackEventListener(this);
124         //AddOrientationEventListener(*this);
125
126         _fileProcessedCount = 0;
127
128         CreateFooterControls();
129
130         _pFileManager = FolderEntryEditorPresentationModel::GetInstance();
131         TryCatch(_pFileManager != null, , "Failed to allocate FileManager");
132
133         _pStrItemSelectedCount = new (std::nothrow) String();
134         TryCatch(_pStrItemSelectedCount != null, , "Failed to allocate __pNumberOfItemSelected");
135
136         _pThumbnailItemProvider = new (std::nothrow) ThumbnailItemProviderAndListener(_currentDirectoryPath, THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM);
137         _pThumbnailItemProvider->SetFolderEntryProvider(this);
138
139         _pEditIconListView = static_cast< IconListView* >(GetControl(L"IDC_ICONLISTVIEW_THUMBNAILS"));
140         if (_pEditIconListView != null)
141         {
142                 _pEditIconListView->SetShowState(false);
143                 _pEditIconListView->AddIconListViewItemEventListener(*this);
144                 _pEditIconListView->AddScrollEventListener(*this);
145                 _pEditIconListView->SetItemProvider(*_pThumbnailItemProvider);
146         }
147
148         _pBaseItemProvider = new (std::nothrow) BaseItemProvider();
149         TryCatch(_pBaseItemProvider != null, , "Failed to allocate base itemprovider");
150         _pBaseItemProvider->Construct();
151         _pBaseItemProvider->SetFolderEntryProvider(this);
152
153         _pEditListView = static_cast< ListView* >(GetControl(L"IDC_LISTVIEW1"));
154         if (_pEditListView != null)
155         {
156                 _pEditListView->AddListViewItemEventListener(*this);
157                 _pEditListView->AddScrollEventListener(*this);
158         }
159         r = _pCheckButtonSelectAll.Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_CHECKED);
160         r = _pCheckButtonSelectAll.SetText(selectAll);
161         if (pHeader != null)
162         {
163                 pHeader->SetTitleText(headerText);
164                 pHeader->AddActionEventListener(*this);
165                 pHeader->SetButton(BUTTON_POSITION_RIGHT, _pCheckButtonSelectAll);
166         }
167         CreateLabelControl();
168
169         _currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
170
171         AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
172         return r;
173
174 CATCH:
175         r = E_FAILURE;
176         AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
177         return r;
178 }
179
180 result
181 FileManageForm::OnTerminating(void)
182 {
183         AppLogDebug("Entry");
184         result r = E_SUCCESS;
185         RemoveFooter();
186         return r;
187 }
188
189
190 void
191 FileManageForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
192                                                                   const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
193 {
194         AppLogDebug("Entry");
195
196         int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
197         int folderCount = 0;
198         int fileCount = 0;
199
200         int thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM;
201
202         result r = E_SUCCESS;
203         _previousSceneId = previousSceneId;
204
205         AppRegistry* pAppRegistry = null;
206         AppResource* pAppResource = null;
207
208         String headerText;
209         String viewStyleKeyName(L"ListDisplayType");
210         FolderEntryPresentationModel* pcurrentFolderEntryPM = null;
211         Integer* pEditOrShare = null;
212         Header* pHeader = null;
213
214         pAppResource = UiApp::App::GetInstance()->GetAppResource();
215
216         Rectangle listViewBounds(X_DEFAULT, H_CHECK_BUTTON, GetClientAreaBounds().width, GetClientAreaBounds().height - H_CHECK_BUTTON);
217         ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
218         pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
219
220         r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
221         TryCatch(r == E_SUCCESS, , "Unable to get registry values");
222         DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
223 #if 0
224         DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
225 #endif
226
227         SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
228         _viewType = listViewDisplayType;
229
230         if (pArgs != null && previousSceneId != IDSCN_CREATE_FOLDER_FORM && (previousSceneId != IDSCN_SUB_DIRECTORY_MOVE_COPY_FORM && previousSceneId != IDSCN_SUB_DIRECTORY_MOVE_COPY_FORM1) )
231         {
232                 pEditOrShare = static_cast<Integer *>(pArgs->GetAt(0));
233                 _editOrShare = pEditOrShare->ToInt();
234
235                 pcurrentFolderEntryPM = static_cast<FolderEntryPresentationModel *>(pArgs->GetAt(1));
236                 TryCatch(pcurrentFolderEntryPM != null, , "FolderEntryPM is null");
237
238                 _pFolderEntryPM = pcurrentFolderEntryPM;
239                 _pBaseItemProvider->SetFolderEntryProvider(this);
240                 _pThumbnailItemProvider->SetFolderEntryProvider(this);
241
242                 if (_editOrShare == FILE_MANAGE_EDIT)
243                 {
244                         thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_FILE_MANAGE_FORM;
245
246                         if (pAppResource != null)
247                         {
248                                 pAppResource->GetString(L"IDS_MF_SK3_EDIT", headerText);
249                         }
250                         _pBaseItemProvider->SetSourceForm(CREATE_ITEM_SOURCE_FILE_MANAGE_FORM);
251                         if (previousSceneId != IDSCN_CATEGORY_SEARCH_FORM)
252                         {
253                                 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_FILE_MANAGE_FORM);
254                         }
255                         _pThumbnailItemProvider->SetCreateItemSource(thumbnailItemSource);
256                 }
257                 else
258                 {
259                         thumbnailItemSource = THUMBNAIL_PROVIDER_SOURCEID_SHARE_FORM;
260
261                         if (pAppResource != null)
262                         {
263                                 pAppResource->GetString(L"IDS_COM_BUTTON_SHARE", headerText);
264                         }
265                         _pBaseItemProvider->SetSourceForm(CREATE_ITEM_SOURCE_SHARE_FORM);
266                         if (previousSceneId != IDSCN_CATEGORY_SEARCH_FORM)
267                         {
268                                 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SHARE_FORM);
269                         }
270                         _pThumbnailItemProvider->SetCreateItemSource(thumbnailItemSource);
271
272                 }
273                 _pEditListView->SetItemProvider(*_pBaseItemProvider);
274
275                 _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(), folderCount, fileCount);
276
277                 pHeader = GetHeader();
278                 if (pHeader != null)
279                 {
280                         pHeader->SetTitleText(headerText);
281
282                         if (previousSceneId != IDSCN_CATEGORY_SEARCH_FORM)
283                         {
284                                 if (_editOrShare == FILE_MANAGE_SHARE)
285                                 {
286                                         if (fileCount == 0)
287                                         {
288                                                 pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
289                                         }
290                                         else
291                                         {
292                                                 pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
293                                         }
294                                 }
295                         }
296                         pHeader->Invalidate(true);
297                 }
298
299                 ToggleFooter();
300         }
301
302         if (_pFileManager != null)
303         {
304         _pFileManager->SetFileManagingListener(this);
305         }
306
307         if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
308         {
309                 if (pArgs == null)
310                 {
311                         __bCheckNullArgs = true;
312                 }
313                 else
314                 {
315                         __bCheckNullArgs = false;
316                 }
317         }
318         AppLogDebug("Exit %s", GetErrorMessage(r));
319         return;
320
321 CATCH:
322         if (_pFilenames != null)
323         {
324                 _pFilenames->RemoveAll(true);
325                 delete _pFilenames;
326                 _pFilenames = null;
327         }
328         AppLogDebug("Exit %s", GetErrorMessage(GetLastResult()));
329 }
330
331 void
332 FileManageForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
333                                                                    const Tizen::Ui::Scenes::SceneId& nextSceneId)
334 {
335         DeviceManager::RemoveAllDeviceEventListeners();
336         ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
337         _pFolderEntryPM->StopThumbnailManager(true);
338 }
339
340 void
341 FileManageForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
342 {
343         SubBaseOnActionPerformed(source, actionId);
344 }
345
346 void
347 FileManageForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
348 {
349         SubBaseOnListViewItemStateChanged(listView, index, elementId, status);
350 }
351
352 void
353 FileManageForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
354 {
355         //Empty Implementation.
356 }
357
358 void
359 FileManageForm::OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView& iconListView, int index, Tizen::Ui::Controls::IconListViewItemStatus status)
360 {
361         SubBaseOnIconListViewItemStateChanged(iconListView, index, status);
362 }
363
364 void
365 FileManageForm::OnIconListViewOverlayBitmapSelected (Tizen::Ui::Controls::IconListView &iconListView, int index, int overlayBitmapId)
366 {
367         if (overlayBitmapId == OVERLAYITEM_RENAME)
368         {
369                 _renameItemIndex = index;
370
371                 if (iconListView.IsItemChecked(index))
372                 {
373                         iconListView.SetItemChecked(index, false);
374                 }
375
376                 LoadRenameForm(index);
377         }
378         else
379                 _renameItemIndex = INVALID_LIST_INDEX;
380 }
381
382 void
383 FileManageForm::OnListViewItemStateChangedNotify(ViewType listViewStyle)
384 {
385         //Empty Implementation.
386 }
387
388 void
389 FileManageForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
390 {
391         AppLogDebug("ENTRY");
392         switch (orientationStatus)
393         {
394         case ORIENTATION_STATUS_PORTRAIT:
395         {
396         }
397         break;
398
399         case ORIENTATION_STATUS_LANDSCAPE:
400         {
401                 if (__previousSceneId != IDSCN_CATEGORY_SEARCH_FORM)
402                 {
403                         SceneManager* pSceneManager = null;
404                         pSceneManager = SceneManager::GetInstance();
405                         if (pSceneManager != null)
406                         {
407                                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SPLIT_PANEL_FILE_MANAGE_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE), null);
408                         }
409                 }
410         }
411         break;
412
413         default:
414         {
415                 //Do Nothing
416         }
417         break;
418         }
419 }
420
421 void
422 FileManageForm::OnFileManagingStart(void)
423 {
424         //ShowFileProgressingPopup();
425 }
426
427 void
428 FileManageForm::OnFileManagingStop(FileManagingResult fileManagingResult)
429 {
430         HideFileProgressingPopup();
431
432         switch (fileManagingResult)
433         {
434         case FILE_MANAGING_RESULT_DELETING_SUCCESS:
435         {
436                 SceneManager* pSceneManager = SceneManager::GetInstance();
437                 if (pSceneManager != null)
438                 {
439                         pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
440                 }
441         }
442         break;
443
444         default:
445         {
446                 //Do Nothing.
447         }
448         break;
449         }
450 }
451
452 void
453 FileManageForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs)
454 {
455         SubBaseOnNotificationReceived(pArgs);
456 }
457
458 void
459 FileManageForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
460 {
461         SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
462 }
463
464 void
465 FileManageForm::OnThumbnailReceived(ThumbRequest* pThumbReq)
466 {
467         SubBaseOnThumbnailReceived(pThumbReq);
468 }
469
470 FolderEntryPresentationModel*
471 FileManageForm::GetFolderEntryPresentationModel(void)
472 {
473         return _pFolderEntryPM;
474 }
475
476 void
477 FileManageForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
478 {
479         bool setMediaPath = false;
480         MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
481         String unmounted = sdCardStatusUnmounted;
482         String removed = usbDeviceStatusRemoved;
483         String currentPath;
484
485         SceneManager* pSceneManager = null;
486
487         if (state == unmounted || state == removed)
488         {
489                 if (_previousSceneId == IDSCN_CATEGORY_SEARCH_FORM)
490                 {
491                         if (_pFolderEntryPM != null)
492                         {
493                                 if (_pFolderEntryPM->GetDeviceListCount() > 1)
494                                 {
495                                         SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
496                                         return;
497                                 }
498                         }
499                 }
500
501                 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
502                 if (state == unmounted)
503                 {
504                         if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
505                         {
506                                 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
507                                 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
508                                 setMediaPath = true;
509                         }
510                 }
511
512                 if (state == removed)
513                 {
514                         if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
515                         {
516                                 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
517                                 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
518                                 setMediaPath = true;
519                         }
520                 }
521
522                 if (setMediaPath)
523                 {
524                         pSceneManager = SceneManager::GetInstance();
525                         if (pSceneManager != null)
526                         {
527                                 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
528                         }
529                 }
530         }
531 }
532
533 void
534 FileManageForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
535 {
536
537         ComponentType currentDeviceType;
538         switch (deviceType)
539         {
540         case StorageCard:
541         {
542                 currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
543         }
544         break;
545
546         case UsbClient:
547         {
548                 currentDeviceType = COMPONENT_TYPE_USB;
549         }
550         break;
551
552         default:
553         {
554                 //Do Nothing.
555         }
556         break;
557         }
558         OnDeviceChange(currentDeviceType, state);
559 }
560
561 void
562 FileManageForm::OnScrollEndReached(Tizen::Ui::Control& source, Tizen::Ui::Controls::ScrollEndEvent type)
563 {
564         if (type == SCROLL_END_EVENT_END_BOTTOM)
565         {
566                 __bScrollFlag = true;
567         }
568         else
569         {
570                 __bScrollFlag = false;
571         }
572 }
573
574 void
575 FileManageForm::OnScrollPositionChanged(Tizen::Ui::Control& source, int scrollPos)
576 {
577         //Empty Implementation.
578 }
579
580 void
581 FileManageForm::OnScrollStopped(Tizen::Ui::Control& source)
582 {
583         //Empty Implementation.
584 }
585
586 void
587 FileManageForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
588                 const Tizen::Ui::Scenes::SceneId &currentSceneId)
589 {
590         AppLogDebug("Enter");
591
592         Integer* pRenameItemIndex = null;
593         const DirectoryEntry* pDir = null;
594         DirectoryEntry* pDirectoryEntry = null;
595         Integer pReceivedStorageType;
596
597         __previousSceneId = previousSceneId;
598         SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
599
600         if (previousSceneId != IDSCN_CREATE_FOLDER_FORM)
601         {
602                 if (_pFolderEntryPM != null)
603                 {
604                         _pFilenames = _pFolderEntryPM->GetFolderEntryList();
605                 }
606
607                 if (_pFileManager != null)
608                 {
609                         if (_pFileManager->GetCheckedListCount() != 0)
610                         {
611                                 _pFileManager->ClearCheckedList();
612                         }
613                                                 _isSelectAll = false;
614                 }
615
616                 if (_pLabelNumberOfItems != null)
617                 {
618                         _pLabelNumberOfItems->SetShowState(false);
619                 }
620
621                 SetFooterVisibility(DISABLE_FOOTER_ITEM);
622
623
624
625                 if (_pEditListView != null && _pEditIconListView != null)
626                 {
627                         for (int itemCount = 0; itemCount < _pFilenames->GetCount(); itemCount++)
628                         {
629                                 if (_pEditListView->IsItemChecked(itemCount) == true)
630                                 {
631                                         _pEditListView->SetItemChecked(itemCount, false);
632                                 }
633
634                                 if (_pEditIconListView->IsItemChecked(itemCount) == true)
635                                 {
636                                         _pEditIconListView->SetItemChecked(itemCount, false);
637                                 }
638                         }
639                 }
640
641         }
642
643         if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
644         {
645                 if (_renameItemIndex != INVALID_LIST_INDEX && _pFileManager != null)
646                 {
647                         AppLogDebug("checked entry count is %d", _pFileManager->GetCheckedListCount());
648                         if (_pEditListView != null && _pEditListView->IsVisible())
649                         {
650                                 if (__bCheckNullArgs)
651                                 {
652                                         _pEditListView->RefreshList(_renameItemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
653                                 }
654                         }
655                         if (_pEditIconListView != null && _pEditIconListView->IsVisible())
656                         {
657                                 _pEditIconListView->RefreshList(_renameItemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
658                         }
659                         pRenameItemIndex = new (std::nothrow) Integer(_renameItemIndex);
660
661                         pDir = static_cast< const DirectoryEntry* >(_pFileManager->GetCheckedList()->GetValue(*pRenameItemIndex));
662                         if (pDir != null)
663                         {
664                                 pDirectoryEntry = static_cast< DirectoryEntry* >(_pFilenames->GetAt(_renameItemIndex));
665                                 TryCatch(pDirectoryEntry != null, , "r = E_FAILURE pDirectoryEntry is null");
666
667                                 _pFileManager->RemoveCheckedListEntry(_renameItemIndex);
668                                 _pFileManager->AddCheckedListEntry(_renameItemIndex, pDirectoryEntry);
669
670                                 if (_pEditIconListView != null && _pEditIconListView->IsVisible())
671                                 {
672                                         _pEditIconListView->SetItemChecked(_renameItemIndex, true);
673                                 }
674                         }
675
676                         delete pRenameItemIndex;
677
678                 }
679         }
680         else
681         {
682                 switch (_viewType)
683                 {
684                 case VIEW_TYPE_AS_DETAILED_LIST:
685                 {
686                         if (_pEditIconListView != null && _pEditIconListView->IsVisible())
687                         {
688                                 _pEditIconListView->SetShowState(false);
689                         }
690                         if (_pEditListView != null)
691                         {
692                                 _pEditListView->ScrollToItem(0);
693                                 _pEditListView->UpdateList();
694                                 _pEditListView->SetShowState(true);
695                         }
696                 }
697                 break;
698
699                 case VIEW_TYPE_AS_NORMAL_LIST:
700                 {
701                         if (_pEditIconListView != null && _pEditIconListView->IsVisible())
702                         {
703                                 _pEditIconListView->SetShowState(false);
704                         }
705
706                         if (_pEditListView != null)
707                         {
708                                 _pEditListView->ScrollToItem(0);
709                                 _pEditListView->UpdateList();
710                                 _pEditListView->SetShowState(true);
711                         }
712                 }
713                 break;
714
715                 case VIEW_TYPE_AS_THUMBNAILS:
716                 {
717                         if (_pEditListView != null && _pEditListView->IsVisible())
718                         {
719                                 _pEditListView->SetShowState(false);
720                         }
721                         if (_pEditIconListView != null)
722                         {
723                                 _pEditIconListView->ScrollToItem(0);
724                                 _pEditIconListView->UpdateList();
725                                 _pEditIconListView->SetShowState(true);
726                         }
727                 }
728                 break;
729
730                 default:
731                 {
732                         if (_pEditListView != null)
733                         {
734                                 _pEditListView->UpdateList();
735                                 _pEditListView->SetShowState(true);
736                         }
737                         if (_pEditIconListView != null && _pEditIconListView->IsVisible())
738                         {
739                                 _pEditIconListView->SetShowState(false);
740                         }
741                 }
742                 break;
743                 }
744         }
745         if (_pLabelNumberOfItems != null && _pLabelNumberOfItems->GetShowState() == true)
746         {
747                 if (_pEditIconListView != null && _pEditIconListView->IsVisible())
748                 {
749                         _pEditIconListView->SetBounds(Rectangle(X_DEFAULT, Y_DEFAULT, GetClientAreaBounds().width, GetClientAreaBounds().height  - H_DISPLAY_PATH_LABEL));
750
751                         _pEditIconListView->Invalidate(true);
752                 }
753
754                 if (_pEditListView != null && _pEditListView->IsVisible())
755                 {
756                         _pEditListView->SetBounds(Rectangle(X_DEFAULT, Y_DEFAULT, GetClientAreaBounds().width, GetClientAreaBounds().height  - H_DISPLAY_PATH_LABEL));
757
758                         _pEditListView->Invalidate(true);
759                 }
760         }
761         else
762         {
763                 if (_pEditIconListView != null && _pEditIconListView->IsVisible())
764                 {
765                         _pEditIconListView->SetBounds(Rectangle(X_DEFAULT, Y_DEFAULT, GetClientAreaBounds().width, GetClientAreaBounds().height));
766
767                         _pEditIconListView->Invalidate(true);
768                 }
769
770                 if (_pEditListView != null && _pEditListView->IsVisible())
771                 {
772                         _pEditListView->SetBounds(Rectangle(X_DEFAULT, Y_DEFAULT, GetClientAreaBounds().width, GetClientAreaBounds().height));
773
774                         _pEditListView->Invalidate(true);
775                 }
776         }
777         _pFolderEntryPM->InitThumbnailManager();
778         return;
779
780 CATCH:
781         return;
782 }
783
784 void
785 FileManageForm::OnSceneTransitionStarted(const Tizen::Ui::Scenes::SceneId &currentSceneId,
786                 const Tizen::Ui::Scenes::SceneId &nextSceneId)
787 {
788         //Empty Implementation.
789 }