multimediacommscontroller/mmccsubcontroller/inc/msrpcallbackmgrobserver.h
author vnuitven <>
Mon, 06 Sep 2010 17:32:13 +0530
branchrcs
changeset 49 64c62431ac08
child 50 1d8943dd8be6
permissions -rw-r--r--
RCS feature support in MCE/MCC. Provides APIs to do RCS chat and file transfer as per RCS specificaitons. For both os these MCE uses the MSRP protocol.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     1
/*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     2
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     3
* All rights reserved.
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     8
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     9
* Initial Contributors:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    11
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    12
* Contributors:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    13
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    14
* Description:    Provides interface for UL/DL subthread clients
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    15
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    16
*/
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    17
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    18
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    19
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    20
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    21
#ifndef CMSRPCALLBACKMGROBSERVER_H
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    22
#define CMSRPCALLBACKMGROBSERVER_H
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    23
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    24
#include "mccmsrpconnobserver.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    25
#include "mccmsrpdataobserver.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    26
#include "MMSRPSessionObserver.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    27
//#include "mmfcontrollerframework.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    28
#include <mmf/common/mmfcontrollerframework.h>
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    29
#include <mmccevents.h>
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    30
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    31
/**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    32
*  callback function for received msrp packets. 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    33
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    34
*  @lib mccmsrpsourcesink.dll
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    35
*/
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    36
class CMsrpCallbackMgrObserver : public CBase, public MMSRPSessionObserver
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    37
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    38
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    39
	public:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    40
		static CMsrpCallbackMgrObserver* NewL(MAsyncEventHandler& aEventHandler);
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    41
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    42
    public:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    43
        
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    44
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    45
         * A MSRP message has been received from the network.
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    46
         * This function is called when the MSRP message was received from the network
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    47
         * the ownership is transferred
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    48
         * @param aMessage the received message
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    49
         * @param aStatus, KErrNone with complete message, KErrCancel if terminated
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    50
         */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    51
        virtual void IncomingMessage( HBufC8* aMessageContent, TInt aStatus );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    52
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    53
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    54
         * A MSRP REPORT message has been received from the network
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    55
         * This function is called to indicate to the client that a recipient
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    56
         * wishes to indicate a range of bytes as received. Alternative the
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    57
         * recipient might use REPORT to indicate an error. In case of error the
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    58
         * MSRP stops sending the message. However, it is client's responsibility
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    59
         * how the handle the information
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    60
         * @param aStatus status code from the REPORT message
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    61
         * @param aRangeStart start of byte range received
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    62
         * @param aRangeEnd end of byte range received
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    63
         * @param aTotal Total number of bytes in the message
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    64
         */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    65
        virtual void IncomingReport( TInt aStatus, TInt aRangeStart,
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    66
            TInt aRangeEnd, TInt aTotal );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    67
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    68
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    69
         * The SendMessage status of the message sending
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    70
         * The possible status code are defined by CMSRPConnection::TMSRPErrorCodes
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    71
         * or system wide error codes
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    72
         * @param aStatus status of the operation
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    73
         * @param aMessageId message identifier of the sent message
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    74
         */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    75
        virtual void SendResult( TInt aStatus, const TDesC8& aMessageid );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    76
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    77
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    78
         * If listen port request fails this is called
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    79
         * @param aStatus error code of the operation
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    80
         */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    81
        virtual void ListenPortFailure( TInt aStatus );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    82
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    83
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    84
         * When ConnectL function is used to establish a connection to remote
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    85
         * user, this is used to return the connection status. After ConnectL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    86
         * the client must wait for this callback before sending or listening
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    87
         * messages. This is called also if the SendMessageL method is called
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    88
         * directly before establishing a connection
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    89
         * @param aStatus system-wide error code
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    90
         */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    91
        virtual void ConnectStatus( TInt aStatus );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    92
        
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    93
        /* Notifies that the entire file has been sent successfully */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    94
        void SendFileNotification(TBool aStatus) ;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    95
        
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    96
        /* Notifies that the entire file has been received successfully */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    97
        void ReceiveFileNotification(TBool status) ;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    98
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    99
        * File data transfer progress. returns the progress of data transfer
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   100
        * @param aTransferred number of bytes transferred
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   101
        * @param aTotal Total amount of bytes to be transferred
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   102
        */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   103
        void FileSendProgress( TInt aTransferred, TInt aTotal ) ;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   104
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   105
        /**
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   106
        * File receive progress, number of bytes received from incoming data
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   107
        * @param aReceived number of bytes received
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   108
        * @param aTotal Total amount of bytes to be received
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   109
        */
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   110
       void FileReceiveProgress( TInt aReceived, TInt aTotal );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   111
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   112
		public:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   113
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   114
		MMsrpConnectionObserver *iConnObserver;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   115
		MMsrpDataObserver *iDataObserver;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   116
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   117
		void RegisterConnectionObserver (MMsrpConnectionObserver& aObserver);
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   118
		void RegisterDataObserver (MMsrpDataObserver& aObserver);
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   119
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   120
		void ConstructL();
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   121
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   122
		private:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   123
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   124
		CMsrpCallbackMgrObserver (MAsyncEventHandler& aEventHandler);
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   125
		TMccEvent  iMccEvent;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   126
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   127
        // Eventhandler for errors
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   128
        MAsyncEventHandler& iEventHandler;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   129
    };
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   130
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   131
#endif // End of MMSRPCALLBACKMGROBSERVER.H