Msrp/MsrpClient/inc/MMSRPSessionObserver.h
branchMSRP_FrameWork
changeset 25 505ad3f0ce5c
child 58 cdb720e67852
equal deleted inserted replaced
22:f1578314b8da 25:505ad3f0ce5c
       
     1 /*
       
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html."
       
     8 * Initial Contributors:
       
     9 * Nokia Corporation - initial contribution.
       
    10 * Contributors:
       
    11 *
       
    12 * Description:
       
    13 * MSRP Implementation
       
    14 *
       
    15 */
       
    16 
       
    17 #ifndef MMSRPSESSIONOBSERVER_H_
       
    18 #define MMSRPSESSIONOBSERVER_H_
       
    19 
       
    20 // INCLUDES
       
    21 #include "MsrpCommon.h"
       
    22 
       
    23 // FORWARD DECLARATIONS
       
    24 class CMSRPMessage;
       
    25 
       
    26 
       
    27 class MMSRPSessionObserver
       
    28     {
       
    29     public:
       
    30         
       
    31         /**
       
    32          * An MSRP SEND request has been received from the network.
       
    33          * The content of the request is given to the client, along with the 
       
    34          * status of receiving the request. Ownership of the content is transferred.
       
    35          * @param aMessageContent the received message content
       
    36          * @param aStatus KErrNone with complete message, KErrCancel if terminated
       
    37          */
       
    38         virtual void IncomingMessage( HBufC8* aMessageContent, TInt aStatus ) = 0;
       
    39 
       
    40         /**
       
    41          * An MSRP REPORT request has been received from the network.
       
    42          * This function is called to notify the client that a recipient wishes
       
    43          * to indicate a range of bytes as received, or to indicate an error. 
       
    44          * However, it is the client's responsibility to handle this information.
       
    45          * @param aStatus status code from the REPORT request
       
    46          * @param aRangeStart start of the byte range being reported 
       
    47          * @param aRangeEnd end of the byte range being reported
       
    48          * @param aTotal total number of bytes in the message
       
    49          * NOTE: This callback not issued currently, REPORTs support not present
       
    50          */
       
    51         virtual void IncomingReport( TInt aStatus, TInt aRangeStart,
       
    52             TInt aRangeEnd, TInt aTotal ) = 0;
       
    53 
       
    54         /**
       
    55          * Result of the send operation initiated by the client
       
    56          * @param aStatus error code as defined in MsrpCommon::TErrorCode
       
    57          * @param aMessageId message identifier of the sent message that
       
    58          * was returned by the SendBuffer call
       
    59          */
       
    60         virtual void SendResult( TInt aStatus, const TDesC8& aMessageid ) = 0;
       
    61 
       
    62         /**
       
    63          * Indicates a failure in connection establishment
       
    64          * or in case of any error in an established connection
       
    65          * @param aStatus a system wide error code
       
    66          */
       
    67         virtual void ListenPortFailure( TInt aStatus ) = 0;
       
    68 
       
    69         /**
       
    70          * Result of the connection attempt made by the client. This callback is
       
    71          * issued, both while initiating a connection with ConnectL and while
       
    72          * receiving a connection with ListenL, once the call completes.
       
    73          * Client must wait for this callback before trying to send out any
       
    74          * messages to the remote user.
       
    75          * @param aStatus KErrNone or a system wide error code
       
    76          */
       
    77         virtual void ConnectStatus( TInt aStatus ) = 0;
       
    78         
       
    79         /**
       
    80          * Notifies that the entire file has been sent successfully 
       
    81          */
       
    82         virtual void SendFileNotification(TBool aStatus) = 0;
       
    83         
       
    84         /**
       
    85          * Notifies that the entire file has been received successfully 
       
    86          */
       
    87         virtual void ReceiveFileNotification(TBool status) = 0;
       
    88         
       
    89         /**
       
    90         * File data transfer progress. returns the progress of data transfer
       
    91         * @param aTransferred number of bytes transferred
       
    92         * @param aTotal Total amount of bytes to be transferred
       
    93         */
       
    94         virtual void FileSendProgress( TInt aTransferred, TInt aTotal ) = 0;
       
    95 
       
    96         /**
       
    97         * File receive progress, number of bytes received from incoming data
       
    98         * @param aReceived number of bytes received
       
    99         * @param aTotal Total amount of bytes to be received
       
   100         */
       
   101         virtual void FileReceiveProgress( TInt aReceived, TInt aTotal ) = 0;
       
   102         
       
   103     };
       
   104 
       
   105 #endif /* MMSRPSESSIONOBSERVER_H_ */