ipappsrv_plat/multimedia_comms_api/inc/mceoutsession.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2007 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 
       
    20 
       
    21 #ifndef CMCEOUTSESSION_H
       
    22 #define CMCEOUTSESSION_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32std.h> 
       
    26 #include <mcesession.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CSIPProfile;
       
    30 class CMceMediaStream;
       
    31 class CMceManager;
       
    32 class CMceEvent;
       
    33 class CMceRefer;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * Class for mobile originated MCE sessions.
       
    39 *
       
    40 * CMceOutSession represents outgoing invitation to remote terminal to join in a session.
       
    41 *
       
    42 * The characteristics of the session are defined by user of this class by attaching
       
    43 * media streams into the session. Theses charactereistics are turned by MCE server into SDP
       
    44 * and attached into sent invitation request.
       
    45 *
       
    46 * After the session has been succesfylly established, it can be later updated and
       
    47 * must be finally terminated.
       
    48 *
       
    49 * If for any reason instance of this class is deleted while in established state,
       
    50 * session is automatically terminated by MCE server.
       
    51 *
       
    52 *  @lib mceclient.lib
       
    53 */
       
    54 class CMceOutSession : public CMceSession
       
    55 	{
       
    56 
       
    57 	public: // Constructors and destructor
       
    58 
       
    59 	    /**
       
    60 	    * Two-phased constructor. Should be used when session
       
    61 	    * is established into new logical connection to remote terminal.
       
    62 	    * @param aManager, reference to session manager.
       
    63    	    * @param aProfile, sip profile used for the session.
       
    64 	    * @param aRecipient, recipient of the session invitation.
       
    65 	    * @param aOriginator, originator of the session invitation.
       
    66 	    */
       
    67 		IMPORT_C static CMceOutSession* NewL(
       
    68 									   CMceManager& aManager,
       
    69 									   CSIPProfile& aProfile,
       
    70 									   const TDesC8& aRecipient,
       
    71 									   HBufC8* aOriginator = 0);
       
    72 
       
    73 	    /**
       
    74 	    * Two-phased constructor. Should be used when session
       
    75 	    * is established into new logical connection to remote terminal.
       
    76 	    * @param aManager, reference to session manager.
       
    77 	    * @param aIAPId, internet accesspoint identifier to be used.
       
    78 	    * @param aOriginator, originator of the session invitation.
       
    79 	    * @param aRecipient, recipient of the session invitation.
       
    80 	    * @param aContactParameters, parameters to be added into local contact. 
       
    81 		*		 Ownership is transferred.
       
    82 		*/
       
    83 	    IMPORT_C static CMceOutSession* NewL(
       
    84 	                                   CMceManager& aManager,
       
    85 						               TUint32 aIAPId,
       
    86 						               const TDesC8& aOriginator,
       
    87 						               const TDesC8& aRecipient,
       
    88 						               CDesC8Array* aContactParameters = 0 );
       
    89 
       
    90 	    /**
       
    91 	    * Two-phased constructor. Should be used when session is associated
       
    92 	    * to existing event. This guarantees that session is established with
       
    93 	    * same remote terminal with the event.
       
    94 	    * @param aEvent, reference to existing event that is associated
       
    95 	    *        with this session.
       
    96 	    */
       
    97 		IMPORT_C static CMceOutSession* NewL(CMceEvent& aEvent);
       
    98 									  
       
    99 	    /**
       
   100 	    * Two-phased constructor. Should be used when session is associated
       
   101 	    * to existing refer. This guarantees that session is established with
       
   102 	    * same remote terminal with the refer.
       
   103 	    * @param aRefer, reference to existing refer that is associated
       
   104 	    *        with this session.
       
   105 	    */
       
   106 		IMPORT_C static CMceOutSession* NewL(CMceRefer& aRefer);
       
   107 	    
       
   108 	    /**
       
   109 	    * Destructor.
       
   110 	    */
       
   111 		IMPORT_C ~CMceOutSession();
       
   112 
       
   113 	public: // from CMceSession
       
   114 
       
   115 	    /**
       
   116 	    * Adds media stream into session.
       
   117 		* @pre State() == CMceSession::EIdle ||
       
   118 		*      State() == CMceSession::EIncoming ||
       
   119 		*      State() == CMceSession::EEstablished
       
   120 		* @pre aMediaStream != 0
       
   121 	    * @param aMediaStream, media stream to be added.
       
   122 	    *		 ownership is transferred.
       
   123 	    */
       
   124 	    void AddStreamL( CMceMediaStream* aMediaStream );
       
   125 
       
   126 		virtual TBool
       
   127 			StreamInitializeCondition( CMceMediaStream& aMediaStream ) const;
       
   128 
       
   129 	public: // Functions
       
   130 
       
   131 	    /**
       
   132 	    * Establishes a SIP session with the recipient.
       
   133 	    * The streams in the stream array are offered in the
       
   134 	    * SDP codec negotiation.
       
   135 	    * @pre State() == CMceSession::EIdle
       
   136 	    * @post State() == CMceSession::EOffering
       
   137 	    * @param aTimeout, the session timer value in seconds
       
   138 	    * @param aHeaders, SIP headers to be added. Ownership is
       
   139 		*		 transferred.
       
   140 	    * @param aContentType, content type of the body.
       
   141 		*		 Ownership is transferred.
       
   142 	    * @param aContent, content to be added in body. Ownership is 
       
   143 		*		 transferred.
       
   144 	    * @param aContentHeaders, content headers to be added. Ownership is
       
   145 		*		 transferred.
       
   146 	    */
       
   147 		IMPORT_C void EstablishL(
       
   148 					 TUint32 aTimeout = 0,
       
   149 					 CDesC8Array* aHeaders = 0, 
       
   150 					 HBufC8* aContentType = 0,
       
   151 					 HBufC8* aContent = 0,
       
   152 					 CDesC8Array* aContentHeaders = 0 ); 
       
   153 
       
   154 		/**
       
   155 	    * Cancels a previously initialized MO session.
       
   156 	    * @pre State() == CMceSession::EOffering
       
   157 	    * @post State() == CMceSession::ECancelling
       
   158 	    */
       
   159 		IMPORT_C void CancelL();
       
   160 
       
   161 	public: // serialization
       
   162 
       
   163 	    /**
       
   164 	    * Two-phased constructor.
       
   165 	    * For temporary use only.
       
   166 	    */
       
   167 		static CMceOutSession* NewL();
       
   168 									  
       
   169 	protected://methods
       
   170 
       
   171 	    /**
       
   172 	     * C++ default constructor.
       
   173 	     * @param aManager, reference to session manager.
       
   174 	     * @param aProfileId, id of the sip profile used for the session.
       
   175 	     */
       
   176 		CMceOutSession( CMceManager* aManager, TUint32 aProfileId );
       
   177 
       
   178 	    /**
       
   179 	     * second-phase constructor
       
   180 	     * @param aRecipient, the recipient
       
   181 	     * @param aOriginator, the originator
       
   182 	     */
       
   183 	    void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator  );
       
   184 
       
   185         /**
       
   186 	     * second-phase constructor
       
   187 	     * @param aRecipient, the recipient
       
   188 	     * @param aOriginator, the originator
       
   189 	     * @param aDialoId, the dialog ID of existing dialog
       
   190 	     */
       
   191 	    void ConstructL( const TDesC8& aRecipient, 
       
   192 	                     const TDesC8& aOriginator,
       
   193 	                     TUint32 aDialogId );
       
   194 
       
   195         /**
       
   196 	     * second-phase constructor
       
   197 	     * @param aRecipient, the recipient
       
   198 	     * @param aOriginator, the originator
       
   199 	     * @param aIAPId, id of the access point used for the session.
       
   200 	     * @param aContactParameters, parameters to be added into local contact
       
   201 	     */
       
   202 	    void ConstructL( const TDesC8& aRecipient, 
       
   203 	                     const TDesC8& aOriginator,
       
   204 	                     TUint32 aIAPId,
       
   205 	                     CDesC8Array* aContactParameters );
       
   206 
       
   207 	private: // Data
       
   208 
       
   209 	};
       
   210 
       
   211 #endif