multimediacommscontroller/mmccsubcontroller/inc/mccmsrpmanager.h
branchrcs
changeset 49 64c62431ac08
child 50 1d8943dd8be6
equal deleted inserted replaced
44:fb024d5e35fa 49:64c62431ac08
       
     1 /*
       
     2 * Copyright (c) 2006 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:    Provides DTMF support
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MCCMSRPMANAGER_H
       
    19 #define MCCMSRPMANAGER_H
       
    20 
       
    21 //  INCLUDES
       
    22 //MSRP Headers
       
    23 #include <CMSRP.h>
       
    24 #include <CMSRPSession.h>
       
    25 #include <MsrpCommon.h>
       
    26 #include <MMSRPSessionObserver.h>
       
    27 #include "msrpcallbackmgrobserver.h"
       
    28 #include "mccqoseventobserver.h"
       
    29 #include "mccmsrpconnobserver.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MAsyncEventHandler;
       
    33 class MDataSink;
       
    34 class MDataSource;
       
    35 class TMccCodecInfo;
       
    36 class MMccResources;
       
    37 class TMccCreateLink;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 *  Mcc MSRP Manager implements Mcc MSRP API handling.
       
    44 *
       
    45 *  @since Series 60 3.0
       
    46 */
       
    47 NONSHARABLE_CLASS( CMccMsrpManager ) : public CBase, public MMsrpConnectionObserver
       
    48 	{
       
    49 	public:	// Constructors and destructor
       
    50 
       
    51 		/**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CMccMsrpManager* NewL( MAsyncEventHandler& aHandler, 
       
    55                 MMccResources& aMccResources, TUid aUID);
       
    56 
       
    57 		/**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CMccMsrpManager();
       
    61         
       
    62         /**
       
    63         * Sets id of the link where the msrp manager belongs.
       
    64         */
       
    65         void SetLinkId( TUint32 aLinkId );
       
    66         
       
    67 	public: // functions from MMSRPSessionObserver
       
    68 	    
       
    69         /**
       
    70          * When ConnectL function is used to establish a connection to remote
       
    71          * user, this is used to return the connection status. After ConnectL
       
    72          * the client must wait for this callback before sending or listening
       
    73          * messages. This is called also if the SendMessageL method is called
       
    74          * directly before establishing a connection
       
    75          * @param aStatus system-wide error code
       
    76          */
       
    77         void ConnectStatus( TInt aStatus );
       
    78         
       
    79         /* Notifies that the entire file has been sent successfully */
       
    80         void SendFileNotification(TBool aStatus);
       
    81                         
       
    82                 /* Notifies that the entire file has been received successfully */
       
    83         void ReceiveFileNotification(TBool status);
       
    84 	    
       
    85 	    //Connection Status
       
    86 	    TInt iConnectStatus;
       
    87   
       
    88 
       
    89 	public:	// functions from CMSRPSession.h
       
    90 	    
       
    91 	     
       
    92 	    // Returns the local MSRP path that is used in the "a" line
       
    93 	    // during SDP negotiation.
       
    94 	    TDes8& GetLocalMSRPPath();
       
    95 	    
       
    96 	    void SetLocalMSRPPath(TDesC8& aMsrpPath );
       
    97 	    
       
    98 	    
       
    99 	    // Set the various parameters related to an MSRP session
       
   100 	    // eg: The Success and Failure report headers sent in messages
       
   101 	    TInt SetSessionParams( CMSRPSessionParams& aSessionParams );
       
   102 	    
       
   103 	    // === Post SDP Negotiation; Connection Setup.
       
   104 	        
       
   105 	    TInt Connect( const TDesC8& aRemoteMsrpPath );
       
   106 	    
       
   107 	    TInt Listen ( const TDesC8& aRemoteMsrpPath );
       
   108 	    
       
   109 
       
   110 	public : // New functions from CMSRP
       
   111         
       
   112         CMSRPSession* CreateMSRPSessionL( MMSRPSessionObserver& aObserver, 
       
   113                                                        const TUint aIapId ); 
       
   114         
       
   115         /**
       
   116         * Establishes MSRP connection with remote end
       
   117         * @since Series 60 3.0
       
   118         * @param aRemoteMsrpPath - [input] Remote Msrp Path
       
   119         */
       
   120         TInt SetRemoteMsrpPathL( const TDes8& aRemoteMsrpPath, const TDes8& aConnStatus );
       
   121         
       
   122         
       
   123         /**
       
   124         * Creates a new transmit stream
       
   125         * @since Series 60 3.0
       
   126         * @param aSink MSRP Datasink
       
   127         * @param aCodecInfo Codec information
       
   128         * @return void
       
   129         */
       
   130         TUint32 CreateTransmitStreamL( MDataSink& aSink, 
       
   131             const TMccCodecInfo& aCodecInfo );
       
   132         
       
   133         /**
       
   134         * Creates a new receive stream
       
   135         * @since Series 60 3.0
       
   136         * @param MDataSource MSRP datasource
       
   137         * @param aCodecInfo Codec information
       
   138         * @retun void
       
   139         */ 
       
   140         TUint32 CreateReceiveStreamL( MDataSource& aSource, 
       
   141                 const TMccCodecInfo& aCodecInfo );
       
   142         
       
   143     public:
       
   144         
       
   145 
       
   146         /**
       
   147          * Extracts local IP address and ports from MSRP LocalPath.
       
   148          * @param aClientData Client data
       
   149          * @return void
       
   150          */
       
   151         void GetLocalIpAddressesL( TMccCreateLink& aClientData );
       
   152         
       
   153         
       
   154         /**
       
   155          * Pointer to MSRP session
       
   156          * Own.
       
   157          */
       
   158         CMSRPSession* iMsrpSession;
       
   159         
       
   160         /**
       
   161          * Pointer to Msrp call back manager
       
   162          * Own.
       
   163          */
       
   164         CMsrpCallbackMgrObserver* iMsrpObserver;
       
   165         
       
   166         void SetFileShareAttrbs(HBufC16* aFileName, TInt aFileSize, HBufC8* aFileType,
       
   167                 TBool aFTProgressNotification);
       
   168         
       
   169         CMSRPSession* GetMsrpSession();
       
   170         
       
   171         /*
       
   172          * Sets CMSRP Object. The ownership is not transferred
       
   173          */
       
   174         void SetMsrpObject(CMSRP* aMsrpObject);
       
   175         
       
   176     private:
       
   177 
       
   178         /**
       
   179         * C++ default constructor.
       
   180         */
       
   181         CMccMsrpManager( MAsyncEventHandler& aHandler,
       
   182                 MMccResources& aMccResources );
       
   183 
       
   184         /**
       
   185         * By default Symbian 2nd phase constructor is private.
       
   186         */
       
   187         void ConstructL(TUid aUID);
       
   188 
       
   189     private:    // Data
       
   190 
       
   191         // Not owned. Owned by CMccUIDLLink
       
   192         CMSRP* iMsrp;
       
   193         
       
   194         TUint32 iLinkId;
       
   195         
       
   196         TBool ifirstTime;
       
   197         
       
   198         
       
   199         // Eventhandler for errors
       
   200         MAsyncEventHandler& iEventHandler;
       
   201         
       
   202         MMccResources& iMccResources;
       
   203         MMSRPSessionObserver* iMsrpSessionOb;
       
   204         
       
   205         TBuf8<150> iLocalMsrpPath;
       
   206         HBufC16*   iFileName;
       
   207         TInt    iFileSize; 
       
   208         HBufC8*  iFileType;
       
   209         TBool   iFileShare;
       
   210         TBool iFileSendRequested;
       
   211         TBool iFileReceiveRequested;
       
   212         TBool iIsRegisteredForConnOb;
       
   213         TBool iFTProgressNotification;
       
   214         TInt  iRefCountForMSRPSession;
       
   215 	};
       
   216 
       
   217 #endif	// MCCMSRPMANAGER_H
       
   218 
       
   219 // End of File