|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef CMTPMOVEOBJECT_H |
|
22 #define CMTPMOVEOBJECT_H |
|
23 |
|
24 #include "cmtprequestprocessor.h" |
|
25 #include "mtpdebug.h" |
|
26 |
|
27 class CFileMan; |
|
28 class CMTPObjectMetaData; |
|
29 |
|
30 /** |
|
31 Defines data provider MoveObject request processor |
|
32 |
|
33 @internalTechnology |
|
34 */ |
|
35 class CMTPMoveObject : public CMTPRequestProcessor |
|
36 { |
|
37 public: |
|
38 IMPORT_C static MMTPRequestProcessor* NewL( |
|
39 MMTPDataProviderFramework& aFramework, |
|
40 MMTPConnection& aConnection); |
|
41 IMPORT_C ~CMTPMoveObject(); |
|
42 |
|
43 private: |
|
44 CMTPMoveObject( |
|
45 MMTPDataProviderFramework& aFramework, |
|
46 MMTPConnection& aConnection); |
|
47 |
|
48 private: //from CMTPRequestProcessor |
|
49 virtual void ServiceL(); |
|
50 |
|
51 private: //from CActive |
|
52 void RunL(); |
|
53 TInt RunError(TInt aError); |
|
54 |
|
55 private: |
|
56 void ConstructL(); |
|
57 void GetParametersL(); |
|
58 void SetDefaultParentObjectL(); |
|
59 TMTPResponseCode MoveObjectL(); |
|
60 TMTPResponseCode CanMoveObjectL(const TDesC& aOldName, const TDesC& aNewName) const; |
|
61 void GetPreviousPropertiesL(const TDesC& aFileName); |
|
62 void SetPreviousPropertiesL(const TDesC& aFileName); |
|
63 void MoveFileL(const TDesC& aNewFileName); |
|
64 void MoveFolderL(); |
|
65 TMTPResponseCode FinalPhaseMove(); |
|
66 void MoveAndUpdateL(TUint32 objectHandle); |
|
67 |
|
68 private: |
|
69 CFileMan* iFileMan; |
|
70 CMTPObjectMetaData* iObjectInfo; //Not owned. |
|
71 HBufC* iDest; |
|
72 HBufC* iNewRootFolder; |
|
73 TUint32 iNewParentHandle; |
|
74 TUint32 iStorageId; |
|
75 TTime iPreviousModifiedTime; |
|
76 HBufC* iPathToMove; |
|
77 RArray<TUint> iObjectHandles; |
|
78 TInt iMoveObjectIndex; |
|
79 |
|
80 /** |
|
81 FLOGGER debug trace member variable. |
|
82 */ |
|
83 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
84 }; |
|
85 |
|
86 #endif |
|
87 |