2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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 GlBaseForm.cpp
19 * @brief This is the implementation file for GlBaseForm class.
27 #include "GlFileListPresentationModel.h"
28 #include "GlBaseForm.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Ui::Controls;
33 using namespace Tizen::Base::Utility;
36 IList* BaseForm::GetMoveFileIndexList(String& moveDir, IList* pMoveIndexList,
37 FileListPresentationModel* pPresentationModel)
40 if (&moveDir == null || moveDir.IsEmpty())
42 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
46 if (pMoveIndexList == null || pMoveIndexList->GetCount() <= 0)
48 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
52 IList* pCollisionList = pPresentationModel->GetCollisionIndexListN(*pMoveIndexList, moveDir);
54 if (pCollisionList != null)
56 int loopCount = pCollisionList->GetCount();
57 for (int i = 0; i < loopCount; ++i)
59 String* pCollisionString = const_cast<String*>(static_cast<const String*>(pCollisionList->GetAt(i)));
62 if (pCollisionString != null)
64 tmpString = (*pCollisionString);
67 String delim(MULTI_ITEM_SEPARATOR);
68 StringTokenizer st(tmpString, delim);
74 if (st.HasMoreTokens() == true)
76 st.GetNextToken(token);
77 Integer::Parse(token, collisionIndex);
79 if (st.HasMoreTokens() == true)
81 st.GetNextToken(fileNmae);
84 MessageBox messageBox;
85 messageBox.Construct(L"", fileNmae + ResourceManager::GetString(L"IDS_MEDIABR_POP_ALREADY_EXISTS_OVERWRITE_Q"),
86 MSGBOX_STYLE_YESNO, 0);
89 messageBox.ShowAndWait(modalResult);
92 if (modalResult == MSGBOX_RESULT_NO)
94 int innerLoopCount = pMoveIndexList->GetCount();
95 for (int j = 0; j < innerLoopCount; ++j)
97 if (collisionIndex == (const_cast<Integer*>(static_cast<const Integer*>
98 (pMoveIndexList->GetAt(j))))->ToInt())
100 pMoveIndexList->RemoveAt(j, true);
109 return pMoveIndexList;