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