applayerpluginsandutils/httptransportplugins/httptransporthandler/msocketconnectobserver.h
changeset 0 b16258d2340f
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 __MSOCKETCONNECTOBSERVER_H__
       
    17 #define __MSOCKETCONNECTOBSERVER_H__
       
    18 
       
    19 #include <e32std.h>
       
    20 
       
    21 class MInputStream;
       
    22 class MOutputStream;
       
    23 
       
    24 class MSocketConnectObserver
       
    25 /**
       
    26 The MSocketConnectObserver class provides the callback API for notification
       
    27 of a socket connection request. The observer has requested the connection 
       
    28 via the MSocketFactory API. 
       
    29 
       
    30 The observer is either notified of a successful connection or of any errors 
       
    31 that occur. The socket connect observer can stop the connection using the 
       
    32 MSocketConnector API. This can only be done if the observer has not been 
       
    33 notified.
       
    34 @see		MSocketFactory
       
    35 @see		MSocketConnector
       
    36 */
       
    37 	{
       
    38 public:	// methods
       
    39 
       
    40 /**	
       
    41 	Notifies the socket connect observer that a connection with the remote host
       
    42 	has been established. The input and output streams encapsulating the 
       
    43 	connected socket are provided. 
       
    44 	@param		aInputStream	The input stream.
       
    45 	@param		aOutputStream	The output stream.
       
    46 	@see		MInputStream
       
    47 	@see		MOutputStream
       
    48 */
       
    49 	virtual void ConnectionMadeL(MInputStream& aInputStream, MOutputStream& aOutputStream) =0;
       
    50 
       
    51 /**	
       
    52 	Notifies the socket connect observer that error has occured in the connecting
       
    53 	service. The error code will have a value of KErrCancel if the observer has
       
    54 	stopped the connect service via the MSocketConnectObserver::StopConnect() API.
       
    55 	@param		aError	The error code.
       
    56 	@return		A value of KErrNone if the error has been handled or any other 
       
    57 				value other value if its has not been handled.
       
    58 */
       
    59 	virtual TInt HandleConnectError(TInt aError) =0;
       
    60 
       
    61 private:	// methods
       
    62 
       
    63 /**
       
    64 	Reserved function for future expansion.
       
    65 */
       
    66 	virtual void MSocketConnectObserver_Reserved() =0;
       
    67 	
       
    68 	};
       
    69 
       
    70 #endif	// __MSOCKETCONNECTOBSERVER_H__