email/imap4mtm/imaptransporthandler/inc/msocketconnectobserver.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2006-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 // Forward declarations
       
    22 class MInputStream;
       
    23 class MOutputStream;
       
    24 
       
    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 
       
    35 @see MSocketFactory
       
    36 @see MSocketConnector	
       
    37 @internalTechnology
       
    38 @prototype
       
    39 */
       
    40 class MSocketConnectObserver
       
    41 	{
       
    42 public:
       
    43 	/**
       
    44 	Notifies the socket connect observer that a connection with the remote host
       
    45 	has been established. The input and output streams encapsulating the 
       
    46 	connected socket are provided.
       
    47 	@param aInputStream	The input stream.
       
    48 	@param aOutputStream The output stream.
       
    49 	@see MInputStream
       
    50 	@see MOutputStream
       
    51 	*/
       
    52 	virtual void ConnectionMadeL(MInputStream& aInputStream, MOutputStream& aOutputStream) =0;
       
    53 	/**
       
    54 	Notifies the socket connect observer that an error has occured in the connecting
       
    55 	service. The error code will have a value of KErrCancel if the observer has
       
    56 	stopped the connect service via the MSocketConnectObserver::StopConnect() API.
       
    57 	@param aError	The error code.
       
    58 	@return	A value of KErrNone if the error has been handled or any other 
       
    59 			value if its has not been handled.
       
    60 	*/
       
    61 	virtual TInt HandleConnectError(TInt aError) =0;
       
    62 	};
       
    63 
       
    64 #endif	// __MSOCKETCONNECTOBSERVER_H__