mtpfws/mtpfw/transports/transportapi/inc/cmtptransportplugin.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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPTRANSPORTPLUGIN_H
       
    22 #define CMTPTRANSPORTPLUGIN_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <mtp/mtpdataproviderapitypes.h>
       
    26 
       
    27 class MMTPConnectionMgr;
       
    28 
       
    29 /** 
       
    30 CMTPDataProviderPlugin interface UID.
       
    31 */
       
    32 const TUid KMTPTransportPluginInterfaceUid = {0x102827AE};
       
    33 
       
    34 /** 
       
    35 Defines the MTP transport layer plug-in interface.
       
    36 @internalComponent 
       
    37 */
       
    38 class CMTPTransportPlugin : public CBase
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43     MTP transport layer plug-in factory method.
       
    44     @param aImplementationUid A UID specifying the required interface 
       
    45     implementation.
       
    46     @return Pointer to the plug-in instance. Ownership IS transfered.
       
    47     @leave KErrNoMemory If the plug-in instance could not be allocated.
       
    48     @leave KErrArgument If an invalid aImplementationUid was specified.
       
    49     */
       
    50     IMPORT_C static CMTPTransportPlugin* NewL(TUid aImplementationUid);
       
    51     
       
    52     /**
       
    53     MTP transport layer plug-in factory method.
       
    54     @param aImplementationUid A UID specifying the required interface 
       
    55     implementation.
       
    56     @param aParameter is the Parameter needed by MTPBT transport plugin. Since MTPBT support to initiate connection, it require listensee application to provide address and psm for remote host.
       
    57     @return Pointer to the plug-in instance. Ownership IS transfered.
       
    58     @leave KErrNoMemory If the plug-in instance could not be allocated.
       
    59     @leave KErrArgument If an invalid aImplementationUid was specified.
       
    60     */
       
    61 	IMPORT_C static CMTPTransportPlugin* NewL(TUid aImplementationUid,const TAny * aParameter);
       
    62     
       
    63     /**
       
    64     Destructor.
       
    65     */
       
    66     IMPORT_C virtual ~CMTPTransportPlugin();
       
    67 
       
    68 public: // MTP Transport plug-in API methods. Not Exported.
       
    69 
       
    70     /**
       
    71     Notifies the transport layer plug-in of a change in the operational mode
       
    72     of the MTP protocol layer.
       
    73     @param aMode The new operational mode of the MTP protocol layer.
       
    74     */
       
    75     virtual void ModeChanged(TMTPOperationalMode aMode) = 0;
       
    76 
       
    77     /**
       
    78     Initiates the startup of the MTP transport layer. The transport layer should
       
    79     use the supplied MTP connection manager interface to signal the 
       
    80     availability and unavailability of transport layer connections.
       
    81     @param aConnectionMgr The MTP connection manager interface.
       
    82     @see MMTPConnectionMgr::ConnectionClosedL
       
    83     @see MMTPConnectionMgr::ConnectionOpenedL
       
    84     @leave One of the system wide error codes.
       
    85     */
       
    86     virtual void StartL(MMTPConnectionMgr& aConnectionMgr) = 0;
       
    87    
       
    88     /**
       
    89     Initiates the shutdown of the MTP transport layer. The transport layer should
       
    90     use the supplied connection manager interface to signal the availability
       
    91     and unavailability of transport layer connections.
       
    92     @param aConnectionMgr The connection manager interface.
       
    93     @see MMTPConnectionMgr::ConnectionClosedL.
       
    94     @see MMTPConnectionMgr::ConnectionOpenedL.
       
    95     */
       
    96     virtual void Stop(MMTPConnectionMgr& aConnectionMgr) = 0;
       
    97     
       
    98     /**
       
    99     Provides an MTP transport plug-in extension interface implementation 
       
   100     for the specified interface Uid. 
       
   101     @param aInterfaceUid Unique identifier for the extension interface being 
       
   102     requested.
       
   103     @return Pointer to an interface instance or 0 if the interface is not 
       
   104     supported. Ownership is NOT transfered.
       
   105     */
       
   106     virtual TAny* GetExtendedInterface(TUid aInterfaceUid) = 0;
       
   107 
       
   108 protected:
       
   109 
       
   110     /**
       
   111     Constructor.
       
   112     */
       
   113     IMPORT_C CMTPTransportPlugin();
       
   114     
       
   115 
       
   116 
       
   117 private: // Owned
       
   118 
       
   119     /**
       
   120     MTP transport layer ECOM plug-in identifier.
       
   121     */
       
   122     TUid iDtorIdKey;
       
   123     };
       
   124 #endif // CMTPTRANSPORTPLUGIN_H