natfw/natfwsettings/inc/cnatfwturnsettings.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:    Encapsulates TURN related software settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CNATFWTURNSETTINGS_H
       
    22 #define C_CNATFWTURNSETTINGS_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <mnatfwturnsettings.h>
       
    26 
       
    27 class CNATFWServerSettings;
       
    28 class CNATFWCenRepHandler;
       
    29 
       
    30 
       
    31 /**
       
    32  *  Class instance encapsulates TURN related software settings.
       
    33  *
       
    34  *  @lib natfwnatsettings.dll
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class CNATFWTurnSettings : public CBase, public MNATFWTurnSettings
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     static CNATFWTurnSettings* NewL();
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50     static CNATFWTurnSettings* NewLC();
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CNATFWTurnSettings();
       
    56 
       
    57     /**
       
    58      * Sets TURN server array, ownership is transferred
       
    59      * 
       
    60      * @since   S60 v3.2
       
    61      * @param   aTurnServers Server array
       
    62      */
       
    63     void SetTurnServersL( CArrayPtr<CNATFWServerSettings>* aTurnServers );
       
    64 
       
    65     /**
       
    66      * Sets retransmission timeout (RTO).
       
    67      *
       
    68      * @since   S60 v3.2
       
    69      * @param  aRto Retransmission timeout value
       
    70      */  
       
    71     void SetRetransmissionTimeout( TUint aRto );
       
    72 
       
    73     /**
       
    74      * Sets latest connected server address
       
    75      * 
       
    76      * @since   S60 v3.2
       
    77      * @param   aServerAddr Server address
       
    78      */
       
    79     void SetLatestConnectedServerAddrL( const TDesC8& aServerAddr );
       
    80 
       
    81     /**
       
    82      * Sets latest connected server port
       
    83      * 
       
    84      * @since   S60 v3.2
       
    85      * @param   aServerPort Server port
       
    86      */
       
    87     void SetLatestConnectedServerPort( TInt aServerPort );
       
    88 
       
    89     /**
       
    90      * Read settings from Central Repository
       
    91      * 
       
    92      * @since   S60 v3.2
       
    93      * @param   aDomainKey Key for domain settings
       
    94      * @param   aRepHandler Central Repository handler
       
    95      */
       
    96     void ReadSettingsL( TUint32 aDomainKey,
       
    97         const CNATFWCenRepHandler& aRepHandler );
       
    98     
       
    99 // from base class MNATFWTurnSettings
       
   100 
       
   101     /**
       
   102      * From MNATFWTurnSettings.
       
   103      * Method for getting array of TURN server related settings
       
   104      * Ownership is not transferred.
       
   105      *
       
   106      * @since S60 3.2
       
   107      * @param aServers Returns array of a TURN server settings pointers
       
   108      */
       
   109     void GetTurnServerArrayL(
       
   110         RPointerArray<MNATFWServerSettings>& aServers ) const;
       
   111 
       
   112     /**
       
   113      * From MNATFWTurnSettings.
       
   114      * Returns initial retransmission timeout (RTO).
       
   115      *
       
   116      * @since S60 v3.2
       
   117      * @return Retransmission timeout
       
   118      */  
       
   119     TUint RetransmissionTimeout() const;
       
   120     
       
   121     /**
       
   122      * From MNATFWTurnSettings.
       
   123      * Method for getting latest successfully connected TURN server address
       
   124      *
       
   125      * @since S60 3.2
       
   126      * @return Latest successfully connected TURN server address
       
   127      */
       
   128     const TDesC8& LatestConnectedServerAddr() const;
       
   129 
       
   130     /**
       
   131      * From MNATFWTurnSettings.
       
   132      * Method for getting latest successfully connected TURN server port
       
   133      *
       
   134      * @since S60 3.2
       
   135      * @return latest successfully connected TURN server port
       
   136     */
       
   137     TInt LatestConnectedServerPort() const;
       
   138     
       
   139 private:
       
   140 
       
   141     CNATFWTurnSettings();
       
   142 
       
   143     void ConstructL();
       
   144 
       
   145 private: // data
       
   146 
       
   147     /**
       
   148      * Array of server related settings.
       
   149      */
       
   150     CArrayPtr<CNATFWServerSettings>* iServerArray;
       
   151     
       
   152     /**
       
   153      * Retransmission timeout.
       
   154      */
       
   155     TUint iRto;
       
   156     
       
   157     /**
       
   158      * Latest successfully connected TURN server address.
       
   159      */
       
   160     HBufC8* iLatestConnectedServerAddr;
       
   161     
       
   162     /**
       
   163      * Latest successfully connected TURN server port.
       
   164      */
       
   165     TUint iLatestConnectedServerPort;
       
   166 
       
   167     };
       
   168 
       
   169 #endif // C_CNATFWTURNSETTINGS_H