|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Call sub-menu in General Settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GSCALLPLUGIN_H |
|
20 #define GSCALLPLUGIN_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "GSCallPluginModel.h" |
|
24 #include "MGsFWMSKLabelObserver.h" |
|
25 |
|
26 #include <MSSSettingsObserver.h> //for MSSSettingsObserver |
|
27 #include <MMGFetchVerifier.h> |
|
28 #include <mgsasyncimagehandlingobserver.h> |
|
29 #include <centralrepository.h> |
|
30 #include <cenrepnotifyhandler.h> |
|
31 #include <ConeResLoader.h> |
|
32 |
|
33 #include <gsbaseview.h> |
|
34 #include <gsfwviewuids.h> |
|
35 #include <gsplugininterface.h> |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CGSCallPluginContainer; |
|
39 class CAknRadioButtonSettingPage; |
|
40 class CPsetContainer; |
|
41 class CPsuiContainer; |
|
42 class CPsuiWaitingObs; |
|
43 class CPsetCallWaiting; |
|
44 class CAknPopupList; |
|
45 class CGSTelPluginModel; |
|
46 class CGSCcbsHandler; |
|
47 class CAknWaitDialog; |
|
48 class CAknViewAppUi; |
|
49 |
|
50 // Constants |
|
51 const TUid KCallPluginUID = { 0x102824A2 }; |
|
52 |
|
53 // Resource file name |
|
54 _LIT( KGSCallPluginResourceFileName, "z:GSCallPluginRsc.rsc" ); |
|
55 |
|
56 _LIT( KGSCallPluginIconDirAndName, "z:GSCallPlugin.mbm"); |
|
57 |
|
58 // CLASS DECLARATION |
|
59 /** |
|
60 * CGSCallPlugin view class |
|
61 */ |
|
62 class CGSCallPlugin : public CGSBaseView, |
|
63 public MSSSettingsObserver, |
|
64 public MMGFetchVerifier, |
|
65 public MGSAsyncImageHandlingObserver, |
|
66 public MGsFWMSKObserver |
|
67 { |
|
68 public: // Constructor and destructor |
|
69 |
|
70 /* C++ Constructor */ |
|
71 CGSCallPlugin(); |
|
72 |
|
73 /** |
|
74 * Symbian OS two-phased constructor |
|
75 * @return |
|
76 */ |
|
77 static CGSCallPlugin* NewL( TAny* aInitParams ); |
|
78 |
|
79 /* Symbian OS two-phase Constructor |
|
80 * |
|
81 * @return pointer to CGSCallPlugin object |
|
82 */ |
|
83 static CGSCallPlugin* NewLC(); |
|
84 |
|
85 /** |
|
86 * Destructor. |
|
87 */ |
|
88 ~CGSCallPlugin(); |
|
89 |
|
90 public: // Functions from CAknView |
|
91 |
|
92 /** |
|
93 * From CAknView, returns the views id. |
|
94 * |
|
95 * @return Returns id of the view. |
|
96 */ |
|
97 TUid Id() const; |
|
98 |
|
99 /** |
|
100 * See base class. |
|
101 */ |
|
102 void HandleClientRectChange(); |
|
103 |
|
104 /** |
|
105 * See base class. |
|
106 */ |
|
107 void HandleStatusPaneSizeChange(); |
|
108 |
|
109 /** |
|
110 * From MEikCommandObserver, handles the menu based commands. |
|
111 * |
|
112 * @param aCommand identifies the given command. |
|
113 */ |
|
114 void HandleCommandL( TInt aCommand ); |
|
115 |
|
116 /** |
|
117 * See base class. |
|
118 */ |
|
119 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
120 TUid aCustomMessageId, |
|
121 const TDesC8& aCustomMessage ); |
|
122 |
|
123 /** |
|
124 * See base class. |
|
125 */ |
|
126 void DoDeactivate(); |
|
127 |
|
128 public: // From base classes |
|
129 /* |
|
130 * From MSSSettingsObserver, observer function |
|
131 * @param aSetting Current setting |
|
132 * @param aNewValue New value for the setting |
|
133 */ |
|
134 void PhoneSettingChanged( TSSSettingsSetting aSetting, |
|
135 TInt aNewValue ); |
|
136 |
|
137 /** |
|
138 * Updates specific value to container |
|
139 * @param aListItem item index to update |
|
140 * @param aNewValue new value for the setting |
|
141 */ |
|
142 void UpdateListBoxL( const TInt& aListItem, TInt aNewValue ); |
|
143 |
|
144 /** |
|
145 * From MEikCommandObserver, handles the commands. |
|
146 * |
|
147 * @param aCommand identifies the command given. |
|
148 */ |
|
149 void ProcessCommandL( TInt aCommand ); |
|
150 |
|
151 /** |
|
152 * Checks if the MSK label needs to be adjusted. |
|
153 */ |
|
154 void CheckMiddleSoftkeyLabelL(); |
|
155 |
|
156 public: // From CGSPluginInterface |
|
157 |
|
158 /** |
|
159 * See base class. |
|
160 */ |
|
161 void GetCaptionL( TDes& aCaption ) const; |
|
162 |
|
163 /** |
|
164 * See base class. |
|
165 */ |
|
166 TInt PluginProviderCategory() const; |
|
167 |
|
168 /** |
|
169 * See base class. |
|
170 */ |
|
171 CGulIcon* CreateIconL( const TUid aIconType ); |
|
172 |
|
173 public: //new |
|
174 /** |
|
175 * Remove command and label from MSK. |
|
176 */ |
|
177 void RemoveCommandFromMSK( const TBool flag); |
|
178 |
|
179 /** |
|
180 * Adds given resource text as MSK to CBA. |
|
181 * |
|
182 * @param aResourceId middle softkey label. |
|
183 * @param aCommandId command that should be performed when MSK |
|
184 * is pressed. |
|
185 * @since S60 v3.1 |
|
186 */ |
|
187 void SetMiddleSoftKeyLabelL( const TInt aResourceId,const TInt aCommandId ); |
|
188 |
|
189 protected: // from CGSBaseView |
|
190 /** |
|
191 * See base class. |
|
192 */ |
|
193 void NewContainerL(); |
|
194 |
|
195 /** |
|
196 * See base class. |
|
197 */ |
|
198 void HandleListBoxSelectionL(); |
|
199 |
|
200 protected: //from MMGFetchVerifier |
|
201 |
|
202 /** |
|
203 * Display Backlight setting page |
|
204 */ |
|
205 TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); |
|
206 |
|
207 protected: //from MGSSyncImageHandlingObserver |
|
208 |
|
209 /** |
|
210 * Method derived from MGSSyncImageHandlingObserver |
|
211 * Run when the asynchronous image converting is complete. |
|
212 */ |
|
213 void ImageHandlingCompleteL( TInt aError ); |
|
214 |
|
215 protected: // From MEikMenuObserver |
|
216 |
|
217 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
218 |
|
219 protected: //new |
|
220 |
|
221 /** |
|
222 * Symbian OS default constructor. |
|
223 */ |
|
224 void ConstructL(); |
|
225 |
|
226 /** |
|
227 * Shows settingpage for on-off settings. |
|
228 * |
|
229 * @param aPage reveals what page should be displayed. |
|
230 */ |
|
231 void ShowSettingPageL( TGSCallItemIds aPage ); |
|
232 |
|
233 /** |
|
234 * Responsible for showing als related settingpage. |
|
235 * Separate method is needed because als settings differ quite |
|
236 * a bit from the other on/off settings. |
|
237 * |
|
238 * @param aPage reveals what page should be displayed. |
|
239 */ |
|
240 void ShowAlsSettingPageL( TGSCallItemIds aPage ); |
|
241 |
|
242 /** |
|
243 * Processes user's selection |
|
244 * @param aSetting tells which value to switch |
|
245 * Used when Central Repository is enabled |
|
246 */ |
|
247 void SwitchOnOffSetting( TCallSettId aSetting ); |
|
248 |
|
249 /** |
|
250 * Adds item to a list |
|
251 * @param aList reference to a list |
|
252 * @param aItem resource ID of the item to be added |
|
253 */ |
|
254 void AppendItemL( CDesCArrayFlat& aList, TInt aItem ); |
|
255 |
|
256 |
|
257 /** |
|
258 * Selects what kind of menu to create next |
|
259 * |
|
260 * @param aIndex currently selected item |
|
261 */ |
|
262 virtual void HandleCreatePopupL( TInt aIndex ); |
|
263 |
|
264 /** |
|
265 * Sets title to a setting page. |
|
266 * |
|
267 * @param aDlg reference to a setting page |
|
268 * @param aTitleID resource ID of title |
|
269 */ |
|
270 void SetTitleToSettingL( CAknRadioButtonSettingPage& aDlg, |
|
271 TInt aTitleID ); |
|
272 |
|
273 /** |
|
274 * Sets title to status pane. |
|
275 * |
|
276 * @param aTitleID resource ID of title |
|
277 */ |
|
278 /*void SetTitleL( TInt aTitleID );*/ |
|
279 |
|
280 /** |
|
281 * Switches value between shared data (0 = off, 1 = on) |
|
282 * and setting page (1 = off, 0 = on). |
|
283 * @param aValue value to switch |
|
284 * @return switched value |
|
285 */ |
|
286 TInt SwitchValue( TInt& aValue ); |
|
287 |
|
288 /** |
|
289 * Shows notes when Als Block value has been changed. |
|
290 */ |
|
291 void ShowAlsBlockNoteL(); |
|
292 |
|
293 /** |
|
294 * Converts value between setting page and SsSettings. |
|
295 * @param aValue value to convert |
|
296 */ |
|
297 void AlsBlockConvertValue( TInt& aValue ); |
|
298 |
|
299 /** |
|
300 * Converts value between setting page and SsSettings. |
|
301 * @param aValue value to convert |
|
302 */ |
|
303 void CliConvertValue( TInt& aValue ); |
|
304 |
|
305 /** |
|
306 * Calls Security to make a Pin2 query. |
|
307 * |
|
308 * @return KPSPinQueryOk if query OK, otherwise 0. |
|
309 */ |
|
310 TInt MakePin2QueryL(); |
|
311 |
|
312 /** |
|
313 * Calls Security to make a Security code query. |
|
314 * |
|
315 * @return ETrue if query OK. |
|
316 */ |
|
317 TBool MakeSecCodeQueryL(); |
|
318 |
|
319 /** |
|
320 * Changes value in shared data for Als or Als Blocking. |
|
321 */ |
|
322 void SwitchAlsSettingL(); |
|
323 |
|
324 |
|
325 /** |
|
326 * Shows Soft reject setting page. |
|
327 */ |
|
328 void ShowSoftRejectSettingPageL(); |
|
329 |
|
330 |
|
331 |
|
332 /** |
|
333 * Display the Setting page for Replace Prefix item |
|
334 * @param aCurrentValue currently selected value in the setting page. |
|
335 * @return ETrue if the setting page selection has changed. |
|
336 */ |
|
337 TBool ShowPrefixSettingPageL( TInt& aCurrentValue ); |
|
338 |
|
339 /** |
|
340 * Toggles the Replace prefix between ON & OFF |
|
341 * @param aSettingPage Tells whether to display the setting page |
|
342 */ |
|
343 void ChangePrefixSettingL( TBool aSettingPage ); |
|
344 |
|
345 /** |
|
346 * Set the new changes to VOIP variables. |
|
347 * @param aPage one of the TGSCallItemIds value w.r.t VOIP |
|
348 * @param aCurrentSetting currently selected setting page item |
|
349 */ |
|
350 void SetVoipSettingBasedSelectedLine( |
|
351 const TGSCallItemIds aPage, |
|
352 TInt aCurrentSetting ); |
|
353 |
|
354 /** |
|
355 * Gets line for selected VoIP setting. |
|
356 * @param aPage one of the TGSCallItemIds value w.r.t VOIP |
|
357 * @return line for selected VoIP setting. |
|
358 */ |
|
359 TInt GetLineForSelectedVoipSetting( const TGSCallItemIds aPage ); |
|
360 |
|
361 /** |
|
362 * Display background image list from media gallery. |
|
363 */ |
|
364 void ShowVTStillImageSettingPageL(); |
|
365 |
|
366 /** |
|
367 * |
|
368 */ |
|
369 void ShowStillImageListL(); |
|
370 |
|
371 /** |
|
372 * Display image load wait note dialog. |
|
373 */ |
|
374 void ShowImageLoadWaitNoteL(); |
|
375 |
|
376 /** |
|
377 * Hide image load wait note dialog. |
|
378 */ |
|
379 void HideImageLoadWaitNoteL(); |
|
380 |
|
381 /** |
|
382 * Prompt image related errors to the user. |
|
383 * @param aError system wide Symbian errors |
|
384 */ |
|
385 void HandleImageErrorsL( TInt aError ); |
|
386 |
|
387 /** |
|
388 * Check if the input file is DRM protected |
|
389 * @param aOriginalFileName Path of the bitmap file |
|
390 * @return ETrue if file is DRM protected. |
|
391 * EFalse otherwise. |
|
392 */ |
|
393 TBool CheckDRMProtectionL( const TDesC& aOriginalFileName ); |
|
394 |
|
395 TBool ShowCallDurationSettingPageL( TInt& aCurrentValue ); |
|
396 |
|
397 void ChangeCallDurationSettingL( TBool aSettingPage ); |
|
398 |
|
399 /** |
|
400 * Shows note if preferred call setting |
|
401 * was changed to the Internet Telephone. |
|
402 */ |
|
403 void ShowPreferredTelephonyNoteL(); |
|
404 |
|
405 /* |
|
406 * Toggles between the setting values based on aShowSettingPage |
|
407 * @param aShowSettingPage is ETrue then setting page is shown |
|
408 */ |
|
409 void ChangeLongPressCallKeySettingL( const TBool aShowSettingPage ); |
|
410 |
|
411 /* |
|
412 * Launches setting page with the LongPressCallKey setting items |
|
413 * @Param gets the updated value set |
|
414 */ |
|
415 TBool ShowLongPressCallKeySettingPageL( TInt& aCurrentValue ); |
|
416 |
|
417 /** |
|
418 * Launches settings page for Own Image during video call setting |
|
419 */ |
|
420 void ShowOwnImageVtCallSettingPageL(); |
|
421 |
|
422 private: |
|
423 //Retrieves container pointer. |
|
424 CGSCallPluginContainer* Container(); |
|
425 |
|
426 /* |
|
427 * Checks call state. |
|
428 * @return one of the call states from P&S key |
|
429 */ |
|
430 TInt CheckCallStateL(); |
|
431 |
|
432 protected: // Member Variables |
|
433 //CGSCallPluginModel class variable |
|
434 CGSCallPluginModel* iModel; |
|
435 //General access class for phonesettings. |
|
436 CPsetContainer* iSettings; |
|
437 //Call waiting SS handler |
|
438 CPsetCallWaiting* iWaiting; |
|
439 //General access class for PSUI. |
|
440 CPsuiContainer* iObsContainer; |
|
441 //Call waiting note handler |
|
442 CPsuiWaitingObs* iCwObserver; |
|
443 //Fetches ss related phone settings. |
|
444 RSSSettings* iSsSettings; |
|
445 //Value of als. |
|
446 TInt iAls; |
|
447 //Value of ALS Blocking. |
|
448 TInt iAlsBlock; |
|
449 //Value of Clir |
|
450 TInt iClir; |
|
451 //Has the rocker been pressed. |
|
452 TBool iRockerPress; |
|
453 //Creates and handles calls to CCBS Manager. |
|
454 CGSCcbsHandler* iCcbsHandler; |
|
455 |
|
456 private: |
|
457 // for image handling |
|
458 CGSAsyncImageHandling* iImageHandler; |
|
459 // for load wait dialog |
|
460 CAknWaitDialog* iWaitDialog; |
|
461 // local variation for restricted CLIR |
|
462 TBool iRestrictedClir; |
|
463 // local variation for secure CLIR |
|
464 TBool iSecureClir; |
|
465 // video Telephony Still Image state |
|
466 TInt iVtStillImage; |
|
467 // Previous video Telephony Still Image state |
|
468 TInt iPreviousVtStillImage; |
|
469 // check if which command MSK is set during destruction |
|
470 TBool iMskCommandFlag; |
|
471 //Lock for VT still image listbox item |
|
472 TBool iVTImageSelectionOngoing; |
|
473 |
|
474 }; |
|
475 |
|
476 |
|
477 #endif //GSCALLPLUGIN_H |
|
478 |
|
479 // End of File |