|
1 /* |
|
2 * Copyright (c) 2005-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: This is module interface class for MusAvailability Plug-in |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MUSAVASETTINGSIMP_H__ |
|
20 #define __MUSAVASETTINGSIMP_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include "musavasettings.h" |
|
24 #include "musavasettingsobserver.h" |
|
25 #include "musunittesting.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <e32std.h> |
|
29 #include <badesca.h> |
|
30 |
|
31 class CMusAvaSip; |
|
32 |
|
33 /** |
|
34 * CMusAvaSettingsImp class represent the interface for module fetcher. |
|
35 * |
|
36 * This interface class encapsulates module selection for availability Plug-in. |
|
37 * |
|
38 * @lib musavailabilityplugin.lib |
|
39 */ |
|
40 |
|
41 class CMusAvaSettingsImp : public CBase, |
|
42 public MMusAvaSettings |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Two-phased constructor |
|
48 * |
|
49 * @return Returns pointer to CMusAvaSettingsImp object |
|
50 */ |
|
51 |
|
52 static CMusAvaSettingsImp* NewL(); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 * |
|
57 */ |
|
58 |
|
59 ~CMusAvaSettingsImp(); |
|
60 |
|
61 |
|
62 public: // from MMusAvaSettings |
|
63 |
|
64 /** |
|
65 * Returns the fast mode value. |
|
66 */ |
|
67 |
|
68 virtual MusSettingsKeys::TFastMode FastMode() const; |
|
69 |
|
70 /** |
|
71 * Returns the manual activation |
|
72 * |
|
73 */ |
|
74 virtual TManualActivation ManualActivation(); |
|
75 |
|
76 /** |
|
77 * Returns the telephone number of remote host of active CS call. |
|
78 * |
|
79 * @return The telephone number. |
|
80 */ |
|
81 virtual const TDesC& TelNumber() const; |
|
82 |
|
83 /** |
|
84 * Returns the contact name of remote host of active CS call. |
|
85 * |
|
86 * @return The telephone number. |
|
87 */ |
|
88 virtual const TDesC& ContactName() const; |
|
89 |
|
90 /** |
|
91 * Returns a guess for the SIP address of the remote host |
|
92 * |
|
93 * @return The proposal for SIP address |
|
94 */ |
|
95 virtual const TDesC& SipAddressProposal() const; |
|
96 |
|
97 /** |
|
98 * Returns the possible SIP addresses of the remote host. |
|
99 * |
|
100 * @return The SIP addresses in an array. |
|
101 */ |
|
102 virtual const MDesCArray& SipAddresses() const; |
|
103 |
|
104 /** |
|
105 * Returns the contact id of the remote host. |
|
106 * |
|
107 * @return The contact id; KErrNotFound, if not found any. |
|
108 */ |
|
109 virtual TInt ContactId() const; |
|
110 |
|
111 /** |
|
112 * Returns the supported video codecs. |
|
113 * |
|
114 * @return The video codecs |
|
115 */ |
|
116 virtual const MDesCArray& VideoCodecs() const; |
|
117 |
|
118 /** |
|
119 * Returns the supported audio codecs. |
|
120 * |
|
121 * @return The supported audio codecs. |
|
122 */ |
|
123 virtual const MDesCArray& AudioCodecs() const; |
|
124 |
|
125 /** |
|
126 * Returns the id of the preferable SIP profile. |
|
127 * |
|
128 * @return The SIP profile id. |
|
129 */ |
|
130 virtual TInt SipProfileId() const; |
|
131 |
|
132 /** |
|
133 * Sets the settings observer pointer |
|
134 * |
|
135 * @param aObserver Pointer to observer intercase |
|
136 */ |
|
137 virtual void SetObserver( MMusAvaSettingsObserver& aObserver ); |
|
138 |
|
139 /* |
|
140 * Gets the settings observer pointer |
|
141 * |
|
142 */ |
|
143 virtual MMusAvaSettingsObserver* Observer(); |
|
144 |
|
145 /** |
|
146 * Sets the for the manual activation |
|
147 * |
|
148 */ |
|
149 virtual void SetManualActivation( TManualActivation aManualActivation ); |
|
150 |
|
151 |
|
152 public: |
|
153 |
|
154 /** |
|
155 * Returns the current application state. |
|
156 */ |
|
157 MMusAvaSettingsObserver::TApplicationState ApplicationState(); |
|
158 |
|
159 /** |
|
160 * Returns the direction of the mobile call. |
|
161 * |
|
162 * @return 0, if the direction of the call is unknown. |
|
163 * 1, if the call was originated by this phone. |
|
164 * 2, if the call was terminated by this phone |
|
165 */ |
|
166 TInt CallDirection(); |
|
167 |
|
168 /** |
|
169 * Sets the call direction of mobile call. |
|
170 * @param aDirection direction of mobile call |
|
171 * 0, the direction of the call is unknown. |
|
172 * 1, the call was originated by this phone. |
|
173 * 2, the call was terminated by this phone |
|
174 */ |
|
175 void SetCallDirection( TInt aDirection ); |
|
176 |
|
177 /** |
|
178 * Sets the telephone number of remote host of active CS call. |
|
179 * @param aTelNumber telephone number of remote host |
|
180 */ |
|
181 void SetTelNumberL( const TDesC& aTelNumber ); |
|
182 |
|
183 /** |
|
184 * Sets the contact name of remote host of active CS call. |
|
185 * @param aContactName contact name of remote host |
|
186 */ |
|
187 void SetContactNameL( const TDesC& aContactName ); |
|
188 |
|
189 |
|
190 /** |
|
191 * Sets the telephone number of remote host of active CS call. |
|
192 * @param aTelNumber username part of remote host |
|
193 * @param aDomain host part of remote host |
|
194 */ |
|
195 void SetSipAddressProposalL( const TDesC& aTelNumber, |
|
196 const TDesC& aDomain ); |
|
197 |
|
198 /** |
|
199 * Releases current telphone number |
|
200 * |
|
201 */ |
|
202 void ReleseTelNumberL(); |
|
203 |
|
204 /** |
|
205 * Sets the possible SIP addresses of the remote host. |
|
206 * |
|
207 * @param aSipAddresses the SIP addresses in an array. |
|
208 */ |
|
209 void SetSipAddressesL( const MDesCArray& aSipAddresses ); |
|
210 |
|
211 /** |
|
212 * Overaloaded function. |
|
213 * Sets the possible SIP addresses of the remote host. |
|
214 * |
|
215 * @param aSipAddresses the SIP addresses in an array. |
|
216 * Ownership is transferred. |
|
217 */ |
|
218 void SetSipAddressesL(CDesCArray* aSipAddresses ); |
|
219 |
|
220 /** |
|
221 * Sets the contact id of the remote host. |
|
222 * |
|
223 * @param aContactId The contact id; |
|
224 */ |
|
225 void SetContactId( TInt aContactId ); |
|
226 |
|
227 /** |
|
228 * Sets the supported video codecs. |
|
229 * |
|
230 * @param aVideoCodecs the video codecs in an array |
|
231 */ |
|
232 void SetVideoCodecsL( const MDesCArray& aVideoCodecs); |
|
233 |
|
234 /** |
|
235 * Sets the supported audio codecs. |
|
236 * |
|
237 * @param aAudioCodecs the supported audio codecs in an array |
|
238 */ |
|
239 void SetAudioCodecsL( MDesCArray& aAudioCodecs ); |
|
240 |
|
241 /** |
|
242 * Sets the id of the preferable SIP profile. |
|
243 * |
|
244 * @param aProfileId the SIP profile id. |
|
245 */ |
|
246 void SetSipProfileId( TInt aProfileId ); |
|
247 |
|
248 /** |
|
249 * Returns the id of the preferable SIP profile. |
|
250 * |
|
251 * @return The SIP profile id. |
|
252 */ |
|
253 CMusAvaSip& Sip(); |
|
254 |
|
255 /** |
|
256 * Sets the fast mode value |
|
257 */ |
|
258 void SetFastMode( MusSettingsKeys::TFastMode aMode ); |
|
259 |
|
260 /** |
|
261 * Sets contact resolving uri |
|
262 */ |
|
263 void SetUriForContactResolvingL( const TDesC& aRemoteUri ); |
|
264 |
|
265 /** |
|
266 * Gets contact resolving uri |
|
267 */ |
|
268 TPtrC ContactResolvingUri(); |
|
269 |
|
270 private: |
|
271 |
|
272 void CopyDescArrayL( CDesCArray& aTarget, |
|
273 const MDesCArray& aSource ); |
|
274 |
|
275 protected: |
|
276 /** |
|
277 * Constructor |
|
278 * |
|
279 */ |
|
280 |
|
281 CMusAvaSettingsImp(); |
|
282 |
|
283 /** |
|
284 * Perform the second phase construction of a |
|
285 * CMusAvaSettingsImp object |
|
286 * |
|
287 */ |
|
288 |
|
289 void ConstructL(); |
|
290 |
|
291 |
|
292 private: // data |
|
293 |
|
294 /** |
|
295 * Current telphone number |
|
296 * Owns. |
|
297 */ |
|
298 HBufC* iTelNumber; |
|
299 |
|
300 /** |
|
301 * Current Call Direction |
|
302 */ |
|
303 TInt iCallDirection; |
|
304 |
|
305 /** |
|
306 * Current contact name |
|
307 * Owns. |
|
308 */ |
|
309 HBufC* iContactName; |
|
310 |
|
311 /** |
|
312 * Current SIP address guess for the remote host |
|
313 * Owns. |
|
314 */ |
|
315 HBufC* iSipAddressProposal; |
|
316 |
|
317 /** |
|
318 * Contact id of the remote host |
|
319 */ |
|
320 TInt iContactId; |
|
321 |
|
322 /** |
|
323 * Preferable SIP profile ID |
|
324 */ |
|
325 TInt iSipProfileId; |
|
326 |
|
327 /** |
|
328 * Current contact list |
|
329 * Owns. |
|
330 */ |
|
331 CDesCArray* iSipAddresses; |
|
332 |
|
333 /** |
|
334 * Supported video codecs |
|
335 * Owns. |
|
336 */ |
|
337 CDesCArray* iVideoCodecs; |
|
338 |
|
339 /** |
|
340 * Supported audio codecs |
|
341 * Owns. |
|
342 */ |
|
343 CDesCArray* iAudioCodecs; |
|
344 |
|
345 /** |
|
346 * Setting observer. |
|
347 * Not owns. |
|
348 */ |
|
349 MMusAvaSettingsObserver* iObserver; |
|
350 |
|
351 /** |
|
352 * Setting for the Manual activation. |
|
353 */ |
|
354 TManualActivation iManualActivation; |
|
355 |
|
356 /** |
|
357 * Fast mode |
|
358 */ |
|
359 MusSettingsKeys::TFastMode iFastMode; |
|
360 |
|
361 /** |
|
362 * Contact resolving |
|
363 */ |
|
364 HBufC* iContactResolvingUri; |
|
365 |
|
366 MUS_UNITTEST( UT_CMusAvaSettingsImp ) |
|
367 MUS_UNITTEST( UT_CMusAvaOptionHandler ) |
|
368 }; |
|
369 |
|
370 #endif __MUSAVASETTINGSIMP_H__ |
|
371 |