|
1 // Copyright (c) 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 CMTPIMAGEDPCOPYOBJECT_H |
|
22 #define CMTPIMAGEDPCOPYOBJECT_H |
|
23 |
|
24 #include "cmtprequestprocessor.h" |
|
25 #include "cmtpimagedpobjectpropertymgr.h" |
|
26 |
|
27 class RFs; |
|
28 class CFileMan; |
|
29 class CMTPObjectMetaData; |
|
30 class CMTPImageDataProvider; |
|
31 |
|
32 |
|
33 class CMTPImageDpCopyObject : public CMTPRequestProcessor |
|
34 { |
|
35 public: |
|
36 static MMTPRequestProcessor* NewL( |
|
37 MMTPDataProviderFramework& aFramework, |
|
38 MMTPConnection& aConnection, |
|
39 CMTPImageDataProvider& aDataProvider); |
|
40 ~CMTPImageDpCopyObject(); |
|
41 |
|
42 private: |
|
43 CMTPImageDpCopyObject( |
|
44 MMTPDataProviderFramework& aFramework, |
|
45 MMTPConnection& aConnection, |
|
46 CMTPImageDataProvider& aDataProvider); |
|
47 |
|
48 private: //from CMTPRequestProcessor |
|
49 virtual void ServiceL(); |
|
50 virtual TMTPResponseCode CheckRequestL(); |
|
51 static void FailRecover(TAny* aCopyOperation); |
|
52 void RollBack(); |
|
53 void RollBackFromFsL(); |
|
54 static void RollBackFromFsL(CMTPImageDpCopyObject* aObject); |
|
55 |
|
56 private: |
|
57 void ConstructL(); |
|
58 void GetParametersL(); |
|
59 void SetDefaultParentObjectL(); |
|
60 TMTPResponseCode CopyObjectL(TUint32& aNewHandle); |
|
61 TMTPResponseCode CanCopyObjectL(const TDesC& aOldName, const TDesC& aNewName) const; |
|
62 void GetPreviousPropertiesL(const TDesC& aOldFileName); |
|
63 void SetPreviousPropertiesL(const TDesC& aNewFileName); |
|
64 TUint32 CopyFileL(const TDesC& aOldFileName, const TDesC& aNewFileName); |
|
65 void FailRecover(); |
|
66 TUint32 UpdateObjectInfoL(const TDesC& aNewObject); |
|
67 |
|
68 private: |
|
69 typedef void (*RollbackFuncL)(CMTPImageDpCopyObject* aObject); |
|
70 RArray<RollbackFuncL> iRollbackActionL; |
|
71 CFileMan* iFileMan; |
|
72 CMTPObjectMetaData* iSrcObjectInfo; |
|
73 CMTPObjectMetaData* iTargetObjectInfo; |
|
74 HBufC* iDest; |
|
75 TUint32 iNewParentHandle; |
|
76 TUint32 iStorageId; |
|
77 TFileName iNewFileName; |
|
78 CMTPImageDataProvider& iDataProvider; |
|
79 |
|
80 /* |
|
81 TUint16 iSampleFormat; |
|
82 TUint32 iSampleSize; |
|
83 TUint32 iSampleHeight; |
|
84 TUint32 iSampleWidth; |
|
85 this is currently hard coded so doesn't copy these |
|
86 */ |
|
87 TTime iDateModified; |
|
88 /** |
|
89 FLOGGER debug trace member variable. |
|
90 */ |
|
91 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
92 }; |
|
93 |
|
94 #endif //CMTPIMAGEDPCOPYOBJECT_H |
|
95 |