mtptransports/mtpptpiptransport/ptpipcontroller/interface/mptpipcontroller.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     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 // Initial Contributors:
       
    15 // Nokia Corporation - initial contribution.
       
    16 // Contributors:
       
    17 // Provides an interface to operate with PTP/IP Controller like., Notify the 
       
    18 // PTP/IP Controller of incoming requests, Stop the existing transport, Set the 
       
    19 // current Device GUID and Device Friendly Name,Get a new blank socket everytime 
       
    20 // there is a connection request.
       
    21 //
       
    22 
       
    23 
       
    24 
       
    25 /**
       
    26  @publishedPartner
       
    27  @released
       
    28 */
       
    29 
       
    30 #ifndef __MPTPIPCONTROLLER_H__
       
    31 #define __MPTPIPCONTROLLER_H__
       
    32 
       
    33 #include <e32cmn.h>
       
    34 #include <es_sock.h>
       
    35 
       
    36 class MPTPIPController
       
    37 {
       
    38 	
       
    39 	public:
       
    40 	
       
    41 	
       
    42 		/*
       
    43 		Stops the existing PTPIP transport,In-turn closes the client-side session
       
    44 		with MTP server,Before calling StopTransport(),any outstanding Listen call
       
    45 		over socket,has to be cancelled.
       
    46 		*/
       
    47 		virtual void StopTransport()=0;
       
    48 
       
    49 	   /*
       
    50 	   	This method is called to notify the PTP/IP Controller that there is an incoming connection 
       
    51 	   	request.It hands over the Command or Event Sockets to the appropriate Socket Handlers.
       
    52 	   	There is a validation happening as to whether both of the above requests are coming
       
    53 	   	from the same host; it validates if it is from the same host; otherwise rejects the 
       
    54 	   	request and starts listening on the socket again.
       
    55      	@param TRequestStatus of the caller.
       
    56 	   */
       
    57 		virtual void SocketAccepted(TRequestStatus& aStatus)=0;
       
    58 
       
    59 		/*
       
    60 		Saves the current Device GUID(Globally Unique Identifier)
       
    61 		@param GUID of the device which is obtained from the Device as a part of InitCommandAck Packet
       
    62 		@return KErrNone if GUID is valid, otherwise KErrArgument
       
    63 		*/
       
    64 		virtual TInt SetDeviceGUID(TDesC8& aDeviceGUID)=0;
       
    65 
       
    66 		/*
       
    67 		Saves the current Device Friendly Name
       
    68 		@param Friendly Name of the device which is obtained from the Device as a part of InitCommandAck Packet
       
    69 		*/
       
    70 		virtual void SetDeviceFriendlyName(TDesC16* aDeviceFriendlyName)=0;
       
    71 
       
    72 		/*
       
    73 		Issues a new blank socket.NewSocketL() has to be called when a socket is required to accept
       
    74 		the incoming connection request.
       
    75 		@return Reference to the socket the PTPIP/Controller owns.
       
    76 		@leave when it cannot return any more sockets.It leaves when there are more than 3 connection requests
       
    77 		per session
       
    78 		*/
       
    79 		virtual RSocket& NewSocketL()=0;
       
    80 
       
    81 	
       
    82 };
       
    83 
       
    84 #endif