multimediacommsengine/tsrc/MMCTestDriver/MCETester/inc/CTcMCEEventAPIObserver.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:    See class definition below.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CTcMCEEventAPIObserver_H__
       
    21 #define __CTcMCEEventAPIObserver_H__
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <MCEEventObserver.h>
       
    26 #include <MceInEventObserver.h>
       
    27 #include <MCEReferObserver.h>
       
    28 #include <MceInReferObserver.h>
       
    29 #include "CTcMCEReceiveQueue.h"
       
    30 
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CTcMCEContext;
       
    34 class CMceEvent;
       
    35 class CMceInEvent;
       
    36 class CMceRefer;
       
    37 class CMceInRefer;
       
    38 class TMceTransactionDataContainer;
       
    39 	
       
    40 
       
    41 // CLASS DEFINITION
       
    42 /**
       
    43  * CTcMCEEventAPIObserver observes all events defined in 
       
    44  * multimedia API.
       
    45  */
       
    46 
       
    47 class CTcMCEEventAPIObserver
       
    48 	: public CBase,
       
    49 	  public MMceEventObserver,
       
    50 	  public MMceInEventObserver,
       
    51 	  public MMceReferObserver,
       
    52 	  public MMceInReferObserver	  
       
    53 	{
       
    54 	
       
    55 	public:	// Constructors and destructor
       
    56 
       
    57 		/**
       
    58 		 * Static constructor.
       
    59 		 *
       
    60 		 * @param aContext Reference to test context object.
       
    61 		 * @return An initialized instance of this class.
       
    62 		 */
       
    63 		static CTcMCEEventAPIObserver* NewL( CTcMCEContext& aContext );
       
    64 
       
    65 		/// Destructor
       
    66 		~CTcMCEEventAPIObserver();
       
    67 
       
    68 	private:
       
    69 
       
    70 		/**
       
    71 		 * Constructor.
       
    72 		 *
       
    73 		 * @param aContext Reference to test context object.
       
    74 		 */
       
    75 		CTcMCEEventAPIObserver( CTcMCEContext& aContext );
       
    76 
       
    77 		/// Default constructor. Not implemented.
       
    78 		CTcMCEEventAPIObserver();
       
    79 
       
    80 		/// 2nd phase constructor
       
    81 		void ConstructL();
       
    82 
       
    83 	public: // new functions
       
    84 
       
    85 		/**
       
    86 		 * Returns the first item off the Event receive queue (FIFO). 
       
    87 		 * If no items are present, the function will wait for aTimeout seconds
       
    88 		 * and then try fetching again.
       
    89 		 *
       
    90 		 * @param aTimeOut Time in seconds waited for items to arrive.
       
    91 		 */
       
    92 		CTcMCEReceived& ReceivedEventItemL( TInt aTimeout );
       
    93 
       
    94     public: // from MMceEventObserver
       
    95 
       
    96         void EventStateChanged(
       
    97         			CMceEvent& aEvent,
       
    98     				TMceTransactionDataContainer* aContainer );
       
    99 
       
   100 		void NotifyReceived(
       
   101 					CMceEvent& aEvent,
       
   102     				TMceTransactionDataContainer* aContainer );	
       
   103     
       
   104 
       
   105         void EventConnectionStateChanged(
       
   106 	                CMceEvent& aEvent,
       
   107 	                TBool aActive );
       
   108 
       
   109         void Failed( CMceEvent& aEvent, TInt aError );
       
   110 
       
   111     public: // from MMceInEventObserver
       
   112 
       
   113         void IncomingEvent(
       
   114 					CMceInEvent* aEvent,
       
   115     				TMceTransactionDataContainer* aContainer );
       
   116 		
       
   117     public: // from MMceReferObserver
       
   118     
       
   119         void ReferStateChanged(
       
   120         			CMceRefer& aRefer,
       
   121     				TMceTransactionDataContainer* aContainer );
       
   122 
       
   123         void ReferConnectionStateChanged(
       
   124 	                CMceRefer& aRefer,
       
   125 	                TBool aActive );
       
   126 
       
   127         void Failed( CMceRefer& aRefer, TInt aError );
       
   128     
       
   129     public: // from MMceInReferObserver
       
   130        
       
   131     	void IncomingRefer(
       
   132 					CMceInRefer* aRefer,
       
   133 					const TDesC8& aReferTo,
       
   134     				TMceTransactionDataContainer* aContainer );
       
   135         
       
   136 
       
   137 	private: // owned data
       
   138 	
       
   139 		CTcMCEReceiveQueue* iEventQueue;
       
   140 
       
   141 	private: // data
       
   142 
       
   143 		/// Reference to the test context.
       
   144 		CTcMCEContext& iContext;	    
       
   145 
       
   146 	};
       
   147 
       
   148 #endif // __CTcMCEEventAPIObserver_H__