2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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
8 // http://floralicense.org/license/
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.
18 * @file GlFileUpdateTimer.cpp
19 * @brief This is the source file for FileUpdateTimer class.
22 #include "GlFileUpdateTimer.h"
23 #include "GlFileListPresentationModel.h"
25 using namespace Tizen::Base;
26 using namespace Tizen::Base::Collection;
27 using namespace Tizen::Base::Utility;
28 using namespace Tizen::Content;
29 using namespace Tizen::Io;
30 using namespace Tizen::Ui;
31 using namespace Tizen::Ui::Controls;
32 using namespace Tizen::Ui::Scenes;
34 FileUpdateTimer::FileUpdateTimer(Tizen::Base::Collection::IList* pDelList
35 , IContentFileUpdateManager* pFDM
36 , IFileOpInvalidateListener* invalidate
37 , FileActionMode actionId
38 , RotateMode rotateMode)
39 : GlTimerBase(invalidate, actionId)
40 , __pUpdateIndexList(pDelList)
41 , __pFileUpdateManager(pFDM)
42 , __rotateMode(rotateMode)
46 FileUpdateTimer::~FileUpdateTimer(void)
48 if (_actionId == FILE_ACTION_DELETE)
50 delete __pUpdateIndexList;
55 FileUpdateTimer::TimerStart(void)
57 if (_actionId == FILE_ACTION_DELETE)
59 return __pFileUpdateManager->GetContentIdListAtIndexN(*__pUpdateIndexList);
63 return __pUpdateIndexList;
68 FileUpdateTimer::TimerExpired(const Object* contentId)
70 if (_actionId == FILE_ACTION_DELETE)
72 return __pFileUpdateManager->DeleteContentFile(*(static_cast<const ContentId*>(contentId)));
77 const Integer* pIndex = static_cast<const Integer*>(contentId);
80 r = __pFileUpdateManager->RotateImage(pIndex->ToInt(), __rotateMode);
83 __pFileUpdateManager->RequestThumbnail(pIndex->ToInt()); // do not request thumbnail for video files
87 r = E_SUCCESS; // to skip if file is not rotated, the processing bar should move,rotate next file