|
1 // Copyright (c) 1998-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 #if !defined(__MSVROPS_H__) |
|
17 #define __MSVROPS_H__ |
|
18 |
|
19 #if !defined(__E32BASE_H__) |
|
20 #include <e32base.h> |
|
21 #endif |
|
22 |
|
23 #if !defined(__MSVOP_H__) |
|
24 #include "MSVOP.H" |
|
25 #endif |
|
26 |
|
27 class CBaseServerMtm; |
|
28 |
|
29 //********************************** |
|
30 // CMsvMtmOperation |
|
31 //********************************** |
|
32 // |
|
33 // |
|
34 // |
|
35 class CMsvMtmOperation : public CMsvServerOperation |
|
36 /** |
|
37 @internalComponent |
|
38 @released |
|
39 */ |
|
40 { |
|
41 private: |
|
42 enum TMtmOpType { EMtmOpNone, |
|
43 EMtmOpCopyToLocal, |
|
44 EMtmOpCopyFromLocal, |
|
45 EMtmOpCopyWithinService, |
|
46 EMtmOpMoveToLocal, |
|
47 EMtmOpMoveFromLocal, |
|
48 EMtmOpMoveWithinService, |
|
49 EMtmOpDeleteAll, |
|
50 EMtmOpCreate, |
|
51 EMtmOpChange, |
|
52 EMtmOpCommand}; |
|
53 public: |
|
54 static CMsvMtmOperation* NewL(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId, MMsvOperationObserver& aOpObserver); |
|
55 ~CMsvMtmOperation(); |
|
56 // from CMsvServerOperation |
|
57 const TDesC8& Progress(); |
|
58 TInt SystemProgress(TMsvSystemProgress& aSysProgress); |
|
59 // general start function |
|
60 void Start(CBaseServerMtm& aMtm, TBool aCapabilityCheck); |
|
61 void Failed(TInt aError); |
|
62 // |
|
63 // various operation that can be done |
|
64 inline void CopyToLocal(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
65 inline void CopyFromLocal(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
66 inline void CopyWithinService(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
67 inline void MoveToLocal(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
68 inline void MoveFromLocal(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
69 inline void MoveWithinService(CMsvEntrySelection* aSelection, TMsvId aDestination); |
|
70 inline void DeleteAll(CMsvEntrySelection* aSelection); |
|
71 inline void CreateL(const TMsvEntry& aNewEntry); |
|
72 inline void ChangeL(const TMsvEntry& aNewEntry); |
|
73 inline void StartCommand(CMsvEntrySelection* aSelection, TInt aCommand, HBufC8* aParameter); |
|
74 #if (defined SYMBIAN_USER_PROMPT_SERVICE) |
|
75 inline void SetThreadId(TThreadId aThreadId); |
|
76 #endif |
|
77 // |
|
78 protected: |
|
79 void DoCancel(); |
|
80 void RunL(); |
|
81 // |
|
82 private: |
|
83 CMsvMtmOperation(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId, MMsvOperationObserver& aOpObserver); |
|
84 void ConstructL(); |
|
85 // |
|
86 void StoreParametersL(TMtmOpType aOpType, const TMsvEntry& aNewEntry); |
|
87 void StoreParameters(TMtmOpType aOpType, CMsvEntrySelection* aSelection, TInt aIntParam, HBufC8* aDesParam); |
|
88 void DoStartL(TBool aCapabilityCheck); |
|
89 // |
|
90 private: |
|
91 TMtmOpType iOpType; |
|
92 CBaseServerMtm* iServerMtm; |
|
93 MMsvOperationObserver& iOpObserver; |
|
94 // |
|
95 TMsvEntry* iEntry; |
|
96 CMsvEntrySelection* iSelection; |
|
97 TInt iIntParam; |
|
98 HBufC* iBuf1; |
|
99 HBufC* iBuf2; |
|
100 HBufC8* iDesParam; |
|
101 #if (defined SYMBIAN_USER_PROMPT_SERVICE) |
|
102 TThreadId iThreadId; |
|
103 #endif |
|
104 }; |
|
105 |
|
106 #include "MSVROPS.INL" |
|
107 |
|
108 #endif |