mtpfws/mtpfw/transports/transportapi/inc/mmtptransportconnection.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  @internalTechnology
       
    19 */
       
    20 
       
    21 #ifndef MMTPTRANSPORTCONNECTION_H
       
    22 #define MMTPTRANSPORTCONNECTION_H
       
    23 
       
    24 #include <e32cmn.h>
       
    25 
       
    26 class MMTPConnectionProtocol;
       
    27 class MMTPType;
       
    28 class TMTPTypeEvent;
       
    29 class TMTPTypeRequest;
       
    30 class TMTPTypeResponse;
       
    31 
       
    32 /** 
       
    33 Defines the MTP connection transport layer interface.
       
    34 @internalTechnology
       
    35   
       
    36 */
       
    37 class MMTPTransportConnection
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42     Binds the MTP protocol layer notification interface to the connection transport 
       
    43     layer.
       
    44     @param aProtocol The MTP protocol layer notification interface.
       
    45     @leave One of the system wide error codes, if a processing failure occurs.
       
    46     */
       
    47     virtual void BindL(MMTPConnectionProtocol& aProtocol) = 0;
       
    48 
       
    49     /**
       
    50     Provides the MTP protocol layer notification interface which is bound to
       
    51     the connection transport layer.
       
    52     @return The MTP protocol layer notification interface binding.
       
    53     */
       
    54     virtual MMTPConnectionProtocol& BoundProtocolLayer() = 0;
       
    55     
       
    56     /**
       
    57     Initiates a connection shutdown sequence, usually as a result of an 
       
    58     unrecoverable MTP protocol error. This sequence is completed when the 
       
    59     connection transport layer signals ConnectionClosed to the MTP connection 
       
    60     manager interface.
       
    61     @see MMTPConnectionMgr::ConnectionClosed.
       
    62     */
       
    63     virtual void CloseConnection() = 0;
       
    64 
       
    65     /**
       
    66     Initiates an MTP data object receive sequence in the connection transport 
       
    67     layer. This sequence is completed when the transport layer connection signals
       
    68     ReceiveDataComplete to the MTP protocol layer notification interface.
       
    69     @param aData The MTP data object sink.
       
    70     @param aRequest The MTP request dataset of the active MTP transaction.
       
    71     @see MMTPConnectionProtocol::ReceiveDataComplete
       
    72     @leave One of the system wide error codes, if a processing failure occurs.
       
    73     */
       
    74     virtual void ReceiveDataL(MMTPType& aData, const TMTPTypeRequest& aRequest) = 0;
       
    75 
       
    76     /**
       
    77     Aborts an MTP data object receive sequence in-progress in the connection 
       
    78     transport layer. This sequence is completed when the connection transport 
       
    79     layer signals ReceiveDataComplete to the MTP connection protocol layer 
       
    80     interface.
       
    81     @param aRequest The MTP request dataset of the active MTP transaction.
       
    82     @see ReceiveData
       
    83     @see MMTPConnectionProtocol::ReceiveDataComplete
       
    84     @leave One of the system wide error codes, if a processing failure occurs.
       
    85     */
       
    86     virtual void ReceiveDataCancelL(const TMTPTypeRequest& aRequest) = 0;
       
    87     
       
    88     /**
       
    89     Initiates an MTP data object send sequence in the connection transport 
       
    90     layer. This sequence is completed when the transport layer connection 
       
    91     signals SendDataComplete to the MTP protocol layer notification interface.
       
    92     @param aData The MTP data object source.
       
    93     @param aRequest The MTP request dataset of the active MTP transaction.
       
    94     @see MMTPConnectionProtocol::SendDataComplete
       
    95     @leave One of the system wide error codes, if a processing failure occurs.
       
    96     */
       
    97     virtual void SendDataL(const MMTPType& aData, const TMTPTypeRequest& aRequest) = 0;
       
    98 
       
    99     /**
       
   100     Aborts an MTP data object send sequence in-progress in the connection 
       
   101     transport layer. This sequence is completed when the connection transport 
       
   102     layer signals SendDataComplete to the MTP connection protocol layer 
       
   103     interface.
       
   104     @param aRequest The MTP request dataset of the active MTP transaction.
       
   105     @see SendData
       
   106     @see MMTPConnectionProtocol::SendDataComplete
       
   107     @leave One of the system wide error codes, if a processing failure occurs.
       
   108     */
       
   109     virtual void SendDataCancelL(const TMTPTypeRequest& aRequest) = 0;
       
   110     
       
   111     /**
       
   112     Initiates an MTP event dataset send sequence in the connection 
       
   113     transport layer. This sequence is completed when the connection transport 
       
   114     layer signals SendEventComplete to the MTP connection protocol layer 
       
   115     interface.
       
   116     @param aEvent The MTP event data object source.
       
   117     @see MMTPConnectionProtocol::SendEventComplete
       
   118     @leave One of the system wide error codes, if a processing failure occurs.
       
   119     */
       
   120     virtual void SendEventL(const TMTPTypeEvent& aEvent) = 0;
       
   121     
       
   122     /**
       
   123     Initiates an MTP response dataset send sequence in the connection 
       
   124     transport layer. This sequence is completed when the connection transport 
       
   125     layer signals SendResponseComplete to the MTP connection protocol layer 
       
   126     interface.
       
   127     @param aResponse The MTP response data object source.
       
   128     @param aRequest The MTP request dataset of the active MTP transaction.
       
   129     @see MMTPConnectionProtocol::SendResponseComplete
       
   130     @leave One of the system wide error codes, if a processing failure occurs.
       
   131     */
       
   132     virtual void SendResponseL(const TMTPTypeResponse& aResponse, const TMTPTypeRequest& aRequest) = 0;
       
   133     
       
   134     /**
       
   135     Signals the completion of the active MTP operation request transaction 
       
   136     sequence initiated by a preceding ReceivedRequest signal made to the
       
   137     MTP protocol layer notification interface.
       
   138     @param aResponse The completed MTP request data object.
       
   139     @param aRequest The MTP request dataset of the active MTP transaction.
       
   140     @leave One of the system wide error codes, if a processing failure occurs.
       
   141     */
       
   142     virtual void TransactionCompleteL(const TMTPTypeRequest& aRequest) = 0;
       
   143 
       
   144     /**
       
   145     Unbinds the MTP protocol layer notification interface from the connection transport 
       
   146     layer.
       
   147     @param aProtocol The MTP protocol layer notification interface.
       
   148     */
       
   149     virtual void Unbind(MMTPConnectionProtocol& aProtocol) = 0;
       
   150     
       
   151     /**
       
   152     Provides an MTP connection transport layer extension interface implementation 
       
   153     for the specified interface Uid. 
       
   154     @param aInterfaceUid Unique identifier for the extension interface being 
       
   155     requested.
       
   156     @return Pointer to an interface instance or 0 if the interface is not 
       
   157     supported. Ownership is NOT transfered.
       
   158     */
       
   159     virtual TAny* GetExtendedInterface(TUid aInterfaceUid) = 0;
       
   160     
       
   161     /*
       
   162      * Provide a method to get implementation UID of concrete transport connection bearer
       
   163      * @return Implementation UID of concrete transport connection bearer.
       
   164      */
       
   165     virtual TUint GetImplementationUid() = 0;
       
   166 };
       
   167     
       
   168 #endif // MMTPTRANSPORTCONNECTION_H