|
1 /* |
|
2 * Copyright (c) 2008-2009 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: VoIP-specific customization class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CPHONECUSTOMIZATIONVOIP_H |
|
20 #define C_CPHONECUSTOMIZATIONVOIP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <SettingsInternalCRKeys.h> |
|
24 #include <telmenuextension.h> |
|
25 #include <spdefinitions.h> |
|
26 #include "mphonecustomization.h" |
|
27 #include "mphonebuttoncustomization.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPhoneStateMachine; |
|
31 class MPhoneViewCommandHandle; |
|
32 class CPhoneExtensionHandler; |
|
33 class MPhoneDialerController; |
|
34 class CPhoneViewCustomizationVoip; |
|
35 class CPhoneStateUtilsVoip; |
|
36 class CPhoneUnattendedTransferCmdHandler; |
|
37 class CPhoneNewCallCmdHandler; |
|
38 class CEikMenuPaneItem; |
|
39 class CCoeEnv; |
|
40 class CPhoneVccHandler; |
|
41 class CPhoneCallForwardQueryHandler; |
|
42 |
|
43 // CONSTANTS |
|
44 |
|
45 const TInt KMaxVoIPServiceName = 100; |
|
46 |
|
47 // CLASS DECLARATION |
|
48 /** |
|
49 * VoIP-specific customization class. |
|
50 */ |
|
51 NONSHARABLE_CLASS( CPhoneCustomizationVoip ): public CBase, |
|
52 public MPhoneCustomization, public MPhoneButtonCustomization |
|
53 { |
|
54 public: // Data |
|
55 |
|
56 /** |
|
57 * Features for multicall case |
|
58 */ |
|
59 enum TFeature |
|
60 { |
|
61 EFeatureNone, |
|
62 EFeatureConference, |
|
63 EFeatureTransfer |
|
64 }; |
|
65 public: |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~CPhoneCustomizationVoip(); |
|
71 |
|
72 /** |
|
73 * Creates the VoIP-specific utility class |
|
74 * @param aStateMachine: a container of state objects |
|
75 * @return an instance of class CPhoneCustomizationVoip |
|
76 */ |
|
77 static CPhoneCustomizationVoip* NewL( |
|
78 MPhoneStateMachine& aStateMachine, |
|
79 MPhoneViewCommandHandle& aViewCommandHandle ); |
|
80 |
|
81 // from base class MPhoneCustomization |
|
82 |
|
83 /** |
|
84 * From MPhoneCustomization. |
|
85 * Customizes menu bar. |
|
86 * @param aResourceId Menu bar resource identifier. |
|
87 * @param aMenuBar Menu bar. |
|
88 */ |
|
89 void CustomizeMenuBarL( TInt aResourceId, CEikMenuBar* aMenuBar ); |
|
90 |
|
91 /** |
|
92 * From MPhoneCustomization. |
|
93 * Customizes menu pane. |
|
94 * @param aResourceId Menu pane resource identifier. |
|
95 * @param aMenuPane Menu pane. |
|
96 */ |
|
97 void CustomizeMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
98 |
|
99 /** |
|
100 * From MPhoneCustomization. |
|
101 * Customizes call header texts shown in a call bubble. |
|
102 * @param aCallId Call identifier. |
|
103 * @param aHeaderData Call header data to be modified. |
|
104 * @param aInCallNumberText In call number text (Call 1, Call 2...). |
|
105 */ |
|
106 void ModifyCallHeaderTexts( TInt aCallId, |
|
107 TPhoneCmdParamCallHeaderData* aHeaderData, |
|
108 const TDesC& aInCallNumberText ); |
|
109 |
|
110 /** |
|
111 * From MPhoneCustomization. |
|
112 * Handles custom menu commands. |
|
113 * @param aCommand Command id. |
|
114 * @return ETrue if command handled. |
|
115 */ |
|
116 TBool HandleCommandL( TInt aCommand ); |
|
117 |
|
118 /** |
|
119 * From MPhoneCustomization. |
|
120 * Checks is alphanumeric mode allowed for number entry/ |
|
121 * dialer. |
|
122 * @return ETrue if allowed. |
|
123 */ |
|
124 TBool AllowAlphaNumericMode(); |
|
125 |
|
126 /** |
|
127 * From MPhoneCustomization. |
|
128 * Returns resource id for soft keys. |
|
129 * @return Resource id. |
|
130 */ |
|
131 TInt CustomizeSoftKeys(); |
|
132 |
|
133 /** |
|
134 * From MPhoneCustomization. |
|
135 * Returns text resource id for private call header. |
|
136 * @return Resource id. |
|
137 */ |
|
138 TInt CustomizeCallHeaderText(); |
|
139 |
|
140 /** |
|
141 * From MPhoneCustomization. |
|
142 * Returns text resource id for busy note. |
|
143 * @return Resource id. |
|
144 */ |
|
145 TInt CustomizeBusyNoteText(); |
|
146 |
|
147 /** |
|
148 * From MPhoneCustomization. |
|
149 * Handles calls from number entry. |
|
150 * @return ETrue when call is handled by customization. |
|
151 * EFalse otherwice. |
|
152 */ |
|
153 TBool HandleCallFromNumberEntryL(); |
|
154 |
|
155 /** |
|
156 * A message handling function for Phone Engine messages |
|
157 * @param aMessage Id of the message |
|
158 * @param aCallId The call id of the call |
|
159 * @return ETrue if message was handled |
|
160 */ |
|
161 TBool HandlePhoneEngineMessageL( |
|
162 const TInt aMessage, |
|
163 TInt aCallId ); |
|
164 |
|
165 /** |
|
166 * Handles dial by unknown service id. |
|
167 * @param aNumber Number/Address |
|
168 */ |
|
169 void HandleDialL( const TDesC& aNumber ); |
|
170 |
|
171 // from base class MPhoneButtonCustomization |
|
172 |
|
173 /** |
|
174 * From MPhoneButtonCustomization. |
|
175 * Customizes touch pane buttons. |
|
176 * @param aTouchPane Interface to add and dimm |
|
177 * bubble touch pane buttons. |
|
178 */ |
|
179 void CustomizeTouchPaneButtons( |
|
180 MBubbleTouchPaneInterface& aTouchPane ); |
|
181 |
|
182 protected: |
|
183 |
|
184 CPhoneCustomizationVoip( |
|
185 MPhoneStateMachine& aStateMachine, |
|
186 MPhoneViewCommandHandle& aViewCommandHandle ); |
|
187 |
|
188 virtual void ConstructL(); |
|
189 |
|
190 private: |
|
191 /** |
|
192 * VoIP supported check. |
|
193 */ |
|
194 TBool VoIPSupportedL(); |
|
195 |
|
196 /** |
|
197 * Get VoIP services |
|
198 * @param aVoipServiceIds On return, contains the list of VoIP services |
|
199 */ |
|
200 void GetVoIPServiceIdsL( RIdArray& aVoipServiceIds ) const; |
|
201 |
|
202 /** |
|
203 * Get the service provider name |
|
204 * @param aServiceId The service, whose name is requested |
|
205 * @param aServiceName On return, contains the service name |
|
206 */ |
|
207 void GetVoipServiceNameL( TServiceId aServiceId, TDes& aServiceName ) const; |
|
208 |
|
209 /** |
|
210 * Modifies menu when there is active call. |
|
211 * @param aResourceId Menu resource id. |
|
212 * @param aMenuPane Menu pane |
|
213 */ |
|
214 void ModifyInCallMenuL( TInt aResourceId, CEikMenuPane& aMenuPane ); |
|
215 |
|
216 /** |
|
217 * Modifies menu when there is dialer/number entry shown. |
|
218 * |
|
219 * @param aResourceId Menu pane resource identifier. |
|
220 * @param aMenuPane Menu pane. |
|
221 */ |
|
222 void ModifyNumberAcquisitionMenuL( |
|
223 TInt aResourceId, CEikMenuPane& aMenuPane ); |
|
224 |
|
225 /** |
|
226 * Inserts "Internet call" menu item to the given menu pane. |
|
227 * |
|
228 * @param aResourceId Menu pane resource identifier. |
|
229 * @param aMenuPane Menu pane. |
|
230 */ |
|
231 void InsertInternetCallMenuItemL( TInt aResourceId, |
|
232 CEikMenuPane& aMenuPane ); |
|
233 |
|
234 /** |
|
235 * Inserts menu item for changing between alpha and numeric input |
|
236 * modes to the given menu pane. |
|
237 * |
|
238 * @param aMenuPane Menu pane. |
|
239 */ |
|
240 void InsertTextInputModeChangeMenuItemL( CEikMenuPane& aMenuPane ); |
|
241 |
|
242 /** |
|
243 * Resolves active calls from phoneengine. |
|
244 * @param aArray Active call array. |
|
245 */ |
|
246 void GetActiveCallArrayL( |
|
247 RArray<CTelMenuExtension::TCallInfo>& aArray ); |
|
248 |
|
249 /** |
|
250 * Resolves most active call. |
|
251 * This is used to determine which plug-in customizes menu pane |
|
252 * and handles command. |
|
253 * @param aArray Active call array. |
|
254 */ |
|
255 TInt ResolveMostActiveCallL( |
|
256 const RArray<CTelMenuExtension::TCallInfo>& aArray ); |
|
257 |
|
258 /** |
|
259 * Returns service id for activest call |
|
260 * by active call array. |
|
261 * @param aArray Active call array. |
|
262 * @return Service id. |
|
263 */ |
|
264 TUint ServiceIdForActivestCallL( |
|
265 const RArray<CTelMenuExtension::TCallInfo>& aArray ); |
|
266 |
|
267 /** |
|
268 * Checks is feature supported. |
|
269 * @since S60 v5.1 |
|
270 * @param aFeature A feature to be checked. |
|
271 * @return ETrue if feature supported. |
|
272 */ |
|
273 TBool IsFeatureSupported( TFeature aFeature ); |
|
274 |
|
275 /** |
|
276 * Checks is feature supported by call type. |
|
277 * E.g. Conference not supported if held voip call |
|
278 * and active CS call. |
|
279 * @since S60 v5.1 |
|
280 * @leave Leaves if check not succeed. |
|
281 * @param aFeature A feature to be checked. |
|
282 * @return ETrue if feature supported. |
|
283 */ |
|
284 TBool CheckFeatureSupportByCallTypeL( |
|
285 TFeature aFeature ); |
|
286 |
|
287 /** |
|
288 * Customizes touch pane buttons by extension. |
|
289 * @leave KErrNotFound if extension not found. |
|
290 * @param aTouchPane Interface to add and dimm |
|
291 * bubble touch pane buttons. |
|
292 */ |
|
293 void CustomizeTouchPaneUsingExtensionL( |
|
294 MBubbleTouchPaneInterface& aTouchPane ); |
|
295 |
|
296 /** |
|
297 * Shows "Enabling %U service" wait note |
|
298 */ |
|
299 void LaunchEnablingServiceNoteL(); |
|
300 |
|
301 /** |
|
302 * Show global ErrorNote |
|
303 * @param aResourceId resource id to be resolved |
|
304 */ |
|
305 void SendGlobalErrorNoteL( TInt aResourceId ); |
|
306 |
|
307 /** |
|
308 * Show global InfoNote |
|
309 * @param aResourceId resource id to be resolved |
|
310 */ |
|
311 void SendGlobalInfoNoteL( TInt aResourceId ); |
|
312 |
|
313 /** |
|
314 * Fits URI to call bubble lines. |
|
315 * @param aCLIText Full caller address. |
|
316 * @param aSipURI returns first line of bubble. |
|
317 * @param aSipURIDomainPart returns second line of bubble. |
|
318 */ |
|
319 void HandleURIFittingToCallBubble( const TDesC& aCLIText, |
|
320 TDes& aSipURI, TDes& aSipURIDomainPart ); |
|
321 |
|
322 /** |
|
323 * Returns VoIP state utils. |
|
324 * @return VoIP state utils. |
|
325 */ |
|
326 CPhoneStateUtilsVoip& StateUtils(); |
|
327 |
|
328 /** |
|
329 * Take care of actions when callsecurestatus |
|
330 * change. |
|
331 * @param aCallId CallId of the call. |
|
332 */ |
|
333 void HandleCallSecureStatusChangeL( TInt aCallId ); |
|
334 |
|
335 /** |
|
336 * Creates menu pane item with specified command and text resource |
|
337 * identifiers. |
|
338 * |
|
339 * @param aCommandId Command identifier. |
|
340 * @param aTextResourceId Text resource identifier. |
|
341 * @return Menu pane item. |
|
342 */ |
|
343 CEikMenuPaneItem* CreateMenuPaneItemLC( |
|
344 TInt aCommandId, TInt aTextResourceId ) const; |
|
345 |
|
346 /** |
|
347 * Creates a VoIP menu pane item with specified command and text resource |
|
348 * @param aCommandId Command identifier. |
|
349 * @param aTextResourceId Text resource identifier. |
|
350 * @return Menu pane item. |
|
351 */ |
|
352 CEikMenuPaneItem* CreateMenuPaneItemLC( |
|
353 TInt aCommandId, TServiceId aServiceId ) const; |
|
354 |
|
355 /** |
|
356 * Adds handover menu item to menu. |
|
357 * @param aResourceId menu resource |
|
358 * @param aMenuPane Menu pane. |
|
359 */ |
|
360 void AddHandoverMenuItemIfNeededL( |
|
361 TInt aResourceId, CEikMenuPane& aMenuPane ); |
|
362 |
|
363 /** |
|
364 * Gets phone number from the phone number entry. |
|
365 * @return Phone number |
|
366 */ |
|
367 HBufC* PhoneNumberFromEntryLC() const; |
|
368 |
|
369 private: // Data |
|
370 |
|
371 /** |
|
372 * Control environment. |
|
373 */ |
|
374 CCoeEnv& iCoeEnv; |
|
375 |
|
376 /** |
|
377 * Interface for setting and getting active state |
|
378 */ |
|
379 MPhoneStateMachine& iStateMachine; |
|
380 |
|
381 /** |
|
382 * Reference to the Phone UI View command handle |
|
383 */ |
|
384 MPhoneViewCommandHandle& iViewCommandHandle; |
|
385 |
|
386 /** |
|
387 * Extension handler. |
|
388 * Own. |
|
389 */ |
|
390 CPhoneExtensionHandler* iExtensionHandler; |
|
391 |
|
392 /** |
|
393 * Phone view customization. |
|
394 */ |
|
395 CPhoneViewCustomizationVoip* iPhoneViewCustomization; |
|
396 |
|
397 /** |
|
398 * Unattended transfer command handler. |
|
399 */ |
|
400 CPhoneUnattendedTransferCmdHandler* iTransferCmdHandler; |
|
401 |
|
402 /** |
|
403 * New Internet call command handler. |
|
404 */ |
|
405 CPhoneNewCallCmdHandler* iNewCallCmdHandler; |
|
406 |
|
407 /** |
|
408 * Pointer to VCC handler |
|
409 */ |
|
410 CPhoneVccHandler* iVccHandler; |
|
411 |
|
412 /** |
|
413 * Call forward handler. |
|
414 */ |
|
415 CPhoneCallForwardQueryHandler* iCallForwardHandler; |
|
416 |
|
417 }; |
|
418 |
|
419 #endif // C_CPHONECUSTOMIZATIONVOIP_H |
|
420 |
|
421 // End of File |