resourcemgmt/hwresourcesmgr/test/mocksy/inc/rmocksy.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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 RMOCKSY_H
       
    17 #define RMOCKSY_H
       
    18 
       
    19 #include <e32def.h>
       
    20 #include <e32base.h>
       
    21 
       
    22 /**
       
    23 Base class for a Mock SY session
       
    24 Must be sub-class for specific types of SY and implement specific Expect and Complete
       
    25 public methods 
       
    26 
       
    27 */
       
    28 class RMockSY : public RSessionBase
       
    29 	{
       
    30 public:
       
    31 	enum TMessage
       
    32 		{
       
    33 		KExpect =1,
       
    34 		KComplete,
       
    35 		KNotifyTerminated,
       
    36 		KGetNextLogLine,
       
    37 		KGetStatus
       
    38 		};	
       
    39 
       
    40 	IMPORT_C TInt Connect();	
       
    41 	IMPORT_C void NotifyTerminated(TRequestStatus& aStatus);	
       
    42 	IMPORT_C void GetNextLogLine(TDes& aLine);
       
    43 	IMPORT_C void GetStatus(TBool& aHasWaitingExpect, TBool& aHasPendingComplete,TBool& aHasError);
       
    44 
       
    45 protected:
       
    46 	virtual const TDesC& ServerName() =0;
       
    47 
       
    48 protected:
       
    49 	IMPORT_C void DoExpect(TInt aCmdId, TInt aErrorCode, TBool aLeave, const TDesC8& aData);
       
    50 	IMPORT_C void DoComplete(TInt aCmdId, TInt aErrorCode, TInt aDelay, const TDesC8& aData);
       
    51 
       
    52 	};
       
    53 #endif