messagingfw/msgsrvnstore/server/inc/MSVROPS.H
changeset 22 bde600d88860
child 35 f8ad95794a08
child 40 320ec5cd0227
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     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  	inline void SetCapability(TBool aCap);
       
    77  	inline TBool Capability();
       
    78 #endif
       
    79 	//
       
    80 protected:
       
    81 	void DoCancel();
       
    82 	void RunL();
       
    83 	//
       
    84 private:
       
    85 	CMsvMtmOperation(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId, MMsvOperationObserver& aOpObserver);
       
    86 	void ConstructL();
       
    87 	//
       
    88 	void StoreParametersL(TMtmOpType aOpType, const TMsvEntry& aNewEntry);
       
    89 	void StoreParameters(TMtmOpType aOpType, CMsvEntrySelection* aSelection, TInt aIntParam, HBufC8* aDesParam);
       
    90 	void DoStartL(TBool aCapabilityCheck);
       
    91 	//
       
    92 private:
       
    93 	TMtmOpType iOpType;
       
    94 	CBaseServerMtm* iServerMtm;
       
    95 	MMsvOperationObserver& iOpObserver;
       
    96 	//
       
    97 	TMsvEntry* iEntry;
       
    98 	CMsvEntrySelection* iSelection;
       
    99 	TInt iIntParam;
       
   100 	HBufC* iBuf1;
       
   101 	HBufC* iBuf2;
       
   102 	HBufC8* iDesParam;
       
   103 #if (defined SYMBIAN_USER_PROMPT_SERVICE)	
       
   104  	TThreadId iThreadId;
       
   105  	TBool iHasCapability;
       
   106 #endif
       
   107 	};
       
   108 
       
   109 #include "MSVROPS.INL"
       
   110 
       
   111 #endif