messagingfw/msgsrvnstore/server/inc/MSVROPS.H
changeset 62 db3f5fa34ec7
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     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 						EMtmOpChangeEntries};
       
    54 public:
       
    55 	static CMsvMtmOperation* NewL(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId, MMsvOperationObserver& aOpObserver);
       
    56 	~CMsvMtmOperation();
       
    57 	// from CMsvServerOperation
       
    58 	const TDesC8& Progress();
       
    59 	TInt SystemProgress(TMsvSystemProgress& aSysProgress);
       
    60 	// general start function
       
    61 	void Start(CBaseServerMtm& aMtm, TBool aCapabilityCheck);
       
    62 	void Failed(TInt aError);
       
    63 	// 
       
    64 	// various operation that can be done
       
    65 	inline void CopyToLocal(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    66 	inline void CopyFromLocal(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    67 	inline void CopyWithinService(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    68 	inline void MoveToLocal(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    69 	inline void MoveFromLocal(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    70 	inline void MoveWithinService(CMsvEntrySelection* aSelection, TMsvId aDestination);
       
    71 	inline void DeleteAll(CMsvEntrySelection* aSelection);
       
    72 	inline void CreateL(const TMsvEntry& aNewEntry);
       
    73 	inline void ChangeL(const TMsvEntry& aNewEntry);
       
    74 	inline void ChangeEntriesL(CMsvEntrySelection* aSelection, TInt aMark);
       
    75 	inline void StartCommand(CMsvEntrySelection* aSelection, TInt aCommand, HBufC8* aParameter);
       
    76 #if (defined SYMBIAN_USER_PROMPT_SERVICE)	
       
    77  	inline void SetThreadId(TThreadId aThreadId);
       
    78  	inline void SetCapability(TBool aCap);
       
    79  	inline TBool Capability();
       
    80 #endif
       
    81 	//
       
    82 protected:
       
    83 	void DoCancel();
       
    84 	void RunL();
       
    85 	//
       
    86 private:
       
    87 	CMsvMtmOperation(const RMessage2& aMessage, TMsvOp aId, TUid aMtmUid, TMsvId aServiceId, TInt aSessionId, MMsvOperationObserver& aOpObserver);
       
    88 	void ConstructL();
       
    89 	//
       
    90 	void StoreParametersL(TMtmOpType aOpType, const TMsvEntry& aNewEntry);
       
    91 	void StoreParameters(TMtmOpType aOpType, CMsvEntrySelection* aSelection, TInt aIntParam, HBufC8* aDesParam);
       
    92 	void DoStartL(TBool aCapabilityCheck);
       
    93 	//
       
    94 private:
       
    95 	TMtmOpType iOpType;
       
    96 	CBaseServerMtm* iServerMtm;
       
    97 	MMsvOperationObserver& iOpObserver;
       
    98 	//
       
    99 	TMsvEntry* iEntry;
       
   100 	CMsvEntrySelection* iSelection;
       
   101 	TInt iIntParam;
       
   102 	HBufC* iBuf1;
       
   103 	HBufC* iBuf2;
       
   104 	HBufC8* iDesParam;
       
   105 #if (defined SYMBIAN_USER_PROMPT_SERVICE)	
       
   106  	TThreadId iThreadId;
       
   107  	TBool iHasCapability;
       
   108 #endif
       
   109 	};
       
   110 
       
   111 #include "MSVROPS.INL"
       
   112 
       
   113 #endif