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