|
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 RMSRPSESSION_H_ |
|
18 #define RMSRPSESSION_H_ |
|
19 |
|
20 |
|
21 // Include Files |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 |
|
25 // INCLUDES |
|
26 #include "MMSRPServerInterface.h" |
|
27 |
|
28 |
|
29 // Forward Declarations |
|
30 class RMSRP; |
|
31 |
|
32 |
|
33 // Class declaration |
|
34 |
|
35 class RMSRPSession : public RSubSessionBase, public MMSRPServerInterface |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * constructor. |
|
40 */ |
|
41 RMSRPSession(); |
|
42 |
|
43 public: // New functions |
|
44 /** |
|
45 * Opens a Sub-Session to MSRP Server |
|
46 * @return Status of the operation |
|
47 */ |
|
48 TInt CreateServerSubSession( RMSRP& aRMSRP, |
|
49 const TUint32 aIapId ); |
|
50 |
|
51 void CloseServerSubSession( ); |
|
52 |
|
53 |
|
54 public: // From base class |
|
55 |
|
56 // From MMSRPServerInterface |
|
57 |
|
58 void GetLocalPathL( TDes8 &aLocalHost, |
|
59 TDes8 &aSessionID ); |
|
60 |
|
61 void Connect( const TDesC8& aRemoteHost, |
|
62 const TUint aRemotePort, |
|
63 const TDesC8& aRemoteSessionID, |
|
64 TRequestStatus& aStatus ); |
|
65 |
|
66 void ListenConnections( const TDesC8& aRemoteHost, |
|
67 const TUint aRemotePort, |
|
68 const TDesC8& aRemoteSessionID, |
|
69 TBool aIsMessage, |
|
70 TRequestStatus& aStatus ); |
|
71 |
|
72 void ListenMessages( TBool aIsMessage, |
|
73 TRequestStatus& aStatus ); |
|
74 |
|
75 void ListenSendResult( const TDesC8& aSessionID, |
|
76 TRequestStatus& aStatus ); |
|
77 |
|
78 TInt SendMessage( TDesC8& aMessageBuffer ); |
|
79 |
|
80 TInt CancelSending( TDesC8& aMessageId ); |
|
81 |
|
82 void CancelReceiving( ); |
|
83 void CancelSendResultListening( ); |
|
84 |
|
85 const TDesC8& GetMessageIdOfSentMessage( ) const; |
|
86 TInt GetStatusOfSentMessage( ) const; |
|
87 TInt GetStatusOfReceivedMessage( ) const; |
|
88 const TDesC8& GetReceivedMessage( ) const; |
|
89 |
|
90 TBool GetListenProgress() const; |
|
91 TInt GetBytesReceived() const; |
|
92 TInt GetTotalBytesReceived() const; |
|
93 |
|
94 TBool GetSendProgress() const; |
|
95 TInt GetBytesSent() const; |
|
96 TInt GetTotalBytes() const; |
|
97 |
|
98 |
|
99 TInt SendFileL(TDesC8& aFileParamBuffer); |
|
100 TInt ReceiveFileL(TDesC8& aFileParamBuffer); |
|
101 private: //variables |
|
102 |
|
103 // Local path data to be recived from the server |
|
104 TPckgBuf< TLocalPathMSRPData > iLocalPathMSRPDataPckg; |
|
105 |
|
106 // Connection data to be sent to server |
|
107 TPckgBuf< TConnectMSRPData > iConnectMSRPDataPckg; |
|
108 |
|
109 // Message sending data to be sent to server |
|
110 TPckgBuf< TSendMSRPData > iSendMSRPDataPckg; |
|
111 |
|
112 // Listen for incoming messages data package |
|
113 TPckgBuf< TListenMSRPData > iListenMSRPDataPckg; |
|
114 |
|
115 // Listen for response to sent messages data package |
|
116 TPckgBuf< TListenSendResultMSRPData > iSendResultListenMSRPDataPckg; |
|
117 |
|
118 }; |
|
119 |
|
120 #endif /* RMSRPSESSION_H_ */ |