mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceoutsession.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 CMCEOUTSESSION_H
       
    20 #define CMCEOUTSESSION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h> 
       
    24 #include <mcesession.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CSIPProfile;
       
    28 class CMceMediaStream;
       
    29 class CMceManager;
       
    30 class CMceEvent;
       
    31 class CMceRefer;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Class for mobile originated MCE sessions.
       
    37 *
       
    38 * CMceOutSession represents outgoing invitation to remote terminal to join in a session.
       
    39 *
       
    40 * The characteristics of the session are defined by user of this class by attaching
       
    41 * media streams into the session. Theses charactereistics are turned by MCE server into SDP
       
    42 * and attached into sent invitation request.
       
    43 *
       
    44 * After the session has been succesfylly established, it can be later updated and
       
    45 * must be finally terminated.
       
    46 *
       
    47 * If for any reason instance of this class is deleted while in established state,
       
    48 * session is automatically terminated by MCE server.
       
    49 *
       
    50 *  @lib mceclient.lib
       
    51 */
       
    52 class CMceOutSession : public CMceSession
       
    53 	{
       
    54 
       
    55 	public: // Constructors and destructor
       
    56 
       
    57 	    /**
       
    58 	    * Two-phased constructor. Should be used when session
       
    59 	    * is established into new logical connection to remote terminal.
       
    60 	    * @param aManager, reference to session manager.
       
    61    	    * @param aProfile, sip profile used for the session.
       
    62 	    * @param aRecipient, recipient of the session invitation.
       
    63 	    * @param aOriginator, originator of the session invitation.
       
    64 	    */
       
    65 		IMPORT_C static CMceOutSession* NewL(
       
    66 									   CMceManager& aManager,
       
    67 									   CSIPProfile& aProfile,
       
    68 									   const TDesC8& aRecipient,
       
    69 									   HBufC8* aOriginator = 0);
       
    70 
       
    71 	    /**
       
    72 	    * Two-phased constructor. Should be used when session is associated
       
    73 	    * to existing event. This guarantees that session is established with
       
    74 	    * same remote terminal with the event.
       
    75 	    * @param aEvent, reference to existing event that is associated
       
    76 	    *        with this session.
       
    77 	    */
       
    78 		IMPORT_C static CMceOutSession* NewL(CMceEvent& aEvent);
       
    79 									  
       
    80 	    /**
       
    81 	    * Two-phased constructor. Should be used when session is associated
       
    82 	    * to existing refer. This guarantees that session is established with
       
    83 	    * same remote terminal with the refer.
       
    84 	    * @param aRefer, reference to existing refer that is associated
       
    85 	    *        with this session.
       
    86 	    */
       
    87 		IMPORT_C static CMceOutSession* NewL(CMceRefer& aRefer);
       
    88 	    
       
    89 		/// Note: This function exists only in the stub
       
    90 	    IMPORT_C static	CMceOutSession* NewL();
       
    91 		
       
    92 	    /**
       
    93 	    * Destructor.
       
    94 	    */
       
    95 		IMPORT_C ~CMceOutSession();
       
    96 
       
    97 	public: // from CMceSession
       
    98 
       
    99 	    /**
       
   100 	    * Adds media stream into session.
       
   101 		* @pre State() == CMceSession::EIdle ||
       
   102 		*      State() == CMceSession::EIncoming ||
       
   103 		*      State() == CMceSession::EEstablished
       
   104 		* @pre aMediaStream != 0
       
   105 	    * @param aMediaStream, media stream to be added.
       
   106 	    *		 ownership is transferred.
       
   107 	    */
       
   108 	    IMPORT_C void AddStreamL( CMceMediaStream* aMediaStream );
       
   109 	    
       
   110 	public: // Functions
       
   111 
       
   112 	    /**
       
   113 	    * Establishes a SIP session with the recipient.
       
   114 	    * The streams in the stream array are offered in the
       
   115 	    * SDP codec negotiation.
       
   116 	    * @pre State() == CMceSession::EIdle
       
   117 	    * @post State() == CMceSession::EOffering
       
   118 	    * @param aTimeout, the session timer value in seconds
       
   119 	    * @param aHeaders, SIP headers to be added. Ownership is
       
   120 		*		 transferred.
       
   121 	    * @param aContentType, content type of the body.
       
   122 		*		 Ownership is transferred.
       
   123 	    * @param aContent, content to be added in body. Ownership is 
       
   124 		*		 transferred.
       
   125 	    * @param aContentHeaders, content headers to be added. Ownership is
       
   126 		*		 transferred.
       
   127 	    */
       
   128 		IMPORT_C void EstablishL(
       
   129 					 TUint32 aTimeout = 0,
       
   130 					 CDesC8Array* aHeaders = 0, 
       
   131 					 HBufC8* aContentType = 0,
       
   132 					 HBufC8* aContent = 0,
       
   133 					 CDesC8Array* aContentHeaders = 0 ); 
       
   134 
       
   135 		/**
       
   136 	    * Cancels a previously initialized MO session.
       
   137 	    * @pre State() == CMceSession::EOffering
       
   138 	    */
       
   139 		IMPORT_C void CancelL();
       
   140 									  
       
   141 	private://methods
       
   142 
       
   143 	    /**
       
   144 	     * C++ default constructor.
       
   145 	     * @param aManager, reference to session manager.
       
   146 	     * @param aProfileId, id of the sip profile used for the session.
       
   147 	     */
       
   148 		CMceOutSession( CMceManager* aManager, TUint32 aProfileId );
       
   149 
       
   150 	    /**
       
   151 	     * second-phase constructor
       
   152 	     * @param aRecipient, the recipient
       
   153 	     * @param aOriginator, the originator
       
   154 	     */
       
   155 	    void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator  );
       
   156 
       
   157 
       
   158 	
       
   159 	};
       
   160 
       
   161 #endif