mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceinsession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMCEINSESSION_H
       
    20 #define CMCEINSESSION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <mcesession.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 * Class for mobile terminated MCE sessions.
       
    30 *
       
    31 * CMceInSession represents incoming invitation to join in a session.
       
    32 *
       
    33 * The characteristics of the session are defined by remote terminal. Theses charactereistics
       
    34 * are defined using SDP and are turned by MCE server into structure of media streams attached 
       
    35 * into the session. The user of this class is then responsible to either reject accept
       
    36 * the invitation.
       
    37 *
       
    38 * Accepting the invitation is executed in two steps. First after receiving the invitation
       
    39 * the user must complete the media structure. Streams attached to the session are not complete,
       
    40 * but they must be completed by the user. Those componens defined in SDP are put automatically
       
    41 * into media structure (like streams and RTP sinks and sources), but other relations must
       
    42 * be completed by user. When media structure is complete, UpdateL method is called and session
       
    43 * establishement continues with second step.
       
    44 *
       
    45 * After all media resources are succesfully negotiated and reserved, session state is changed
       
    46 * to Proceeding, and end used can be alarmed about incoming invitation. Typically, at this state
       
    47 * 180 Ringing response is sent to network. If end user accepts the invitation, 200 OK is
       
    48 * sent to network and session is established.
       
    49 *
       
    50 * After the session has been succesfylly established, it can be later updated and
       
    51 * must be finally terminated.
       
    52 *
       
    53 * This class is never instantiated by user, but the ownership is in any case transferred
       
    54 * to it. See class MMceInSessionObserver.
       
    55 *
       
    56 * If for any reason instance of this class is deleted while in established state,
       
    57 * session is automatically terminated by MCE server.
       
    58 *
       
    59 *  @lib mceclient.lib
       
    60 */
       
    61 class CMceInSession : public CMceSession
       
    62 	{
       
    63 
       
    64 	public: // Constructors and destructor
       
    65 
       
    66 	    /**
       
    67 	    * Destructor 
       
    68 	    */
       
    69 		IMPORT_C ~CMceInSession();
       
    70 
       
    71 	public: // Functions
       
    72 
       
    73 	    /**
       
    74 	    * Indicates to the server side, that 180(Ringing) response for the 
       
    75 	    * incoming INVITE request can be sent. Does not establish session.
       
    76 	    * @pre State() == CMceSession::EProceeding
       
    77 	    * @param aHeaders, SIP headers to be added. Ownership is
       
    78 		*		 transferred.
       
    79 		* @param aContentType, a type of content. Ownership
       
    80 		*		 is transferred.
       
    81 	    * @param aContent, content to be added in body. Ownership is 
       
    82 		*		 transferred.
       
    83 
       
    84 	    */
       
    85 		IMPORT_C void RingL( CDesC8Array* aHeaders = 0,
       
    86 					 		 HBufC8* aContentType = 0,
       
    87 					 		 HBufC8* aContent = 0 );
       
    88 
       
    89 	    /**
       
    90 	    * Answers to an incoming session. Indicates to server side that the 
       
    91 	    * 200(OK) response for the incoming INVITE has to be sent.
       
    92 	    * @pre State() == CMceSession::EProceeding
       
    93 	    * @post State() == CMceSession::EAnswering	    
       
    94 	    */
       
    95 		IMPORT_C void AcceptL();
       
    96 
       
    97        /**
       
    98 	    * Answers to an incoming session. Indicates to server side that the 
       
    99 	    * given response for the incoming INVITE has to be sent.
       
   100 	    * @pre State() == CMceSession::EProceeding && ( 200 <= aCode <= 300 )
       
   101 	    * @post State() == CMceSession::EAnswering	    
       
   102 	    * @param aReason, reason phrase
       
   103 	    * @param aCode, reason code
       
   104 	    * @param aHeaders, SIP headers to be added. Ownership is
       
   105 		*		 transferred.
       
   106 		* @param aContentType, a type of content. Ownership
       
   107 		*		 is transferred.
       
   108 	    * @param aContent, content to be added in body. Ownership is 
       
   109 		*		 transferred.
       
   110 	    */
       
   111 		IMPORT_C void AcceptL(  const TDesC8& aReason,
       
   112 	           			        TUint32 aCode,
       
   113 	           			        CDesC8Array* aHeaders = 0,
       
   114 					 		    HBufC8* aContentType = 0,
       
   115 					 		    HBufC8* aContent = 0 );
       
   116 
       
   117 	    /**
       
   118 	    * Rejects the incoming session. Indicates to server side that 
       
   119 	    * 603(Decline) response has to be sent.
       
   120 	    * @pre State() == CMceSession::EIncoming ||
       
   121 	    *      State() == CMceSession::EProceeding
       
   122 	    * @post State() == CMceSession::ETerminated	    
       
   123 	    */
       
   124 	    IMPORT_C void RejectL();
       
   125         
       
   126         /**
       
   127 	    * Rejects the incoming session. Indicates to server side that 
       
   128 	    * 603(Decline) response has to be sent.
       
   129 	    * @pre ( State() == CMceSession::EIncoming ||
       
   130 	    *        State() == CMceSession::EProceeding ) &&
       
   131 	    *        ( 300 <= aCode < 700 )
       
   132 	    * @post State() == CMceSession::ETerminated	    
       
   133 	    * @param aReason, reason phrase
       
   134 	    * @param aCode, reason code
       
   135 	    * @param aHeaders, SIP headers to be added. Ownership is
       
   136 		*		 transferred.
       
   137 		* @param aContentType, a type of content. Ownership
       
   138 		*		 is transferred.
       
   139 	    * @param aContent, content to be added in body. Ownership is 
       
   140 		*		 transferred.
       
   141 	    */
       
   142 	    IMPORT_C void RejectL(  const TDesC8& aReason,
       
   143 	           			        TUint32 aCode,
       
   144 	           			        CDesC8Array* aHeaders = 0,
       
   145 					 		    HBufC8* aContentType = 0,
       
   146 					 		    HBufC8* aContent = 0 );
       
   147 
       
   148 	public: // serialization
       
   149 
       
   150 	    /**
       
   151 	    * Two-phased constructor.
       
   152 	    * @param aReadStream, read stream
       
   153 	    * @param aManager, reference to session manager.
       
   154 	    * @param aProfileId, id of the sip profile used for the session.
       
   155 	    */
       
   156 		static CMceInSession* NewL( RReadStream& aReadStream,
       
   157 									  CMceManager& aManager,
       
   158 									  TUint32 aProfileId );
       
   159 	    /**
       
   160 	    * Two-phased constructor.
       
   161 	    * For temporay use only.
       
   162 	    */
       
   163         IMPORT_C static CMceInSession* NewL();
       
   164 
       
   165 	    /**
       
   166 	     * C++ default constructor.
       
   167 	     * @param aManager, reference to session manager.
       
   168 	     * @param aProfileId, id of the sip profile used for the session.
       
   169 	     */
       
   170 		CMceInSession( CMceManager* aManager, TUint32 aProfileId );
       
   171 		
       
   172 		
       
   173 	private://methods
       
   174 
       
   175 	    /**
       
   176 	     * second-phase constructor
       
   177 	     * @param aOriginator, the originator
       
   178 	     * @param aRecipient, the recipient
       
   179 	     */
       
   180 	    void ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient );
       
   181 	
       
   182 	public: // Stub constructor	
       
   183 
       
   184 	    /**
       
   185 	    * Two-phased constructor.
       
   186 	    * @param aManager, reference to session manager.
       
   187 	    */
       
   188 		IMPORT_C static CMceInSession* NewL( CMceManager& aManager,
       
   189 		                                     const TDesC8& aOriginator );
       
   190 
       
   191 
       
   192     public: // Stub data
       
   193     
       
   194         TBool iRingingCalled;
       
   195         									  
       
   196 		};
       
   197 
       
   198 
       
   199 	#endif