multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcenatpluginmanager.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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMCENATPLUGINMANAGER_H
       
    21 #define CMCENATPLUGINMANAGER_H
       
    22 
       
    23 #include "nspplugin.h"
       
    24 #include "mcesrv.h"
       
    25 #include <e32base.h>
       
    26 
       
    27 class CSdpDocument;
       
    28 class MNSPSessionObserver;
       
    29 
       
    30 /**
       
    31 *  MCE NAT Plugin manager.
       
    32 *
       
    33 *  @lib 
       
    34 *  @since S60 3.2
       
    35 */
       
    36 class CMceNatPluginManager: public CBase
       
    37 	{
       
    38 	
       
    39 public: // Constructors and destructor
       
    40 
       
    41 	/**
       
    42 	* Two-phased constructor.
       
    43 	*/
       
    44 	static CMceNatPluginManager* NewL();
       
    45 
       
    46 	/**
       
    47 	* Destructor.
       
    48 	*/
       
    49     ~CMceNatPluginManager();
       
    50     
       
    51 private: // Constructors and destructor    
       
    52 
       
    53     CMceNatPluginManager();
       
    54     
       
    55     void ConstructL();
       
    56 
       
    57 
       
    58 public: // New functions
       
    59 
       
    60     /**
       
    61      * Wrapper for CNSPPlugin - class corresponding method
       
    62      */
       
    63 	TInt NewSessionL( MNSPSessionObserver& aNatSessionObserver,
       
    64 	                  TUint32 aIapId,
       
    65 	                  const TDesC8& aDomain );
       
    66 	
       
    67     /**
       
    68      * Wrapper for CNSPPlugin - class corresponding method
       
    69      */
       
    70 	void CloseSessionL( TUint aSessionId );
       
    71     
       
    72     /**
       
    73      * Wrapper for CNSPPlugin - class corresponding method
       
    74      */
       
    75     TNatReturnStatus CreateOfferL( TUint aSessionId, CSdpDocument*& aOffer );
       
    76     
       
    77     /**
       
    78      * Wrapper for CNSPPlugin - class corresponding method
       
    79      */
       
    80     TNatReturnStatus ResolveL( TUint aSessionId,
       
    81                                CSdpDocument*& aOffer,
       
    82                                CSdpDocument*& aAnswer );
       
    83     
       
    84     /**
       
    85      * Wrapper for CNSPPlugin - class corresponding method
       
    86      */
       
    87     TNatReturnStatus DecodeAnswerL( TUint aSessionId, CSdpDocument*& aAnswer );
       
    88     
       
    89     /**
       
    90      * Wrapper for CNSPPlugin - class corresponding method
       
    91      */
       
    92     void UpdateL( TUint aSessionId, CSdpDocument*& aOffer );
       
    93     
       
    94     /**
       
    95      * Wrapper for CNSPPlugin - class corresponding method
       
    96      */
       
    97     TNatReturnStatus RestartL( TUint aSessionId );
       
    98     
       
    99     /**
       
   100      * Method checks if NAT plugin is present.
       
   101      *
       
   102      * @return ETrue if Nat plugin was present, EFalse otherwise.
       
   103      */
       
   104     TBool NatEnabledL();
       
   105     
       
   106     /**
       
   107      * Wrapper for CNSPPlugin - class corresponding method
       
   108      */
       
   109     TInt SetSessionParam( TUint aSessionId, CNSPPlugin::TNSPSessionParamKey aParamKey,
       
   110             TUint aParamValue );
       
   111     
       
   112     /**
       
   113      * Wrapper for CNSPPlugin - class corresponding method
       
   114      */
       
   115     TInt GetSessionParam( TUint aSessionId, CNSPPlugin::TNSPSessionParamKey aParamKey );
       
   116 
       
   117 
       
   118     static void WriteSdpToLog( const TDesC& aMsg, CSdpDocument* aSdp );
       
   119 
       
   120 private:
       
   121 
       
   122 	void GetPluginL();
       
   123 
       
   124     static CBufBase* EncodeSdpL( CSdpDocument& aSdp );
       
   125     
       
   126     static void ResetAndDestroyInfo( TAny* aArray );
       
   127     
       
   128     //friend class UT_CMceNatPluginManager;
       
   129     friend class UT_CMceNatPluginManager;
       
   130 
       
   131 private: // Data
       
   132 
       
   133     // pointer to plugin implementation
       
   134     CNSPPlugin* iPlugin;
       
   135     
       
   136     //definitions for unit testing
       
   137 	MCEMM_UT_DEFINITIONS
       
   138     
       
   139 
       
   140 	};
       
   141 
       
   142 #endif // CMCENATPLUGINMANAGER_H
       
   143 
       
   144 // End of File