|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Rename object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CRENAMEOBJECT_H |
|
20 #define CRENAMEOBJECT_H |
|
21 |
|
22 // Forward declarations |
|
23 class MMTPDataProviderFramework; |
|
24 class CMmMtpDpMetadataAccessWrapper; |
|
25 class MMTPObjectMgr; |
|
26 class CMTPObjectMetaData; |
|
27 |
|
28 class CRenameObject: public CActive |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * Two phase constructor |
|
33 * @param aFramework Reference to MMTPDataProviderFramework |
|
34 * @param aWrapper Reference to CMmMtpDpMetadataAccessWrapper |
|
35 * @return A pointer to a new instance of the object |
|
36 */ |
|
37 IMPORT_C static CRenameObject* NewL( MMTPDataProviderFramework& aFramework, |
|
38 CMmMtpDpMetadataAccessWrapper& aWrapper ); |
|
39 |
|
40 /** |
|
41 * destructor |
|
42 */ |
|
43 IMPORT_C virtual ~CRenameObject(); |
|
44 |
|
45 IMPORT_C void StartL( const TUint32 aParentHandle, |
|
46 const TDesC& aOldFolderName ); |
|
47 |
|
48 protected: |
|
49 /** |
|
50 * Standard C++ Constructor |
|
51 * @param aFramework Reference to MMTPDataProviderFramework |
|
52 * @param aWrapper Reference to CMmMtpDpMetadataAccessWrapper |
|
53 */ |
|
54 IMPORT_C CRenameObject( MMTPDataProviderFramework& aFramework, |
|
55 CMmMtpDpMetadataAccessWrapper& aWrapper ); |
|
56 |
|
57 IMPORT_C void ConstructL(); |
|
58 |
|
59 // added to perform additional action base on need |
|
60 virtual void PerformAdditionalActionL(); |
|
61 |
|
62 protected: |
|
63 // from CActive |
|
64 IMPORT_C void DoCancel(); |
|
65 |
|
66 IMPORT_C void RunL(); |
|
67 |
|
68 IMPORT_C TInt RunError( TInt aError ); |
|
69 |
|
70 private: |
|
71 |
|
72 void GenerateObjectHandleListL( TUint32 aParentHandle ); |
|
73 |
|
74 void GetParentSuidL( TUint32 aHandle, const TDesC& aFolderName ); |
|
75 |
|
76 protected: |
|
77 MMTPDataProviderFramework& iFramework; |
|
78 RArray<TUint> iObjectHandles; |
|
79 CMTPObjectMetaData* iObjectInfo; |
|
80 TInt iCount; |
|
81 TInt iIndex; |
|
82 RBuf iNewFolderName; |
|
83 RBuf iOldFolderFullName; |
|
84 RBuf iFileName; |
|
85 RBuf iRightPartName; |
|
86 RBuf iOldFileName; |
|
87 |
|
88 // Owned |
|
89 /** MMTPDataProviderFramework used to access MTP components*/ |
|
90 CMmMtpDpMetadataAccessWrapper& iWrapper; |
|
91 |
|
92 private: |
|
93 CActiveSchedulerWait* iRenameWaiter; |
|
94 TUint32 iParentHandle; |
|
95 }; |
|
96 |
|
97 #endif // CRENAMEOBJECT_H |