multimediacommsengine/tsrc/MMCTestDriver/MCETester/inc/CTcMCEReceived.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 __CTcMCEReceived_H__
       
    21 #define __CTcMCEReceived_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 #include <MCESession.h>
       
    27 #include <MCEEvent.h>
       
    28 #include <MCERefer.h>
       
    29 #include "MCEConstants.h"
       
    30 #include "MCEMediaStream.h"
       
    31 // FORWARD DECLARATIONS
       
    32 class CMceSession;
       
    33 class CMceInSession;
       
    34 class CMceEvent;
       
    35 class CMceInEvent;
       
    36 class CMceRefer;
       
    37 class CMceInRefer;
       
    38 class CMceMediaStream;
       
    39 class CMceMediaSource;
       
    40 class CMceMediaSink;
       
    41 class CMceRtpSource;
       
    42 class TMceTransactionDataContainer;
       
    43 
       
    44 // CLASS DEFINITION
       
    45 /**
       
    46  * CTcMCEReceived implements a container class for MCE notification messages.
       
    47  * Objects of this class are created and stored in MMCEManagerObserver,
       
    48  * MMceSessionObserver, MMceStreamObserver, MMceRtpObserver, MMceFcMsgObserver,
       
    49  * MMceEventObserver, MMceReferObserver and MMCESubscribeObserver observer 
       
    50  * functions.
       
    51  */
       
    52 class CTcMCEReceived: public CBase
       
    53 	{
       
    54 	public:	// Constructors and destructor
       
    55 
       
    56 		/// Default constructor
       
    57 		CTcMCEReceived();
       
    58 
       
    59 		/// Destructor
       
    60 		~CTcMCEReceived();
       
    61 
       
    62 	public: // New methods
       
    63 
       
    64 		
       
    65 		void SetSession( const CMceSession* aSession );
       
    66 		inline const CMceSession* Session() const
       
    67 				{ return iSession; }
       
    68 
       
    69 		void SetMediaStream( const CMceMediaStream* aMediaStream );
       
    70 		inline const CMceMediaStream* MediaStream() const
       
    71 				{ return iMediaStream; }
       
    72 				
       
    73 		void SetMediaSource( const CMceMediaSource* aMediaSource );
       
    74 		inline const CMceMediaSource* MediaSource() const
       
    75 				{ return iMediaSource; }		
       
    76 				
       
    77 		void SetMediaSink( const CMceMediaSink* aMediaSink );
       
    78 		inline const CMceMediaSink* MediaSink() const
       
    79 				{ return iMediaSink; }	
       
    80 
       
    81 		void SetRtpSource( const CMceRtpSource* aRtpSource );
       
    82 		inline const CMceRtpSource* RtpSource() const
       
    83 				{ return iRtpSource; }	
       
    84 
       
    85 		void SetInSession( CMceInSession* aInSession );
       
    86 		inline CMceInSession* InSession()
       
    87 				{return iInSession;};
       
    88 		void SetIncomingUpdateSession(CMceSession& aOrigSession,
       
    89 									CMceInSession* aInSession );
       
    90 	
       
    91 		void SetHeaders( CDesC8Array* aHeaders );
       
    92 		inline const CDesC8Array* Headers() const
       
    93 				{return iHeaders;};
       
    94 		
       
    95 		void SetContentType( HBufC8* aContentType );
       
    96 		inline const HBufC8* ContentType() const
       
    97 				{return iContentType;};
       
    98 	
       
    99 					
       
   100 		void SetBody( HBufC8* aBody);
       
   101 		inline const HBufC8* Body() const
       
   102 			{return iBody;};
       
   103 	
       
   104 		
       
   105 		void SetStatusCode( TInt32 aStatusCode );
       
   106 		inline TInt StatusCode() const
       
   107 			{return iStatusCode;};
       
   108 	
       
   109 		
       
   110 		void SetReasonPhrase( HBufC8* aReasonPhrase);
       
   111 		inline const HBufC8* ReasonPhrase() const
       
   112 				{return iReasonPhrase;};
       
   113 	
       
   114 	
       
   115 		void SetFCMessage( HBufC8* aFCMessage);
       
   116 		inline const HBufC8* FCMessage() const
       
   117 				{return iFCMessage;};
       
   118 	
       
   119 	
       
   120 		void SetEvent( const CMceEvent* aEvent );
       
   121 		inline const CMceEvent* Event() const
       
   122 				{return iEvent;};
       
   123 
       
   124 				
       
   125 		void SetInEvent( CMceInEvent* aInEvent );	
       
   126 		inline const CMceInEvent* InEvent() const
       
   127 				{return iInEvent;};
       
   128 
       
   129 
       
   130         void SetRefer( CMceRefer* aRefer );
       
   131         inline const CMceRefer* Refer() const
       
   132                 {return iRefer;};
       
   133 
       
   134         
       
   135         void SetInRefer( CMceInRefer* aInRefer );
       
   136         inline const CMceInRefer* InRefer() const
       
   137                 {return iInRefer;};                           
       
   138         
       
   139 
       
   140 		void SetReferTo( const TDesC8& aReferTo );
       
   141 		inline const TDesC8& ReferTo()
       
   142 				{return iReferTo;};
       
   143 		
       
   144 		void SetSessionState( CMceSession::TState aState );
       
   145 		inline const CMceSession::TState SessionState()
       
   146 				{return iSessionState;};
       
   147 
       
   148 		void SetEventState( CMceEvent::TState aState );
       
   149 		inline const CMceEvent::TState EventState()
       
   150 				{return iEventState;};	
       
   151 		
       
   152 
       
   153 		void SetReferState(CMceRefer::TState aState );
       
   154 		inline const CMceRefer::TState ReferState()
       
   155 				{return iReferState;};	
       
   156 
       
   157 		void SetStreamState(CMceMediaStream::TState aState );
       
   158 		inline const CMceMediaStream::TState StreamState()
       
   159 				{return iStreamState;};	
       
   160 				
       
   161 				
       
   162 		/**
       
   163 		 * Set error code
       
   164 		 *
       
   165 		 * @param aError System-wide or SIP specific error code
       
   166 		 */
       
   167 
       
   168 		void SetError( TInt aError );
       
   169 		inline TInt Error()
       
   170 				{return iError;};
       
   171 
       
   172 		/**
       
   173 		* Set type or received callback
       
   174 		*/
       
   175 		inline void SetType(TTcMceCallbackType aCallbackType)
       
   176 			{iCallbackType = aCallbackType;}
       
   177 			
       
   178 		inline TTcMceCallbackType Type()
       
   179 			{return iCallbackType;}
       
   180 
       
   181 		void SetMethodL( const TDesC8& aMethod );
       
   182 		inline const HBufC8* Method() const
       
   183 			{
       
   184 			return iMethod;
       
   185 			}
       
   186 
       
   187 		void SetTransactionId( TMceTransactionId aTransactionId );
       
   188 		inline const TMceTransactionId TransactionId() const
       
   189 			{
       
   190 			return iTransactionId;
       
   191 			}
       
   192 
       
   193     public: // helper function
       
   194     
       
   195         void SetTransactionData( TMceTransactionDataContainer* aContainer );
       
   196 
       
   197 	private: // Owned data
       
   198 
       
   199 		/// MCE Incoming session pointer. Owned.
       
   200 		CMceInSession* iInSession;
       
   201 
       
   202 		/// Headers of statechanged or incoming session. Owned.
       
   203         CDesC8Array* iHeaders; 
       
   204         
       
   205         /// Content type of incoming session. Owned.
       
   206         HBufC8* iContentType;
       
   207         
       
   208         /// Body of statechanged or incoming session. Owned.
       
   209         HBufC8* iBody;
       
   210 
       
   211         /// Reasonphrase of statechanged session. Owned.
       
   212         HBufC8* iReasonPhrase;
       
   213 
       
   214         /// Floor control message. Owned.
       
   215         HBufC8* iFCMessage;
       
   216 
       
   217 		/// Incoming event pointer. Owned.
       
   218 		CMceInEvent* iInEvent;
       
   219 		
       
   220 		/// Incoming refer pointer. Owned.
       
   221 		CMceInRefer* iInRefer;
       
   222 
       
   223 		/// Method of incoming SIP request. Owned.
       
   224         HBufC8* iMethod;
       
   225 
       
   226 	private: // Referenced data
       
   227 
       
   228 		/// MCE Session pointer. Not owned.
       
   229 		const CMceSession* iSession;
       
   230 		
       
   231 		/// MCE Media Stream. Not owned.
       
   232 		const CMceMediaStream* iMediaStream; // Still missing from GetMessage
       
   233 		
       
   234 		/// MCE Media Source. Not owned.
       
   235         const CMceMediaSource* iMediaSource; // Still missing from GetMessage
       
   236        
       
   237         /// MCE Media sink. Not owned.
       
   238         const CMceMediaSink* iMediaSink; // Still missing from GetMessage
       
   239         	
       
   240         /// MCE Rtp Source. Not owned.
       
   241 		const CMceRtpSource* iRtpSource; // Still missing from GetMessage
       
   242         
       
   243     	/// Status code of the statechanged session.
       
   244         TInt32 iStatusCode;
       
   245         		
       
   246 		/// Event pointer. Not owned.
       
   247 		const CMceEvent* iEvent;
       
   248 
       
   249         /// Refer pointer. Not owned.
       
   250         const CMceRefer* iRefer;
       
   251 	
       
   252 		/// Refer-to-header
       
   253 		TDesC8 iReferTo;
       
   254 		
       
   255 		/// System-wide or SIP specific error code
       
   256 		TInt iError;
       
   257 		
       
   258 		// Type of the received callback
       
   259 		TTcMceCallbackType iCallbackType;
       
   260 
       
   261 		// Transaction Id of the received SIP message
       
   262 		TMceTransactionId iTransactionId;
       
   263 		
       
   264 		CMceSession::TState iSessionState;
       
   265 		CMceEvent::TState iEventState;
       
   266 		CMceRefer::TState iReferState;
       
   267 		CMceMediaStream::TState iStreamState;
       
   268 
       
   269 	};
       
   270 
       
   271 #endif // __CTcMCEReceived_H__