|
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 manual activation |
|
66 * |
|
67 */ |
|
68 virtual TManualActivation ManualActivation(); |
|
69 |
|
70 /** |
|
71 * Returns the telephone number of remote host of active CS call. |
|
72 * |
|
73 * @return The telephone number. |
|
74 */ |
|
75 virtual const TDesC& TelNumber() const; |
|
76 |
|
77 /** |
|
78 * Returns the contact name of remote host of active CS call. |
|
79 * |
|
80 * @return The telephone number. |
|
81 */ |
|
82 virtual const TDesC& ContactName() const; |
|
83 |
|
84 /** |
|
85 * Returns a guess for the SIP address of the remote host |
|
86 * |
|
87 * @return The proposal for SIP address |
|
88 */ |
|
89 virtual const TDesC& SipAddressProposal() const; |
|
90 |
|
91 /** |
|
92 * Returns the possible SIP addresses of the remote host. |
|
93 * |
|
94 * @return The SIP addresses in an array. |
|
95 */ |
|
96 virtual const MDesCArray& SipAddresses() const; |
|
97 |
|
98 /** |
|
99 * Returns the contact id of the remote host. |
|
100 * |
|
101 * @return The contact id; KErrNotFound, if not found any. |
|
102 */ |
|
103 virtual TInt ContactId() const; |
|
104 |
|
105 /** |
|
106 * Returns the supported video codecs. |
|
107 * |
|
108 * @return The video codecs |
|
109 */ |
|
110 virtual const MDesCArray& VideoCodecs() const; |
|
111 |
|
112 /** |
|
113 * Returns the supported audio codecs. |
|
114 * |
|
115 * @return The supported audio codecs. |
|
116 */ |
|
117 virtual const MDesCArray& AudioCodecs() const; |
|
118 |
|
119 /** |
|
120 * Returns the id of the preferable SIP profile. |
|
121 * |
|
122 * @return The SIP profile id. |
|
123 */ |
|
124 virtual TInt SipProfileId() const; |
|
125 |
|
126 /** |
|
127 * Sets the settings observer pointer |
|
128 * |
|
129 * @param aObserver Pointer to observer intercase |
|
130 */ |
|
131 virtual void SetObserver( MMusAvaSettingsObserver& aObserver ); |
|
132 |
|
133 /** |
|
134 * Sets the for the manual activation |
|
135 * |
|
136 */ |
|
137 virtual void SetManualActivation( TManualActivation aManualActivation ); |
|
138 |
|
139 |
|
140 /** |
|
141 * Returns the direction of the mobile call. |
|
142 * |
|
143 * @return 0, if the direction of the call is unknown. |
|
144 * 1, call is from public number. |
|
145 * 2, call is from private number |
|
146 */ |
|
147 virtual TInt CallPrivacy(); |
|
148 |
|
149 |
|
150 public: |
|
151 |
|
152 /** |
|
153 * Returns the current application state. |
|
154 */ |
|
155 MMusAvaSettingsObserver::TApplicationState ApplicationState(); |
|
156 |
|
157 /** |
|
158 * Returns the direction of the mobile call. |
|
159 * |
|
160 * @return 0, if the direction of the call is unknown. |
|
161 * 1, if the call was originated by this phone. |
|
162 * 2, if the call was terminated by this phone |
|
163 */ |
|
164 TInt CallDirection(); |
|
165 |
|
166 /** |
|
167 * Sets the call direction of mobile call. |
|
168 * @param aDirection direction of mobile call |
|
169 * 0, the direction of the call is unknown. |
|
170 * 1, the call was originated by this phone. |
|
171 * 2, the call was terminated by this phone |
|
172 */ |
|
173 void SetCallDirection( TInt aDirection ); |
|
174 |
|
175 /** |
|
176 * Sets the telephone number of remote host of active CS call. |
|
177 * @param aTelNumber telephone number of remote host |
|
178 */ |
|
179 void SetTelNumberL( const TDesC& aTelNumber ); |
|
180 |
|
181 /** |
|
182 * Sets the contact name of remote host of active CS call. |
|
183 * @param aContactName contact name of remote host |
|
184 */ |
|
185 void SetContactNameL( const TDesC& aContactName ); |
|
186 |
|
187 |
|
188 /** |
|
189 * Sets the telephone number of remote host of active CS call. |
|
190 * @param aTelNumber username part of remote host |
|
191 * @param aDomain host part of remote host |
|
192 */ |
|
193 void SetSipAddressProposalL( const TDesC& aTelNumber, |
|
194 const TDesC& aDomain ); |
|
195 |
|
196 /** |
|
197 * Releases current telphone number |
|
198 * |
|
199 */ |
|
200 void ReleseTelNumberL(); |
|
201 |
|
202 /** |
|
203 * Sets the possible SIP addresses of the remote host. |
|
204 * |
|
205 * @param aSipAddresses the SIP addresses in an array. |
|
206 */ |
|
207 void SetSipAddressesL( const MDesCArray& aSipAddresses ); |
|
208 |
|
209 /** |
|
210 * Overaloaded function. |
|
211 * Sets the possible SIP addresses of the remote host. |
|
212 * |
|
213 * @param aSipAddresses the SIP addresses in an array. |
|
214 * Ownership is transferred. |
|
215 */ |
|
216 void SetSipAddressesL(CDesCArray* aSipAddresses ); |
|
217 |
|
218 /** |
|
219 * Sets the contact id of the remote host. |
|
220 * |
|
221 * @param aContactId The contact id; |
|
222 */ |
|
223 void SetContactId( TInt aContactId ); |
|
224 |
|
225 /** |
|
226 * Sets the supported video codecs. |
|
227 * |
|
228 * @param aVideoCodecs the video codecs in an array |
|
229 */ |
|
230 void SetVideoCodecsL( const MDesCArray& aVideoCodecs); |
|
231 |
|
232 /** |
|
233 * Sets the supported audio codecs. |
|
234 * |
|
235 * @param aAudioCodecs the supported audio codecs in an array |
|
236 */ |
|
237 void SetAudioCodecsL( MDesCArray& aAudioCodecs ); |
|
238 |
|
239 /** |
|
240 * Sets the id of the preferable SIP profile. |
|
241 * |
|
242 * @param aProfileId the SIP profile id. |
|
243 */ |
|
244 void SetSipProfileId( TInt aProfileId ); |
|
245 |
|
246 |
|
247 /** |
|
248 * Sets the call privacy e.g. current call number is from private number, |
|
249 * should be shown on MT. |
|
250 * |
|
251 * @param aPrivacy the SIP profile id. |
|
252 */ |
|
253 void SetCallPrivacy( TInt aPrivacy ); |
|
254 |
|
255 /** |
|
256 * Returns the id of the preferable SIP profile. |
|
257 * |
|
258 * @return The SIP profile id. |
|
259 */ |
|
260 CMusAvaSip& Sip(); |
|
261 |
|
262 |
|
263 |
|
264 private: |
|
265 |
|
266 void CopyDescArrayL( CDesCArray& aTarget, |
|
267 const MDesCArray& aSource ); |
|
268 |
|
269 protected: |
|
270 /** |
|
271 * Constructor |
|
272 * |
|
273 */ |
|
274 |
|
275 CMusAvaSettingsImp(); |
|
276 |
|
277 /** |
|
278 * Perform the second phase construction of a |
|
279 * CMusAvaSettingsImp object |
|
280 * |
|
281 */ |
|
282 |
|
283 void ConstructL(); |
|
284 |
|
285 |
|
286 private: // data |
|
287 |
|
288 /** |
|
289 * Current telphone number |
|
290 * Owns. |
|
291 */ |
|
292 HBufC* iTelNumber; |
|
293 |
|
294 /** |
|
295 * Current Call Direction |
|
296 */ |
|
297 TInt iCallDirection; |
|
298 |
|
299 /** |
|
300 * Current contact name |
|
301 * Owns. |
|
302 */ |
|
303 HBufC* iContactName; |
|
304 |
|
305 /** |
|
306 * Current SIP address guess for the remote host |
|
307 * Owns. |
|
308 */ |
|
309 HBufC* iSipAddressProposal; |
|
310 |
|
311 /** |
|
312 * Contact id of the remote host |
|
313 */ |
|
314 TInt iContactId; |
|
315 |
|
316 /** |
|
317 * Preferable SIP profile ID |
|
318 */ |
|
319 TInt iSipProfileId; |
|
320 |
|
321 /** |
|
322 * Current contact list |
|
323 * Owns. |
|
324 */ |
|
325 CDesCArray* iSipAddresses; |
|
326 |
|
327 /** |
|
328 * Supported video codecs |
|
329 * Owns. |
|
330 */ |
|
331 CDesCArray* iVideoCodecs; |
|
332 |
|
333 /** |
|
334 * Supported audio codecs |
|
335 * Owns. |
|
336 */ |
|
337 CDesCArray* iAudioCodecs; |
|
338 |
|
339 /** |
|
340 * Setting observer. |
|
341 * Not owns. |
|
342 */ |
|
343 MMusAvaSettingsObserver* iObserver; |
|
344 |
|
345 /** |
|
346 * Setting for the Manual activation. |
|
347 */ |
|
348 TManualActivation iManualActivation; |
|
349 |
|
350 /** |
|
351 * Call privacy indicator |
|
352 * |
|
353 */ |
|
354 |
|
355 TInt iCallPrivacy; |
|
356 |
|
357 MUS_UNITTEST( UT_CMusAvaSettingsImp ) |
|
358 MUS_UNITTEST( UT_CMusAvaOptionHandler ) |
|
359 MUS_UNITTEST( UT_CMusAvaTerminal ) |
|
360 }; |
|
361 |
|
362 #endif __MUSAVASETTINGSIMP_H__ |
|
363 |