|
1 /* |
|
2 * Copyright (c) 2007 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: Interface for session/streams objects. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NSPCONTROLLERIF_H |
|
19 #define NSPCONTROLLERIF_H |
|
20 |
|
21 #include "natfwconnectivityapidefs.h" |
|
22 #include "mnatfwconnectivityobserver.h" |
|
23 |
|
24 class CDesC8Array; |
|
25 class TInetAddr; |
|
26 class CSdpDocument; |
|
27 class MNATFWSocketMediaConnWrapper; |
|
28 class CNATFWCandidate; |
|
29 class CNATFWCredentials; |
|
30 class CNSPContentParser; |
|
31 |
|
32 /** |
|
33 * Interface for session/streams objects. |
|
34 * |
|
35 * Methods available for session/streams objects, |
|
36 * including NAT FW methods. |
|
37 * |
|
38 * @lib natfwsdpprovider.dll |
|
39 * @since S60 3.2 |
|
40 */ |
|
41 class MNSPControllerIF |
|
42 { |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Content parser object is a part of controller, |
|
47 * used via this method. |
|
48 * |
|
49 * @since S60 3.2 |
|
50 * @return Reference to a content parser object. |
|
51 */ |
|
52 virtual const CNSPContentParser& ContentParser() = 0; |
|
53 |
|
54 /** |
|
55 * Wrapper for NAT FW API method CreateSessionL |
|
56 * |
|
57 * @since S60 3.2 |
|
58 * @param aIap The IAP used for a connection. |
|
59 * @param aDomain Used domain for settings query. |
|
60 * @return The ID for the created session. |
|
61 */ |
|
62 virtual TUint CreateSessionL( TUint32 aIapId, const TDesC8& aDomain ) = 0; |
|
63 |
|
64 /** |
|
65 * Wrapper for NAT FW API method LoadPluginL |
|
66 * |
|
67 * @since S60 3.2 |
|
68 * @param aSessionId The ID identifying session. |
|
69 * @param aPlugins Array containing plugin strings. |
|
70 * @param aPluginIndex Index of loaded plugin. |
|
71 */ |
|
72 virtual void LoadPluginL( TUint aSessionId, const CDesC8Array& aPlugins, |
|
73 TInt& aPluginIndex ) = 0; |
|
74 |
|
75 /** |
|
76 * Wrapper for NAT FW API method CreateStreamL |
|
77 * |
|
78 * @since S60 3.2 |
|
79 * @param aSessionId The ID identifying session. |
|
80 * @param aProtocol The protocol to be used. |
|
81 * @param aQoS The desired quality of service. |
|
82 * @return The ID for the created stream. |
|
83 */ |
|
84 virtual TUint CreateStreamL( TUint aSessionId, |
|
85 TUint aProtocol, TInt aQoS ) = 0; |
|
86 |
|
87 /** |
|
88 * Calls NAT FW API method CreateWrapperL |
|
89 * |
|
90 * @since S60 3.2 |
|
91 * @param aSessionId The ID identifying session. |
|
92 * @param aStreamId The ID identifying stream. |
|
93 * @return The interface through which the client can |
|
94 * configure the wrapper. |
|
95 */ |
|
96 virtual MNATFWSocketMediaConnWrapper& CreateWrapperL( |
|
97 TUint aSessionId, TUint aStreamId ) = 0; |
|
98 |
|
99 /** |
|
100 * Wrapper for NAT FW API method FetchCandidateL |
|
101 * |
|
102 * @since S60 3.2 |
|
103 * @param aSessionId The ID identifying session. |
|
104 * @param aStreamId The ID identifying stream. |
|
105 */ |
|
106 virtual void FetchCandidateL( TUint aSessionId, TUint aStreamId, |
|
107 TUint aAddrFamily ) = 0; |
|
108 |
|
109 /** |
|
110 * Wrapper for NAT FW API method FetchCandidatesL |
|
111 * |
|
112 * @since S60 3.2 |
|
113 * @param aSessionId The ID identifying session. |
|
114 * @param aStreamId The ID identifying stream. |
|
115 * @param aCollectionId The stream collection identifier. |
|
116 * @param aComponentId The media component identifier. |
|
117 */ |
|
118 virtual void FetchCandidatesL( TUint aSessionId, TUint aStreamId, |
|
119 TUint aCollectionId, TUint aComponentId, TUint aAddrFamily ) = 0; |
|
120 |
|
121 /** |
|
122 * Wrapper for NAT FW API method SetReceivingStateL |
|
123 * |
|
124 * @since S60 3.2 |
|
125 * @param aSessionId The ID identifying session. |
|
126 * @param aStreamId The ID identifying stream. |
|
127 * @param aState The streaming state. |
|
128 */ |
|
129 virtual void SetReceivingStateL( const CNATFWCandidate& aLocalCand, |
|
130 TNATFWStreamingState aState ) = 0; |
|
131 |
|
132 /** |
|
133 * Wrapper for NAT FW API method SetSendingStateL |
|
134 * |
|
135 * @since S60 3.2 |
|
136 * @param aSessionId The ID identifying session. |
|
137 * @param aStreamId The ID identifying stream. |
|
138 * @param aDestAddr The destination address for the media. |
|
139 * @param aPort The destination port. |
|
140 * @param aState The streaming state. |
|
141 */ |
|
142 virtual void SetSendingStateL( const CNATFWCandidate& aLocalCand, |
|
143 TNATFWStreamingState aState, |
|
144 const TDesC8& aDestAddr, TUint aPort ) = 0; |
|
145 |
|
146 /** |
|
147 * Wrapper for NAT FW API method SetRoleL |
|
148 * |
|
149 * @since S60 3.2 |
|
150 * @param aSessionId The ID identifying session. |
|
151 * @param aRole The role. |
|
152 */ |
|
153 virtual void SetRoleL( TUint aSessionId, TNATFWIceRole aRole ) = 0; |
|
154 |
|
155 /** |
|
156 * Wrapper for NAT FW API method SetCredentialsL |
|
157 * |
|
158 * @since S60 3.2 |
|
159 * @param aSessionId The ID identifying session. |
|
160 * @param aStreamId The ID identifying stream. |
|
161 * @param aCredentials The credentials. |
|
162 */ |
|
163 virtual void SetCredentialsL( TUint aSessionId, |
|
164 TUint aStreamId, const CNATFWCredentials& aCredentials ) = 0; |
|
165 |
|
166 /** |
|
167 * Wrapper for NAT FW API method PerformCandidateChecksL |
|
168 * |
|
169 * @since S60 3.2 |
|
170 * @param aSessionId The ID identifying session. |
|
171 * @param aRemoteCands The remote candidate array. |
|
172 */ |
|
173 virtual void PerformCandidateChecksL( TUint aSessionId, |
|
174 RPointerArray<CNATFWCandidate>& aRemoteCandidates ) = 0; |
|
175 |
|
176 /** |
|
177 * Wrapper for NAT FW API method UpdateIceProcessingL |
|
178 * |
|
179 * @since S60 3.2 |
|
180 * @param aSessionId The ID identifying session. |
|
181 * @param aNewRemoteCands The new remote candidates array. |
|
182 */ |
|
183 virtual void UpdateIceProcessingL( TUint aSessionId, |
|
184 RPointerArray<CNATFWCandidate>& aNewRemoteCands ) = 0; |
|
185 |
|
186 /** |
|
187 * Wrapper for NAT FW API method CloseStreamL |
|
188 * |
|
189 * @since S60 3.2 |
|
190 * @param aSessionId The ID identifying session. |
|
191 * @param aStreamId The ID identifying stream. |
|
192 */ |
|
193 virtual void CloseStreamL( TUint aSessionId, TUint aStreamId ) = 0; |
|
194 |
|
195 /** |
|
196 * Wrapper for NAT FW API method CloseSessionL |
|
197 * |
|
198 * @since S60 3.2 |
|
199 * @param aSessionId The ID identifying session. |
|
200 */ |
|
201 virtual void CloseSessionL( TUint aSessionId ) = 0; |
|
202 |
|
203 /** |
|
204 * Creates Unique id, which is used by NAT FW |
|
205 * to map stream together. |
|
206 * |
|
207 * @since S60 3.2 |
|
208 * @return Unique collection ID. |
|
209 */ |
|
210 virtual TUint CreateUniqueId() = 0; |
|
211 |
|
212 /** |
|
213 * Certains NAT FW Actions execution time is guarded, since network conditions |
|
214 * can cause events to be delayed. Hence Notify functionality is simulated by |
|
215 * timers. |
|
216 * |
|
217 * @since S60 3.2 |
|
218 * @param aSessionId The ID identifying session. |
|
219 * @param aStreamId The ID identifying stream. |
|
220 * @param eEvent The event from NAT FW. |
|
221 * @param aTimerInSeconds The timer value, in seconds. |
|
222 * @return Unique timer transaction ID |
|
223 */ |
|
224 virtual TUint OrderTimeoutL( TUint aSessionId, TUint aStreamId, |
|
225 MNATFWConnectivityObserver::TNATFWConnectivityEvent aEvent, |
|
226 TUint aTimerInSeconds ) = 0; |
|
227 |
|
228 /** |
|
229 * Orders asyncronous call to session, since all updates must be asynchronous |
|
230 * by nature. |
|
231 * |
|
232 * @since S60 3.2 |
|
233 * @param aSessionId The ID identifying session. |
|
234 * @param aDoc Sdp document, ownership transferred. |
|
235 * @return Unique timer transaction ID |
|
236 */ |
|
237 virtual TUint OrderUpdateSdpL( TUint aSessionId, CSdpDocument* aDoc ) = 0; |
|
238 |
|
239 /** |
|
240 * Cancels timer transaction, identified by given transaction id. |
|
241 * |
|
242 * @since S60 3.2 |
|
243 * @param aTransactionId Timer transaction Id. |
|
244 */ |
|
245 virtual void Cancel( TUint aTransactionId ) = 0; |
|
246 |
|
247 /** |
|
248 * Removes all strings from the given array which contain postfix ".ice". |
|
249 * |
|
250 * @since S60 3.2 |
|
251 * @param aDesArray Descriptor array, containing protocol strings. |
|
252 */ |
|
253 virtual void RemoveIce( CDesC8Array& aDesArray ) const = 0; |
|
254 |
|
255 /** |
|
256 * Checks if given string contains postfix ".ice". |
|
257 * |
|
258 * @since S60 3.2 |
|
259 * @param aProtocol Protocol string, should be formulated as "nokia.ice". |
|
260 */ |
|
261 virtual TBool IsIce( const TDesC8& aProtocol ) const = 0; |
|
262 |
|
263 /** |
|
264 * Wrapper for Crypto API services. |
|
265 * |
|
266 * @since S60 3.2 |
|
267 * @param aUsername Descriptor in which the username is |
|
268 * inserted. Max length should be at least 8. |
|
269 */ |
|
270 virtual void GenerateUsernameL( TDes8& aUsername ) = 0; |
|
271 |
|
272 /** |
|
273 * Wrapper for Crypto API services. |
|
274 * |
|
275 * @since S60 3.2 |
|
276 * @param aPassword Descriptor in which the password is |
|
277 * inserted. Max length should be at least 26. |
|
278 */ |
|
279 virtual void GeneratePasswordL( TDes8& aPassword ) = 0; |
|
280 |
|
281 |
|
282 }; |
|
283 |
|
284 #endif // NSPCONTROLLERIF_H |
|
285 |
|
286 // end of file |