testexecmdw/tef/tef/utils/inc/activecallback.h
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     1 /*
       
     2 * Copyright (c) 2005-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:  
       
    15 * @file
       
    16 * This contains ActiveCallback.h
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __ACTIVE_CALLBACK_H__
       
    23 #define __ACTIVE_CALLBACK_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 class MActiveCallback
       
    28 /**
       
    29  * @internalComponent
       
    30  * @test
       
    31  *
       
    32  * Asynchronus completion callback
       
    33  */
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	 * Method from which CActiveCallback informs the user RunL call
       
    38 	 *
       
    39 	 * @param	aActive - the object that the RunL has completed on
       
    40 	 * @param	aIndex - asynchronous command index
       
    41 	 *
       
    42 	 * @leave	system wide error
       
    43 	 */
       
    44 	virtual void	RunL(CActive* aActive, TInt aIndex) = 0;
       
    45 
       
    46 	/**
       
    47 	 * Method from which CActiveCallback informs the user DoCancel call
       
    48 	 *
       
    49 	 * @param	aActive - the object that the RunL has completed on
       
    50 	 * @param	aIndex - asynchronous command index
       
    51 	 *
       
    52 	 * @leave	system wide error
       
    53 	 */
       
    54 	virtual void	DoCancel(CActive* aActive, TInt aIndex) = 0;
       
    55 	};
       
    56 
       
    57 class CActiveCallback : public CActive
       
    58 /**
       
    59  * @internalComponent
       
    60  * @test
       
    61  *
       
    62  * @see		CActive
       
    63  *
       
    64  * Test Active Notification class
       
    65  *
       
    66  */
       
    67 	{
       
    68 public:
       
    69 	IMPORT_C virtual ~CActiveCallback();
       
    70 	IMPORT_C static CActiveCallback*	NewL(MActiveCallback& aCallback, TInt aPriority=EPriorityStandard);
       
    71 	IMPORT_C static CActiveCallback*	NewLC(MActiveCallback& aCallback, TInt aPriority=EPriorityStandard);
       
    72 
       
    73 	IMPORT_C void	Activate( TInt aIndex );
       
    74 	IMPORT_C void	KickState();
       
    75 	IMPORT_C void	RunL();
       
    76 	IMPORT_C void	DoCancel();
       
    77 
       
    78 protected:
       
    79 	IMPORT_C CActiveCallback(MActiveCallback& aCallback, TInt aPriority);
       
    80 	IMPORT_C void	ConstructL();
       
    81 
       
    82 private:
       
    83 	/**
       
    84 	* This is internal and not intended for use.
       
    85 	*/
       
    86 	MActiveCallback&	iCallback;
       
    87 	TInt				iIndex;
       
    88 	};
       
    89 
       
    90 #endif /* __ACTIVE_CALLBACK_H__ */