messagingappbase/obexmtms/irmtm/irclient/include/CIRCancelObserver.h
changeset 31 ebfee66fde93
parent 0 72b543305e3a
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 // Copyright (c) 2004-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 #ifndef __CIRCANCELOBSERVER_H__
       
    17 #define __CIRCANCELOBSERVER_H__
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <msvapi.h>
       
    21 
       
    22 /**
       
    23 This class is a CMsvOperation used to clean up entries for operations that have been queued.
       
    24 The IR server mtm only takes ownership for entries once the operation has started so this object is provided 
       
    25 as a wrapper to to the send operation to own entries for queued IR operations. The entries are only cleaned
       
    26 up if the operation has not started and only when the operation is explicitly cancelled by the user.
       
    27 @internalComponent
       
    28 */
       
    29 class CIRCancelObserver : public CMsvOperation
       
    30 	{
       
    31 public:
       
    32 	static CIRCancelObserver* NewL(TRequestStatus& aObserverRequestStatus, CMsvSession& aSession, TMsvId aEntry);
       
    33 	virtual ~CIRCancelObserver();
       
    34 
       
    35 	TRequestStatus& Status();
       
    36 	void SetOperation(CMsvOperation* aMsvOperation);
       
    37 	
       
    38 	// from CMsvOperation
       
    39 	virtual const TDesC8& ProgressL();
       
    40 	virtual const TDesC8& FinalProgress();
       
    41 
       
    42 private:
       
    43 	CIRCancelObserver(TRequestStatus& aObserverRequestStatus, CMsvSession& aSession, TMsvId aEntry);
       
    44 	void CleanupEntryL() const;
       
    45 	void CleanupEntry() const;
       
    46 
       
    47 	// from CActive
       
    48 	void DoCancel();
       
    49 	void RunL();
       
    50 	TInt RunError(TInt aError);
       
    51 
       
    52 private:
       
    53 	/** The entry id for the entry of the IR operation.*/
       
    54 	TMsvId iEntryId;
       
    55 	
       
    56 	/** The send operation that this class owns and encapsulates.*/
       
    57 	CMsvOperation* iMsvOperation;
       
    58 
       
    59 	/** Flag to indicate if the operation has started.*/
       
    60 	TBool iOperationStarted;
       
    61 	};
       
    62 
       
    63 #endif // __CIRCANCELOBSERVER_H__