web_plat/connection_manager_api/inc/MConnection.h
changeset 0 dd21522fd290
child 64 ac77f89b1d9e
child 74 91031d3aab7d
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2000 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 the License "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 *     This interface class defines a protocolconnection/session
       
    16 *	  handling.
       
    17 *	
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef M_Connection_H
       
    23 #define M_Connection_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <ApEngineConsts.h> // TEMP
       
    28 #include <CmApplicationSettingsUi.h>
       
    29 
       
    30 //FORWARD DECLARATIONS
       
    31 class TIdPair;
       
    32 class MApChangeObserver;
       
    33 class CApAccessPointItem;
       
    34 class RSocketServ;
       
    35 class RConnection;
       
    36 
       
    37 enum TAPValidity
       
    38 	{
       
    39 	EFirst,
       
    40 	ESecond,
       
    41 	EBoth,
       
    42 	ENeither,
       
    43 	};
       
    44 
       
    45 enum TConManChangeConn
       
    46 	{
       
    47 	EConManDoNothing,
       
    48 	EConManCloseAndStart,
       
    49 	EConManStartAgain,
       
    50 	};
       
    51 
       
    52 //This class provides a standerd interface for the WML Browser towards any concrete implementation of a connection manager
       
    53 class MConnection
       
    54 	{
       
    55 public:
       
    56 	/**
       
    57 	*Sets the requested AP later it may not be the one to be used
       
    58 	*@param aRequestedAPs the requested AP idpair 
       
    59 	*/
       
    60 	virtual void SetRequestedAPs( TIdPair aRequestedAPs ) = 0;
       
    61 	
       
    62 	/**
       
    63 	*Sets RequestedAP
       
    64 	*@param aRequestedAP the requested AP id
       
    65 	*/
       
    66 	virtual void SetRequestedAP( TUint32 aRequestedAPId , TBool aDefault = EFalse ) = 0;
       
    67 		
       
    68 	/**
       
    69 	*Functions that are used to store the connection type and the snap ID
       
    70 	*/
       
    71     virtual void SetConnectionType( CMManager::TCmSettingSelectionMode aConnectionType ) = 0;
       
    72     
       
    73     virtual void SetRequestedSnap (TUint32 aRequestedSnapId) = 0;
       
    74 	
       
    75 	virtual TAPValidity RequestedAPValidityL() = 0;
       
    76 	
       
    77 	/**
       
    78 	*A query function to find out whether there is a connection which
       
    79 	*was matches with the "current" connection parameters
       
    80 	*@return ETrue if the condition above is satisfied EFalse otherwise.
       
    81 	*/
       
    82 	virtual TBool Connected() = 0;
       
    83 	
       
    84 	/**
       
    85 	*Call this for obtaining the AP for the current connection
       
    86 	*@return the AP for the latest connection
       
    87 	* NULL if there isn't any
       
    88 	*/
       
    89 	virtual const CApAccessPointItem* CurrentAccessPoint() const = 0;
       
    90 
       
    91 	/**
       
    92 	*Returns the currently (or the last used) AP id
       
    93 	*@return the currently (or the last used) AP id
       
    94 	*/
       
    95 	virtual TUint32 CurrentAPId() const = 0;
       
    96 	
       
    97 	/**
       
    98 	*Call this the find out the session security mode for the current AP
       
    99 	*@retun the security mode for the current AP
       
   100 	*/
       
   101 	virtual TBool CurrentSessionSecure() const = 0;
       
   102 	
       
   103 	/**
       
   104 	*Call this the find out the connection type for the current AP
       
   105 	*@retun the conection type for the current AP
       
   106 	*/
       
   107 	virtual TBool CurrentSessionConnectionOriented() const = 0;
       
   108 	
       
   109 	/**
       
   110 	*Call this the get the gateway address to be used
       
   111 	*@retun the address of the gateway associated with the current AP, space for zero terminator should also be allocated
       
   112 	*/
       
   113 	virtual HBufC* CurrentGatewayLC() const = 0;
       
   114 	
       
   115 		
       
   116 	/**
       
   117 	*Call this the get the start page to be used
       
   118 	*@return the address of the start page associated with the current AP, space for zero terminator should also be allocated
       
   119 	*/
       
   120 	virtual HBufC* CurrentStartPageLC() const = 0;
       
   121 	
       
   122 	/**
       
   123 	*Call this function to get the name of the current Wap AP, space for zero terminator should also allocated
       
   124 	*return 
       
   125 	*/
       
   126 	virtual HBufC* CurrentApNameLC() const = 0;
       
   127 
       
   128 	/**
       
   129 	*Call this the get the current connection speed to be used
       
   130 	*@return the the connection speed 
       
   131 	*/
       
   132 	virtual TApCallSpeed CurrentConnectionSpeed() const = 0;
       
   133 	
       
   134 	/**
       
   135 	*Call this the get the current bearer to be used
       
   136 	*@return the bearer type associated with the current AP
       
   137 	*/
       
   138 	virtual TApBearerType CurrentBearerTypeL() const = 0;
       
   139 
       
   140 	/**
       
   141 	*It closes the connection and sets the manager to offline mode
       
   142 	*/
       
   143 	virtual void Disconnect() = 0;
       
   144 	
       
   145 	/**
       
   146 	*Sets an observer on the AP changes
       
   147 	*@param aObserver reference to the the AP change observer 
       
   148 	*/
       
   149 	virtual void SetApChangeObserver( MApChangeObserver& aObserver ) = 0;
       
   150 	
       
   151 	/**
       
   152 	*Removes the AP change observer
       
   153 	*/
       
   154 	virtual void UnsetApChangeObserver() = 0;
       
   155 
       
   156 
       
   157 	/**
       
   158 	*Returns whether a new connection needed to be established or the old one is used.
       
   159 	*/
       
   160 	virtual TBool NewConnectionEstablished()  const = 0;
       
   161 
       
   162 	/**
       
   163 	*Starts the connection process
       
   164 	*@param aDisableConnNeeded if set to ETrue the initial dialog indicating that there is no connection will not appear
       
   165 	*@param aIgnoreSecureAttribute if set to ETrue the security of the AP will not be taken into account when making 
       
   166                                                    making decisions about which AP to use the requested or the active
       
   167 	*/
       
   168 	virtual TInt StartConnectionL( TBool aDisableConnNeeded = EFalse, TBool aIgnoreSecureAttribute = EFalse ) = 0;
       
   169 	
       
   170     /**
       
   171     *Returns the RConnection object used to create connection.
       
   172     *@return RConnection object
       
   173     */
       
   174     virtual RConnection& Connection() = 0;
       
   175 
       
   176     /**
       
   177     *Return name of the connection created.
       
   178     *Ownership of name is handed over.
       
   179     *@return name of the connection
       
   180     */
       
   181     virtual TName* ConnectionNameL() = 0;
       
   182 
       
   183     /**
       
   184     * Return socket server
       
   185     * @return socket server
       
   186     */
       
   187     virtual RSocketServ& SocketServer() = 0;
       
   188 
       
   189     /**
       
   190     * Change Internet Accespoint ( Change Connection )
       
   191     * @return
       
   192     */
       
   193     virtual void ChangeIapL( TConManChangeConn& aCangeConn,
       
   194                              TUint32& aNewAp ) = 0;
       
   195 
       
   196     /**
       
   197     * Ask Internet Accespoint from dialog
       
   198     * @return KErrNone if the user selected an Iap or and error code
       
   199     */
       
   200     virtual TInt AskIap( TUint32& aNewAp  ) = 0;
       
   201 
       
   202     /**
       
   203     * Shows the connection changed dialog.
       
   204     * @return none.
       
   205     */
       
   206     virtual void ShowConnectionChangedDlg() = 0;
       
   207     };
       
   208 
       
   209 #endif