mtpfws/mtpfw/transports/transportapi/inc/mmtpconnectionprotocol.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 MMTPCONNECTIONPROTOCOL_H
       
    22 #define MMTPCONNECTIONPROTOCOL_H
       
    23 
       
    24 #include <e32cmn.h>
       
    25 #include <e32def.h>
       
    26 #include <mtp/mtpdataproviderapitypes.h>
       
    27 
       
    28 class MMTPType;
       
    29 class TMTPTypeEvent;
       
    30 class TMTPTypeRequest;
       
    31 class TMTPTypeResponse;
       
    32 class MMTPTransportConnection;
       
    33 
       
    34 /** 
       
    35 Defines the MTP connection protocol layer interface.
       
    36 
       
    37 @internalTechnology
       
    38   
       
    39 */
       
    40 class MMTPConnectionProtocol
       
    41     {
       
    42 public:
       
    43 
       
    44     /**
       
    45     Provides the unique MTP protocol layer assigned identifier of the
       
    46     connection.
       
    47     @return The MTP protocol layer assigned connection identifier.
       
    48     */
       
    49     virtual TUint ConnectionId() const = 0;
       
    50 
       
    51     /**
       
    52     Signals the availability of an MTP event data object received from the MTP
       
    53     transport layer connection.
       
    54     @param aEvent The received MTP event data object.
       
    55     @leave One of the system wide error codes, if a processing failure occurs.
       
    56     */
       
    57     virtual void ReceivedEventL(const TMTPTypeEvent& aEvent) = 0;
       
    58 
       
    59     /**
       
    60     Signals the availability of an MTP request data object received from the MTP
       
    61     transport layer connection.
       
    62     @param aRequest The received MTP request data object.
       
    63     @leave One of the system wide error codes, if a processing failure occurs.
       
    64     */
       
    65     virtual void ReceivedRequestL(const TMTPTypeRequest& aRequest) = 0;
       
    66 
       
    67     /**
       
    68     Signals the completion of an MTP data object receive sequence in the MTP
       
    69     transport layer connection, that was previously initiated by a ReceiveData
       
    70     signal to the transport layer connection interface.
       
    71     @param aErr A system wide error code indicating the completion status of 
       
    72     the sequence.
       
    73     @param aData The MTP data object sink.
       
    74     @param aRequest The MTP request dataset of the active MTP transaction.
       
    75     @leave One of the system wide error codes, if a processing failure occurs.
       
    76     @see MMTPCMMTPTransportConnection::ReceiveData
       
    77     @see MMTPCMMTPTransportConnection::ReceiveDataCancel
       
    78     */
       
    79     virtual void ReceiveDataCompleteL(TInt aErr, const MMTPType& aData, const TMTPTypeRequest& aRequest) = 0;
       
    80 
       
    81     /**
       
    82     Signals the completion of an MTP data object send sequence in the MTP
       
    83     transport layer connection, that was previously initiated by a SendData
       
    84     signal to the transport layer connection interface.
       
    85     @param aErr A system wide error code indicating the completion status of 
       
    86     the sequence.
       
    87     @param aData The MTP data object source.
       
    88     @param aRequest The MTP request dataset of the active MTP transaction.
       
    89     @leave One of the system wide error codes, if a processing failure occurs.
       
    90     @see MMTPCMMTPTransportConnection::SendData
       
    91     @see MMTPCMMTPTransportConnection::SendDataCancel
       
    92     */
       
    93     virtual void SendDataCompleteL(TInt aErr, const MMTPType& aData, const TMTPTypeRequest& aRequest) = 0;
       
    94 
       
    95     /**
       
    96     Signals the completion of an MTP event data object send sequence in the MTP
       
    97     transport layer connection, that was previously initiated by a SendEvent
       
    98     signal to the transport layer connection interface.
       
    99     @param aErr A system wide error code indicating the completion status of 
       
   100     the sequence.
       
   101     @param aData The MTP event data object source.
       
   102     @leave One of the system wide error codes, if a processing failure occurs.
       
   103     @see MMTPCMMTPTransportConnection::SendEvent
       
   104     */
       
   105     virtual void SendEventCompleteL(TInt aErr, const TMTPTypeEvent& aData) = 0;
       
   106 
       
   107     /**
       
   108     Signals the completion of an MTP response data object send sequence in the 
       
   109     MTP transport layer connection, that was previously initiated by a 
       
   110     SendResponse signal to the transport layer connection interface.
       
   111     @param aErr A system wide error code indicating the completion status of 
       
   112     the sequence.
       
   113     @param aResponse The MTP response data object source.
       
   114     @param aRequest The MTP request dataset of the active MTP transaction.
       
   115     @leave One of the system wide error codes, if a processing failure occurs.
       
   116     @see MMTPCMMTPTransportConnection::SendResponse
       
   117     */
       
   118     virtual void SendResponseCompleteL(TInt aErr, const TMTPTypeResponse& aResponse, const TMTPTypeRequest& aRequest) = 0;
       
   119 
       
   120     /**
       
   121     Provides the current MTP transaction state for the specified session.
       
   122     @param aMtpSessionId The MTP connection assigned identifier of the 
       
   123     requested session.
       
   124     @leave KErrArgument, if the specified session identifier is not currently
       
   125     active on the connection.
       
   126     @return The MTP transaction state for the specified session.
       
   127     */
       
   128     virtual TMTPTransactionPhase TransactionPhaseL(TUint32 aMtpSessionId) const = 0;  
       
   129       
       
   130     virtual void Unbind(MMTPTransportConnection& aConnection) = 0;
       
   131 
       
   132     virtual void DisconnectionNotifyL()=0;
       
   133     };
       
   134 #endif // MMTPCONNECTIONPROTOCOL_H