applayerpluginsandutils/httptransportplugins/httptransporthandler/mconnectionprefsprovider.h
changeset 0 b16258d2340f
child 18 5f1cd966e0d9
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __MCONNECTIONPREFSPROVIDER_H__
       
    17 #define __MCONNECTIONPREFSPROVIDER_H__
       
    18 
       
    19 #include <e32std.h>
       
    20 
       
    21 class RConnection;
       
    22 class MSecurityPolicy;
       
    23 
       
    24 class MConnectionPrefsProvider
       
    25 /**
       
    26 Interface class used as a callback observer to provide any connection 
       
    27 preferences. This is used by the transport layer as callback to provide 
       
    28 preferences such as allowing exsiting comms	connections to be used and 
       
    29 security preferences.
       
    30 @see	CHttpTransportLayer
       
    31 */
       
    32 		{
       
    33 public: // Methods
       
    34 
       
    35 /**
       
    36 	Callback function used by the transport layer that allows the client to 
       
    37 	provide an existing	comms connection to use. The return value indicates 
       
    38 	whether the client provided a connection or not. If the client does not 
       
    39 	provide an existing connection, the paramters should not be set.
       
    40 	@param		aSocketServerHandle	Handle to the existing socket server that
       
    41 									is already connected
       
    42 	@param		aConnectionPtr		Pointer to the comms connection that has 
       
    43 									already been started
       
    44 	@return		ETrue if an existing conection is provided or EFlase if no 
       
    45 				connection is supplied.
       
    46 */
       
    47 	virtual TBool SupplyCommsConnection( RConnection*& aConnectionPtr ) =0;
       
    48 	virtual TBool SupplySocketServerHandle ( TInt& aSocketServerHandle ) =0;
       
    49 
       
    50 /**
       
    51 	Callback function used by the transport layer to set the comms connection 
       
    52 	that has been setup back in the client, making the connection to the client.
       
    53 	@param		aSocketServerHandle	Handle to the newly created socket server
       
    54 	@param		aConnectionPtr		Pointer to the newly created (and connected)
       
    55 									comms connection
       
    56 */
       
    57 	virtual void SetCommsConnectionL( RConnection* aConnectionPtr ) =0;
       
    58 	virtual void SetSocketServerHandleL ( TInt aSocketServerHandle ) =0;
       
    59 
       
    60 /**
       
    61 	Callback used by the transport layer to query a client to provide security 
       
    62 	preferences.
       
    63 	@param		aDialogPrompt	A boolean indicating whether clients should be 
       
    64 								prompted or not.
       
    65 	@param		aSecurityPolicy	The security policy provider, can be NULL if not
       
    66 								provided.
       
    67 */
       
    68 	virtual void GetSecurityPrefs(TBool& aDialogPrompt, MSecurityPolicy*& aSecurityPolicy) =0;
       
    69 
       
    70 /**
       
    71 	Callback function that indicates the socket shutdown mode. This method instructs the
       
    72 	transport layer to shutdown	the socket immediately.
       
    73 	@return		A boolean indicating whether the socket should be shutdown immediately or not.
       
    74 */
       
    75 	virtual TBool ImmediateSocketShutdown() =0;
       
    76 	
       
    77 /**
       
    78 	Callback function used by the transport layer to get the session ID. The result is either a non-negative integer, or an error code.
       
    79 	
       
    80 	@return		A negative error code or the Session ID. This returns KErrNotSupported
       
    81 				if the implementation does not support session IDs
       
    82 */
       
    83 	virtual TInt SessionId() =0;
       
    84 	
       
    85 /**
       
    86 	Callback function used by the transport layer to get the maximum receive buffer size.
       
    87 	@return    Returns the receive buffer size.
       
    88 */
       
    89 	virtual TInt GetRecvBufferSize() = 0;
       
    90 
       
    91 	};
       
    92 
       
    93 #endif	// __MCONNECTIONPREFSPROVIDER_H__
       
    94