author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:17:03 +0300 | |
branch | RCL_3 |
changeset 31 | 97232defd20e |
parent 30 | bd7edf625bdd |
permissions | -rw-r--r-- |
30 | 1 |
/* |
2 |
* Copyright (c) 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: Calendar settings container |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
//debug |
|
20 |
#include "calendarui_debug.h" |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include "calensettingsuicontainer.h" |
|
24 |
||
25 |
#include "CalenFileListSettingItem.h" |
|
26 |
#include "calenglobaldata.h" |
|
27 |
#include "CalenInterimUtils2.h" |
|
28 |
#include "CalenSliderSettingItem.h" |
|
29 |
#include "CalenUid.h" |
|
30 |
#include "RImplInfoPtrArrayOwn.inl" |
|
31 |
#include "CleanupResetAndDestroy.h" |
|
32 |
#include "calencheckboxsettingitem.h" |
|
33 |
#include "calennestedsettingitem.h" |
|
34 |
#include "calenbooleansettingitem.h" |
|
35 |
#include "calenviewinfo.h" |
|
36 |
||
37 |
#include <Calendar.rsg> |
|
38 |
#include <csxhelp/cale.hlp.hrh> |
|
39 |
#include "calencustomisationmanager.h" |
|
40 |
//#include <CalenUiPluginInterface.h> |
|
41 |
||
42 |
#include <utf.h> |
|
43 |
#include <aknlists.h> // for CAknSettingStyleListBox |
|
44 |
#include <eikclbd.h> // CColumnListBoxData |
|
45 |
#include <StringLoader.h> |
|
46 |
#include <bacntf.h> // CEnvironmentChangeNotifier |
|
47 |
#include <centralrepository.h> // CRepository |
|
48 |
#include <CalendarInternalCRKeys.h> // KCRUidCalendar |
|
49 |
||
50 |
||
51 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
52 |
#include <aiwservicehandler.h> |
|
53 |
||
54 |
// MIME types |
|
55 |
_LIT8(KContentTypeCalendar, "text/calendar"); |
|
56 |
||
57 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
58 |
||
59 |
||
60 |
#include <AknUtils.h> |
|
61 |
||
62 |
||
63 |
||
64 |
const TInt KDisablePluginEnablement = 2; |
|
65 |
||
66 |
void ListMailboxesL( |
|
67 |
CMRMailboxUtils& aMbUtils, |
|
68 |
RArray<CMRMailboxUtils::TMailboxInfo>& aMailBoxes ) |
|
69 |
{ |
|
70 |
aMbUtils.ListMailBoxesL( aMailBoxes ); |
|
71 |
||
72 |
// Get MR Viewer implementations |
|
73 |
RImplInfoPtrArrayOwn implArray; |
|
74 |
CleanupClosePushL( implArray ); |
|
75 |
const TUid mrViewersIface = {KMRViewersInterfaceUID}; |
|
76 |
REComSession::ListImplementationsL( mrViewersIface, implArray ); |
|
77 |
TBuf16<KMaxUidName> mbName; |
|
78 |
||
79 |
TInt index(0); |
|
80 |
while (index < aMailBoxes.Count() ) |
|
81 |
{ |
|
82 |
TBool matchingMRViewerFound( EFalse ); |
|
83 |
TInt mrviewerImplCount( implArray.Count() ); |
|
84 |
for( TInt j=0; j < mrviewerImplCount && !matchingMRViewerFound; ++j ) |
|
85 |
{ |
|
86 |
CnvUtfConverter::ConvertToUnicodeFromUtf8( mbName, implArray[j]->DataType() ); |
|
87 |
if( aMailBoxes[index].iMtmUid.Name().CompareF(mbName) == 0 ) |
|
88 |
{ |
|
89 |
// Found a match. This mailbox would have been shown in the settings list. |
|
90 |
matchingMRViewerFound = ETrue; |
|
91 |
} |
|
92 |
} |
|
93 |
||
94 |
if ( !matchingMRViewerFound ) |
|
95 |
{ |
|
96 |
aMailBoxes.Remove( index ); |
|
97 |
} |
|
98 |
else |
|
99 |
{ |
|
100 |
++index; |
|
101 |
} |
|
102 |
} |
|
103 |
CleanupStack::PopAndDestroy(); // implArray |
|
104 |
} |
|
105 |
||
106 |
// ========================= MEMBER FUNCTIONS ================================ |
|
107 |
||
108 |
||
109 |
// ---------------------------------------------------------------------------- |
|
110 |
// CCalenSettingsUiContainer::NewL |
|
111 |
// Symbian two-phased constructor. |
|
112 |
// Two-phased constructor. Does NOT take ownership of aParentControl or aListBox. |
|
113 |
// (other items were commented in a header). |
|
114 |
// ---------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
EXPORT_C CCalenSettingsUiContainer* CCalenSettingsUiContainer::NewL( |
|
117 |
CCoeControl* aParentControl, |
|
118 |
CAknSettingStyleListBox& aListBox, |
|
119 |
CCalenGlobalData& aGlobalData, |
|
120 |
CCalenCustomisationManager& aCustomisationManager ) |
|
121 |
{ |
|
122 |
TRACE_ENTRY_POINT; |
|
123 |
||
124 |
CCalenSettingsUiContainer* self = new(ELeave) CCalenSettingsUiContainer( aParentControl, |
|
125 |
aListBox, |
|
126 |
aGlobalData, |
|
127 |
aCustomisationManager ); |
|
128 |
CleanupStack::PushL( self ); |
|
129 |
self->ConstructL(); |
|
130 |
CleanupStack::Pop( self ); |
|
131 |
||
132 |
TRACE_EXIT_POINT; |
|
133 |
return self; |
|
134 |
} |
|
135 |
||
136 |
// ---------------------------------------------------------------------------- |
|
137 |
// CCalenSettingsUiContainer::ConstructL |
|
138 |
// Symbian OS default constructor |
|
139 |
// ---------------------------------------------------------------------------- |
|
140 |
// |
|
141 |
void CCalenSettingsUiContainer::ConstructL() |
|
142 |
{ |
|
143 |
TRACE_ENTRY_POINT; |
|
144 |
||
145 |
iSetting = CCalenSetting::InstanceL(); |
|
146 |
||
147 |
// Initialize TLocale watcher |
|
148 |
TCallBack callback( LocaleCallbackL, this ); |
|
149 |
iLocaleChangeNotifier = |
|
150 |
CEnvironmentChangeNotifier::NewL( EActivePriorityLogonA, callback ); |
|
151 |
||
152 |
// Initialize Central Repository watcher |
|
153 |
iRepository = CRepository::NewL( KCRUidCalendar ); |
|
154 |
iCenRepNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iRepository ); |
|
155 |
||
156 |
iSettingItemArray = new( ELeave )CAknSettingItemArray( 2, 0, 0 ); |
|
157 |
||
158 |
if( iGlobalData.InterimUtilsL().MRViewersEnabledL() ) |
|
159 |
{ |
|
160 |
LoadMailboxSettingsL(); |
|
161 |
} |
|
162 |
||
163 |
iLocaleChangeNotifier->Start(); |
|
164 |
iCenRepNotifyHandler->StartListeningL(); |
|
165 |
||
166 |
iPageStatus = EFalse; |
|
167 |
TRACE_EXIT_POINT; |
|
168 |
} |
|
169 |
||
170 |
// ---------------------------------------------------------------------------- |
|
171 |
// CCalenSettingsUiContainer::~CCalenSettingsUiContainer |
|
172 |
// Destructor |
|
173 |
// ---------------------------------------------------------------------------- |
|
174 |
// |
|
175 |
CCalenSettingsUiContainer::~CCalenSettingsUiContainer() |
|
176 |
{ |
|
177 |
TRACE_ENTRY_POINT; |
|
178 |
||
179 |
delete iLocaleChangeNotifier; |
|
180 |
if( iCenRepNotifyHandler ) |
|
181 |
{ |
|
182 |
iCenRepNotifyHandler->StopListening(); |
|
183 |
delete iCenRepNotifyHandler; |
|
184 |
} |
|
185 |
||
186 |
delete iRepository; |
|
187 |
||
188 |
iMailBoxes.Close(); |
|
189 |
if( iSettingItemArray ) |
|
190 |
{ |
|
191 |
iSettingItemArray->ResetAndDestroy(); |
|
192 |
delete iSettingItemArray; |
|
193 |
} |
|
194 |
||
195 |
if ( iSetting ) |
|
196 |
{ |
|
197 |
iSetting->Release(); |
|
198 |
} |
|
199 |
||
200 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
201 |
delete iServiceHandler; |
|
202 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
203 |
||
204 |
TRACE_EXIT_POINT; |
|
205 |
} |
|
206 |
||
207 |
// ---------------------------------------------------------------------------- |
|
208 |
// CCalenSettingsUiContainer::CCalenSettingsUiContainer |
|
209 |
// Default constructor |
|
210 |
// ---------------------------------------------------------------------------- |
|
211 |
// |
|
212 |
CCalenSettingsUiContainer::CCalenSettingsUiContainer( CCoeControl* aParentControl, |
|
213 |
CAknSettingStyleListBox& aListBox, |
|
214 |
CCalenGlobalData& aGlobalData, |
|
215 |
CCalenCustomisationManager& aCustomisationManager ) |
|
216 |
: iGlobalData( aGlobalData ), |
|
217 |
iParentControl( aParentControl ), |
|
218 |
iListBox( aListBox ), |
|
219 |
iCustomisationManager( aCustomisationManager ), |
|
220 |
iIgnoreNextSettingsNotification( EFalse ), |
|
221 |
iIgnoreFirstLocaleChange( ETrue ) |
|
222 |
{ |
|
223 |
TRACE_ENTRY_POINT; |
|
224 |
TRACE_EXIT_POINT; |
|
225 |
} |
|
226 |
||
227 |
// ---------------------------------------------------------------------------- |
|
228 |
// CCalenSettingsUiContainer::AddCustomSettingsWithLinkL |
|
229 |
// Adds all settings from customisations. This will get a link from the front |
|
230 |
// settings page. Removes items from the array when ownership transferred |
|
231 |
// away from the array. |
|
232 |
// ---------------------------------------------------------------------------- |
|
233 |
// |
|
234 |
void CCalenSettingsUiContainer::AddCustomSettingsWithLinkL( RPointerArray<CAknSettingItem>& aSettings, |
|
235 |
const TDesC& aName, |
|
236 |
TInt aOrdinal ) |
|
237 |
{ |
|
238 |
TRACE_ENTRY_POINT; |
|
239 |
||
240 |
// CCalenNestedSettingItem will take items out of aSettings array and |
|
241 |
// take ownership of removed items. |
|
242 |
CCalenNestedSettingItem* item = new( ELeave )CCalenNestedSettingItem( 0, |
|
243 |
aSettings, |
|
244 |
aName ); |
|
245 |
CleanupStack::PushL( item ); |
|
246 |
||
247 |
// The followng text should never actually be displayed on screen |
|
248 |
item->SetEmptyItemTextL( KNullDesC ); |
|
249 |
||
250 |
// Construct setting item with parametrized values |
|
251 |
item->ConstructL( EFalse, aOrdinal, aName, NULL, |
|
252 |
R_CALEN_EMPTY_SETTING_PAGE, EAknSetListBox, |
|
253 |
NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS ); |
|
254 |
||
255 |
iSettingItemArray->InsertL( aOrdinal, item ); |
|
256 |
||
257 |
CleanupStack::Pop( item ); |
|
258 |
||
259 |
TRACE_EXIT_POINT; |
|
260 |
} |
|
261 |
||
262 |
// ---------------------------------------------------------------------------- |
|
263 |
// CCalenSettingsUiContainer::AddSingleCustomSettingL |
|
264 |
// Adds a setting from customisations. This will go directly into the front |
|
265 |
// settings page. Takes ownership of aSetting when the function completes. |
|
266 |
// ---------------------------------------------------------------------------- |
|
267 |
// |
|
268 |
void CCalenSettingsUiContainer::AddSingleCustomSettingL( CAknSettingItem* aSetting, |
|
269 |
TInt aOrdinal ) |
|
270 |
{ |
|
271 |
TRACE_ENTRY_POINT; |
|
272 |
||
273 |
iSettingItemArray->InsertL( aOrdinal, aSetting ); // Takes ownership of aSetting. |
|
274 |
||
275 |
TRACE_EXIT_POINT; |
|
276 |
} |
|
277 |
||
278 |
// ---------------------------------------------------------------------------- |
|
279 |
// CCalenSettingsUiContainer::AddCustomSettingsItemsL |
|
280 |
// Adds all settings from customisations. |
|
281 |
// ---------------------------------------------------------------------------- |
|
282 |
// |
|
283 |
void CCalenSettingsUiContainer::AddCustomSettingsItemsL( TInt& aOrdinal ) |
|
284 |
{ |
|
285 |
TRACE_ENTRY_POINT; |
|
286 |
||
287 |
const RArray<TUid>& plugins = iCustomisationManager.ActivePlugins(); |
|
288 |
||
289 |
RPointerArray<CAknSettingItem> settings; |
|
290 |
CleanupResetAndDestroyPushL( settings ); |
|
291 |
||
292 |
for ( TInt i( 0 ); i<plugins.Count(); ++i ) |
|
293 |
{ |
|
294 |
iCustomisationManager.GetPluginSettingsL( plugins[i], |
|
295 |
settings ); |
|
296 |
// We have ownership of settings items now. |
|
297 |
||
298 |
// If there is more than one setting per plugin, it gets a link in the main |
|
299 |
// setting page. If there is only one, it goes directly into the main page. |
|
300 |
if ( settings.Count() > 1 ) |
|
301 |
{ |
|
302 |
const RImplInfoPtrArray& pluginInfo = iCustomisationManager.PluginInfoArray(); |
|
303 |
TInt pluginIndex = KErrNotFound; |
|
304 |
||
305 |
for ( TInt j( 0 ); j<pluginInfo.Count(); ++j ) |
|
306 |
{ |
|
307 |
if ( pluginInfo[j]->ImplementationUid() == plugins[i] ) |
|
308 |
{ |
|
309 |
pluginIndex = j; |
|
310 |
break; |
|
311 |
} |
|
312 |
} |
|
313 |
||
314 |
ASSERT( pluginIndex != KErrNotFound ); |
|
315 |
const TDesC& pluginName = pluginInfo[pluginIndex]->DisplayName(); |
|
316 |
||
317 |
AddCustomSettingsWithLinkL( settings, pluginName, aOrdinal++ ); |
|
318 |
} |
|
319 |
else if ( settings.Count() == 1 ) |
|
320 |
{ |
|
321 |
// This function takes ownership of the setting item we pass it, |
|
322 |
// when the function completes. |
|
323 |
AddSingleCustomSettingL( settings[0], aOrdinal++ ); |
|
324 |
settings.Remove( 0 ); |
|
325 |
} |
|
326 |
||
327 |
ASSERT( settings.Count() == 0 ); |
|
328 |
} |
|
329 |
||
330 |
CleanupStack::PopAndDestroy( &settings ); |
|
331 |
||
332 |
TRACE_EXIT_POINT; |
|
333 |
} |
|
334 |
||
335 |
// ---------------------------------------------------------------------------- |
|
336 |
// CCalenSettingsUiContainer::AddPluginSettingItemL |
|
337 |
// Adds a settings item allowing the user to enable/disable plugins and |
|
338 |
// change their priority. |
|
339 |
// ---------------------------------------------------------------------------- |
|
340 |
// |
|
341 |
void CCalenSettingsUiContainer::AddPluginSettingItemL( TInt& aOrdinal ) |
|
342 |
{ |
|
343 |
TRACE_ENTRY_POINT; |
|
344 |
||
345 |
const RImplInfoPtrArray& plugins = iCustomisationManager.PluginInfoArray(); |
|
346 |
TInt pluginCount = plugins.Count(); |
|
347 |
||
348 |
if ( pluginCount > 0 ) |
|
349 |
{ |
|
350 |
// Check to see if any of the plugins are able to be be enable or |
|
351 |
// disabled |
|
352 |
TBool pluginFound( EFalse ); |
|
353 |
TBuf<100> displayName; |
|
354 |
for ( TInt index(0); index < pluginCount && !pluginFound; ++index ) |
|
355 |
{ |
|
356 |
// if the display name is empty and the plugin is in ROM the |
|
357 |
// plugin can not be disabled |
|
358 |
TInt version = plugins[index]->Version(); |
|
359 |
TBool romBased = plugins[index]->RomBased(); |
|
360 |
displayName = plugins[index]->DisplayName(); |
|
361 |
||
362 |
if ( ( version != KDisablePluginEnablement ) || !romBased ) |
|
363 |
{ |
|
364 |
pluginFound = ETrue; |
|
365 |
} |
|
366 |
} |
|
367 |
||
368 |
||
369 |
||
370 |
if ( pluginFound ) |
|
371 |
{ |
|
372 |
//There will not be any sort of settings item for plugins which are not part of settings |
|
373 |
TInt countOfAvailability = iSetting->PluginAvailability().Count(); |
|
374 |
||
375 |
if(countOfAvailability) |
|
376 |
{ |
|
377 |
//If available plugins(which has settings) count is > 1 its check box or toggle button. |
|
378 |
if(countOfAvailability > 1 ) |
|
379 |
{ |
|
380 |
CCalenCheckboxSettingItem* settingItem |
|
381 |
= new( ELeave )CCalenCheckboxSettingItem( ECalenPluginListItemId, |
|
382 |
iCustomisationManager ); |
|
383 |
||
384 |
CleanupStack::PushL( settingItem ); |
|
385 |
||
386 |
// The followng text should never actually be displayed on screen |
|
387 |
settingItem->SetEmptyItemTextL( KNullDesC ); |
|
388 |
||
389 |
||
390 |
// Construct setting item with parametrized values |
|
391 |
HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_PLUGINLIST_TITLE ); |
|
392 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
393 |
R_CALEN_SETTING_PLUGINLIST, EAknSetListBox, |
|
394 |
NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS ); |
|
395 |
||
396 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
397 |
||
398 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
399 |
CleanupStack::Pop( settingItem ); |
|
400 |
aOrdinal++; |
|
401 |
} |
|
402 |
else |
|
403 |
{ |
|
404 |
CCalenBooleanSettingItem* settingItem = |
|
405 |
CCalenBooleanSettingItem::NewLC(ECalenPluginListItemId,aOrdinal,iCustomisationManager); |
|
406 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
407 |
CleanupStack::Pop( settingItem ); |
|
408 |
aOrdinal++; |
|
409 |
} |
|
410 |
} |
|
411 |
} |
|
412 |
} |
|
413 |
||
414 |
TRACE_EXIT_POINT; |
|
415 |
} |
|
416 |
||
417 |
// ---------------------------------------------------------------------------- |
|
418 |
// CCalenSettingsUiContainer::AddDefaultViewItemL |
|
419 |
// Adds a setting item to allow selection of the default view. Includes custom |
|
420 |
// views in the view cycle array. |
|
421 |
// (other items were commented in a header). |
|
422 |
// ---------------------------------------------------------------------------- |
|
423 |
// |
|
424 |
void CCalenSettingsUiContainer::AddDefaultViewItemL( TInt& aBuffer, |
|
425 |
TInt aId, |
|
426 |
TInt aTitleResource, |
|
427 |
TInt aSettingPageResource, |
|
428 |
TInt aOrdinal ) |
|
429 |
{ |
|
430 |
TRACE_ENTRY_POINT; |
|
431 |
||
432 |
// Create new setting item |
|
433 |
CAknEnumeratedTextPopupSettingItem* settingItem = |
|
434 |
new( ELeave )CAknEnumeratedTextPopupSettingItem( aId, aBuffer ); |
|
435 |
CleanupStack::PushL( settingItem ); |
|
436 |
||
437 |
// The followng text should never actually be displayed on screen |
|
438 |
_LIT( KNone, "None" ); |
|
439 |
settingItem->SetEmptyItemTextL( KNone ); |
|
440 |
||
441 |
// Construct setting item with parametrized values |
|
442 |
HBufC* itemTitle = StringLoader::LoadLC( aTitleResource ); |
|
443 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
444 |
aSettingPageResource, EAknCtPopupSettingList, |
|
445 |
NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS ); |
|
446 |
||
447 |
CArrayPtr<CAknEnumeratedText>* items = settingItem->EnumeratedTextArray(); |
|
448 |
||
449 |
const RPointerArray<CCalenViewInfo>& views = iCustomisationManager.Views(); |
|
450 |
const RArray<TUid>& activePlugins = iCustomisationManager.ActivePlugins(); |
|
451 |
||
452 |
TBool isDefViewValid( EFalse ); |
|
453 |
||
454 |
TInt numViews = views.Count(); |
|
455 |
for ( TInt i( 0 ); i<numViews; ++i ) |
|
456 |
{ |
|
457 |
CCalenViewInfo* view = views[i]; |
|
458 |
TUid pluginUid = view->PluginUid(); |
|
459 |
TInt position = activePlugins.Find( pluginUid ); |
|
460 |
||
461 |
// If the view is from plugin or native view with cycle position, |
|
462 |
// then add it to the default view list |
|
463 |
if((position != KErrNotFound) || |
|
464 |
( view->CyclePosition() != CCalenView::ENoCyclePosition )) |
|
465 |
{ |
|
466 |
TInt viewUidInt = view->ViewUid().iUid; |
|
467 |
||
468 |
if ( viewUidInt == iDefView ) |
|
469 |
{ |
|
470 |
isDefViewValid = ETrue; |
|
471 |
} |
|
472 |
||
473 |
CAknEnumeratedText* item = new( ELeave )CAknEnumeratedText( viewUidInt, |
|
474 |
view->SettingsName().AllocL() ); |
|
475 |
items->AppendL( item ); |
|
476 |
} |
|
477 |
} |
|
478 |
||
479 |
if ( !isDefViewValid ) |
|
480 |
{ |
|
481 |
// Default view is no longer valid (could be first ever load, or could be |
|
482 |
// a 3rd party plugin's view used to be the default but is not removed). |
|
483 |
// Set default to the first in the view cycle array. |
|
484 |
TInt defViewIndex( 0 ); |
|
485 |
while ( views[defViewIndex]->CyclePosition() == CCalenView::ENoCyclePosition ) |
|
486 |
{ |
|
487 |
defViewIndex++; |
|
488 |
} |
|
489 |
||
490 |
iDefView = views[defViewIndex]->ViewUid().iUid; |
|
491 |
iSetting->SetDefaultView( TUid::Uid( iDefView ) ); |
|
492 |
} |
|
493 |
||
494 |
settingItem->HandleTextArrayUpdateL(); |
|
495 |
||
496 |
// Append item to settingitem-array |
|
497 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
498 |
||
499 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
500 |
CleanupStack::Pop( settingItem ); |
|
501 |
||
502 |
TRACE_EXIT_POINT; |
|
503 |
} |
|
504 |
||
505 |
// ---------------------------------------------------------------------------- |
|
506 |
// CCalenSettingsUiContainer::AddSnoozeTimeItemL |
|
507 |
// Adds an alarm snooze time item |
|
508 |
// (other items were commented in a header). |
|
509 |
// ---------------------------------------------------------------------------- |
|
510 |
// |
|
511 |
void CCalenSettingsUiContainer::AddSnoozeTimeItemL( TInt aOrdinal, |
|
512 |
CArrayPtr<CGulIcon>* aIconArray, |
|
513 |
TInt& aSnoozeTime) |
|
514 |
{ |
|
515 |
TRACE_ENTRY_POINT; |
|
516 |
||
517 |
CCalenSliderSettingItem* settingItem = |
|
518 |
new( ELeave )CCalenSliderSettingItem( ECalenSnoozeTimeItemId, |
|
519 |
aSnoozeTime, |
|
520 |
R_SNOOZE_TIME_SLIDER ); |
|
521 |
CleanupStack::PushL( settingItem ); |
|
522 |
||
523 |
HBufC* itemTitle = StringLoader::LoadLC( R_QTN_CALE_SET_SNOOZE_TIME ); |
|
524 |
||
525 |
settingItem->ConstructL( EFalse, |
|
526 |
aOrdinal, |
|
527 |
*itemTitle, |
|
528 |
aIconArray, |
|
529 |
R_SNOOZE_TIME_SETTING_PAGE, |
|
530 |
EAknCtSlider ); |
|
531 |
||
532 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
533 |
||
534 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
535 |
CleanupStack::Pop( settingItem ); |
|
536 |
||
537 |
TRACE_EXIT_POINT; |
|
538 |
} |
|
539 |
||
540 |
// ---------------------------------------------------------------------------- |
|
541 |
// AddEnumerationItemL() |
|
542 |
// Add integer type of settings item |
|
543 |
// Integer type item can have multiple choices shown as radiobutton list. |
|
544 |
// (other items were commented in a header). |
|
545 |
// ---------------------------------------------------------------------------- |
|
546 |
// |
|
547 |
void CCalenSettingsUiContainer::AddEnumerationItemL( TInt& aBuffer, |
|
548 |
TInt aId, |
|
549 |
TInt aTitleResource, |
|
550 |
TInt aSettingPageResource, |
|
551 |
TInt aAssociatedResource, |
|
552 |
TInt aOrdinal ) |
|
553 |
{ |
|
554 |
TRACE_ENTRY_POINT; |
|
555 |
||
556 |
// Create new setting item |
|
557 |
CAknSettingItem* settingItem = |
|
558 |
new ( ELeave ) CAknEnumeratedTextPopupSettingItem( aId, aBuffer ); |
|
559 |
CleanupStack::PushL( settingItem ); |
|
560 |
||
561 |
// Construct setting item with parametrized values |
|
562 |
HBufC* itemTitle = StringLoader::LoadLC( aTitleResource ); |
|
563 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
564 |
aSettingPageResource, EAknCtPopupSettingList, |
|
565 |
NULL, aAssociatedResource ); |
|
566 |
||
567 |
// Append item to settingitem-array |
|
568 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
569 |
||
570 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
571 |
CleanupStack::Pop( settingItem ); |
|
572 |
||
573 |
TRACE_EXIT_POINT; |
|
574 |
} |
|
575 |
||
576 |
// ----------------------------------------------------------------------------- |
|
577 |
// CCalenSettingsUiContainer::AddBinaryItemL() |
|
578 |
// Add binary type (true/false) settings item |
|
579 |
// (other items were commented in a header). |
|
580 |
// ----------------------------------------------------------------------------- |
|
581 |
// |
|
582 |
void CCalenSettingsUiContainer::AddBinaryItemL( TBool& aBuffer, |
|
583 |
TInt aId, |
|
584 |
TInt aTitleResource, |
|
585 |
TInt aSettingPageResource, |
|
586 |
TInt aAssociatedResource, |
|
587 |
TInt aOrdinal ) |
|
588 |
{ |
|
589 |
TRACE_ENTRY_POINT; |
|
590 |
||
591 |
// Create new setting item |
|
592 |
CAknSettingItem* settingItem = |
|
593 |
new ( ELeave ) CAknBinaryPopupSettingItem( aId, aBuffer ); |
|
594 |
CleanupStack::PushL( settingItem ); |
|
595 |
||
596 |
// Construct setting item with parametrized values |
|
597 |
HBufC* itemTitle = StringLoader::LoadLC( aTitleResource ); |
|
598 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
599 |
aSettingPageResource, EAknCtPopupSettingList, |
|
600 |
NULL, aAssociatedResource ); |
|
601 |
||
602 |
// Append item to settingitem-array |
|
603 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
604 |
||
605 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
606 |
CleanupStack::Pop( settingItem ); |
|
607 |
||
608 |
TRACE_EXIT_POINT; |
|
609 |
} |
|
610 |
||
611 |
// ---------------------------------------------------------------------------- |
|
612 |
// CCalenSettingsUiContainer::AddAlarmToneItemL |
|
613 |
// Adds an item to the settings page which contains information about |
|
614 |
// which tone should be played when an alarm expires. |
|
615 |
// (other items were commented in a header). |
|
616 |
// ---------------------------------------------------------------------------- |
|
617 |
// |
|
618 |
void CCalenSettingsUiContainer::AddAlarmToneItemL( TInt aOrdinal ) |
|
619 |
{ |
|
620 |
TRACE_ENTRY_POINT; |
|
621 |
||
622 |
CCalenFileListSettingItem* settingItem = |
|
623 |
new ( ELeave ) CCalenFileListSettingItem( ECalenAlarmToneItemId ); |
|
624 |
CleanupStack::PushL( settingItem ); |
|
625 |
||
626 |
// Construct setting item with parametrized values |
|
627 |
HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_ALARMTONE_TITLE ); |
|
628 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
629 |
NULL, NULL, NULL, NULL ); |
|
630 |
||
631 |
// Append item to settingitem-array |
|
632 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
633 |
||
634 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
635 |
CleanupStack::Pop( settingItem ); |
|
636 |
||
637 |
TRACE_EXIT_POINT; |
|
638 |
} |
|
639 |
||
640 |
// ---------------------------------------------------------------------------- |
|
641 |
// CCalenSettingsUiContainer::CreateMailboxSettingsItemL |
|
642 |
// Creates the settings item for selection of the default meeting request |
|
643 |
// mailbox. This should only be called when MR viewers are enabled. |
|
644 |
// (other items were commented in a header). |
|
645 |
// ---------------------------------------------------------------------------- |
|
646 |
// |
|
647 |
void CCalenSettingsUiContainer::CreateMailboxSettingsItemL( TInt aOrdinal ) |
|
648 |
{ |
|
649 |
TRACE_ENTRY_POINT; |
|
650 |
||
651 |
// Mailbox settings are shown when we have a MR viewers implementation. |
|
652 |
ASSERT( iGlobalData.InterimUtilsL().MRViewersEnabledL() ); |
|
653 |
CMRMailboxUtils& mailboxUtils = iGlobalData.MRMailboxUtilsL(); |
|
654 |
CAknEnumeratedTextPopupSettingItem* settingItem = |
|
655 |
new ( ELeave ) CAknEnumeratedTextPopupSettingItem( ECalenDefaultMailboxId, |
|
656 |
iDefMailbox ); |
|
657 |
CleanupStack::PushL( settingItem ); |
|
658 |
||
659 |
// Construct setting item with parametrized values |
|
660 |
HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_DEFAULTMAILBOX_TITLE ); |
|
661 |
// The resources loaded up here are empty as the items need to be dynamically updated. |
|
662 |
||
663 |
settingItem->SetEmptyItemTextL( KNullDesC ); |
|
664 |
||
665 |
settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL, |
|
666 |
R_CALEN_SETTING_DEFAULTMAILBOX, EAknCtPopupSettingList, |
|
667 |
NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS ); |
|
668 |
||
669 |
CArrayPtr<CAknEnumeratedText>* items = settingItem->EnumeratedTextArray(); |
|
670 |
||
671 |
RImplInfoPtrArrayOwn implArray; |
|
672 |
CleanupClosePushL( implArray ); |
|
673 |
//Get all MRViewers Implementation |
|
674 |
CMRMailboxUtils::TMailboxInfo defaultMailbox; |
|
675 |
const TUid mrViewersIface = {KMRViewersInterfaceUID}; |
|
676 |
REComSession::ListImplementationsL( mrViewersIface, implArray ); |
|
677 |
||
678 |
TBuf16<KMaxUidName> mbName; |
|
679 |
TInt enumerationCounter = 0; |
|
680 |
||
681 |
for( TInt i=0; i < iMailBoxes.Count(); ++i ) |
|
682 |
{ |
|
683 |
for( TInt j=0; j < implArray.Count(); ++j ) |
|
684 |
{ |
|
685 |
CnvUtfConverter::ConvertToUnicodeFromUtf8( mbName, implArray[j]->DataType() ); |
|
686 |
if( iMailBoxes[i].iMtmUid.Name().CompareF(mbName) == 0 ) |
|
687 |
{ |
|
688 |
// Found a match |
|
689 |
CAknEnumeratedText* item = new(ELeave) CAknEnumeratedText( enumerationCounter, |
|
690 |
iMailBoxes[i].iName.AllocL() ); |
|
691 |
items->AppendL( item ); |
|
692 |
++enumerationCounter; |
|
693 |
} |
|
694 |
} |
|
695 |
} |
|
696 |
||
697 |
CleanupStack::PopAndDestroy(); //implArray |
|
698 |
||
699 |
settingItem->HandleTextArrayUpdateL(); |
|
700 |
||
701 |
// Append item to settingitem-array |
|
702 |
iSettingItemArray->InsertL( aOrdinal, settingItem ); |
|
703 |
||
704 |
CleanupStack::PopAndDestroy( itemTitle ); |
|
705 |
CleanupStack::Pop( settingItem ); |
|
706 |
||
707 |
TRACE_EXIT_POINT; |
|
708 |
} |
|
709 |
||
710 |
// ---------------------------------------------------------------------------- |
|
711 |
// CCalenSettingsUiContainer::UpdateListBoxL |
|
712 |
// Update listbox item |
|
713 |
// ---------------------------------------------------------------------------- |
|
714 |
// |
|
715 |
EXPORT_C void CCalenSettingsUiContainer::UpdateListBoxL() |
|
716 |
{ |
|
717 |
TRACE_ENTRY_POINT; |
|
718 |
||
719 |
iListBox.HandleItemAdditionL(); |
|
720 |
||
721 |
TRACE_EXIT_POINT; |
|
722 |
} |
|
723 |
||
724 |
// ---------------------------------------------------------------------------- |
|
725 |
// CCalenSettingsUiContainer::ConstructListBoxL |
|
726 |
// Update listbox item |
|
727 |
// Items are added manually, instead of loading them from resources |
|
728 |
// ---------------------------------------------------------------------------- |
|
729 |
// |
|
730 |
EXPORT_C void CCalenSettingsUiContainer::ConstructListBoxL() |
|
731 |
{ |
|
732 |
TRACE_ENTRY_POINT; |
|
733 |
||
734 |
iListBox.ConstructL( iParentControl, EAknListBoxSelectionList ); |
|
735 |
||
736 |
LoadCurrentValuesL(); |
|
737 |
||
738 |
// Create items to array |
|
739 |
CreateListBoxItemsL(); |
|
740 |
||
741 |
// Set array to listbox |
|
742 |
CTextListBoxModel* model = iListBox.Model(); |
|
743 |
model->SetItemTextArray( iSettingItemArray ); |
|
744 |
// Ownership retained by us |
|
745 |
model->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
746 |
||
747 |
iSettingItemArray->RecalculateVisibleIndicesL(); |
|
748 |
iListBox.CreateScrollBarFrameL(); |
|
749 |
iListBox.ScrollBarFrame()->SetScrollBarVisibilityL( |
|
750 |
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
751 |
||
752 |
TRACE_EXIT_POINT; |
|
753 |
} |
|
754 |
||
755 |
// ---------------------------------------------------------------------------- |
|
756 |
// CCalenSettingsUiContainer::CreateListBoxItemsL |
|
757 |
// Update listbox item |
|
758 |
// ---------------------------------------------------------------------------- |
|
759 |
// |
|
760 |
void CCalenSettingsUiContainer::CreateListBoxItemsL() |
|
761 |
{ |
|
762 |
TRACE_ENTRY_POINT; |
|
763 |
||
764 |
TInt ordinal = 0; |
|
765 |
||
766 |
AddAlarmToneItemL( ordinal++ ); |
|
767 |
||
768 |
CArrayPtr<CGulIcon>* iconArray = iListBox.ItemDrawer()->ColumnData()->IconArray(); |
|
769 |
||
770 |
if( !iconArray ) |
|
771 |
{ |
|
772 |
iconArray = new( ELeave )CArrayPtrFlat<CGulIcon>( 1 ); |
|
773 |
iListBox.ItemDrawer()->ColumnData()->SetIconArrayL( iconArray ); // ownership transfered |
|
774 |
} |
|
775 |
||
776 |
AddSnoozeTimeItemL( ordinal++, iconArray, iSnoozeTime ); |
|
777 |
||
778 |
AddDefaultViewItemL( iDefView, |
|
779 |
ECalenDefaultViewItemId, |
|
780 |
R_CALEN_SETTING_DEFAULTVIEW_TITLE, |
|
781 |
R_CALEN_SETTING_DEFAULTVIEW, |
|
782 |
ordinal++ ); |
|
783 |
||
784 |
AddEnumerationItemL( iWeekFormat, |
|
785 |
ECalenWeekFormatItemId, |
|
786 |
R_CALEN_SETTING_WEEKFORMAT_TITLE, |
|
787 |
R_CALEN_SETTING_WEEKFORMAT, |
|
788 |
R_CALEN_WEEKFORMAT_TEXTS, |
|
789 |
ordinal++ ); |
|
790 |
||
791 |
AddEnumerationItemL( iWeekNumberEnable, |
|
792 |
ECalenWeekNumberItemId, |
|
793 |
R_CALEN_SETTING_WEEKNUMBER_TITLE, |
|
794 |
R_CALEN_SETTING_WEEKNUMBER, |
|
795 |
R_CALEN_WEEKNUMBER_TEXTS, |
|
796 |
ordinal++ ); |
|
797 |
||
798 |
// Always add this in. We will set it hidden when it's not needed (i.e. when the |
|
799 |
// week start is set to anything other than "Monday") at the bottom of this function. |
|
800 |
AddEnumerationItemL( iWeekTitle, |
|
801 |
ECalenWeekTitleItemId, |
|
802 |
R_CALEN_SETTING_WEEKTITLE_TITLE, |
|
803 |
R_CALEN_SETTING_WEEKTITLE, |
|
804 |
R_CALEN_WEEKTITLE_TEXTS, |
|
805 |
ordinal++ ); |
|
806 |
||
807 |
||
808 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
809 |
// add external calendar support if available. |
|
810 |
TBool isExt=ExtCalendarAvailableL(); |
|
811 |
if (isExt) |
|
812 |
{ |
|
813 |
AddEnumerationItemL( iExtCalendar, |
|
814 |
ECalenExtCalendarItemId, |
|
815 |
R_CALEN_SETTING_EXT_CALENDAR_TITLE, |
|
816 |
R_CALEN_EXT_CALENDAR_SETTING_PAGE, |
|
817 |
R_CALEN_EXT_CALENDAR_SETTING_TEXTS, |
|
818 |
ordinal++ ); |
|
819 |
} |
|
820 |
||
821 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
822 |
||
823 |
// Only add the mailbox choice when the Meeting Request functionality is there. |
|
824 |
if( iGlobalData.InterimUtilsL().MRViewersEnabledL() ) |
|
825 |
{ |
|
826 |
CreateMailboxSettingsItemL( ordinal++ ); // increments ordinal |
|
827 |
} |
|
828 |
||
829 |
#ifdef RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING |
|
830 |
if( AknLayoutUtils::PenEnabled() ) |
|
831 |
{ |
|
832 |
AddBinaryItemL( iToolbar, |
|
833 |
ECalenToolbarItemId, |
|
834 |
R_CALEN_SETTING_TOOLBAR_TITLE, |
|
835 |
R_CALEN_SETTING_TOOLBAR, |
|
836 |
R_CALEN_TOOLBAR_TEXTS, |
|
837 |
ordinal++ ); |
|
838 |
} |
|
839 |
#endif // RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING |
|
840 |
||
841 |
AddPluginSettingItemL( ordinal ); |
|
842 |
||
843 |
AddCustomSettingsItemsL( ordinal ); |
|
844 |
++ordinal; |
|
845 |
||
846 |
// Hide the week title setting if the week start is anything other than Monday. |
|
847 |
Item( ECalenWeekTitleItemId )->SetHidden( !ShouldShowWeekTitleItem() ); |
|
848 |
Item( ECalenWeekNumberItemId )->SetHidden( !ShouldShowWeekTitleItem() ); |
|
849 |
||
850 |
TRACE_EXIT_POINT; |
|
851 |
} |
|
852 |
||
853 |
// ---------------------------------------------------------------------------- |
|
854 |
// CCalenSettingsUiContainer::CurrentFeatureId |
|
855 |
// Get the currently selected feature |
|
856 |
// ---------------------------------------------------------------------------- |
|
857 |
// |
|
858 |
EXPORT_C TInt CCalenSettingsUiContainer::CurrentFeatureId() const |
|
859 |
{ |
|
860 |
TRACE_ENTRY_POINT; |
|
861 |
||
862 |
if ( iSettingItemArray ) |
|
863 |
{ |
|
864 |
TRACE_EXIT_POINT; |
|
865 |
return iSettingItemArray->MdcaCount(); |
|
866 |
} |
|
867 |
else |
|
868 |
{ |
|
869 |
TRACE_EXIT_POINT; |
|
870 |
return 0; |
|
871 |
} |
|
872 |
} |
|
873 |
||
874 |
// ---------------------------------------------------------------------------- |
|
875 |
// CCalenSettingsUiContainer::GetHelpContext |
|
876 |
// Get help for this view |
|
877 |
// ---------------------------------------------------------------------------- |
|
878 |
// |
|
879 |
void CCalenSettingsUiContainer::GetHelpContext( TCoeHelpContext& aContext ) const |
|
880 |
{ |
|
881 |
TRACE_ENTRY_POINT; |
|
882 |
||
883 |
aContext.iMajor = KUidCalendar; |
|
884 |
// This is specified in HRH file. |
|
885 |
aContext.iContext = KCALE_HLP_SETTINGS; |
|
886 |
||
887 |
TRACE_EXIT_POINT; |
|
888 |
} |
|
889 |
||
890 |
// ---------------------------------------------------------------------------- |
|
891 |
// CCalenSettingsUiContainer::ShouldShowWeekTitleItem |
|
892 |
// Returns ETrue if the start of the week is set to Monday. |
|
893 |
// (other items were commented in a header). |
|
894 |
// ---------------------------------------------------------------------------- |
|
895 |
// |
|
896 |
TBool CCalenSettingsUiContainer::ShouldShowWeekTitleItem() const |
|
897 |
{ |
|
898 |
TRACE_ENTRY_POINT; |
|
899 |
TDay day = static_cast<TDay>( iWeekFormat ); |
|
900 |
TRACE_EXIT_POINT; |
|
901 |
return ( day == EMonday ); |
|
902 |
} |
|
903 |
||
904 |
// ---------------------------------------------------------------------------- |
|
905 |
// CCalenSettingsUiContainer::Item |
|
906 |
// Returns the settings item associated with the given setting list item id. |
|
907 |
// (other items were commented in a header). |
|
908 |
// ---------------------------------------------------------------------------- |
|
909 |
// |
|
910 |
CAknSettingItem* CCalenSettingsUiContainer::Item( TSettingListItemId aId ) |
|
911 |
{ |
|
912 |
TRACE_ENTRY_POINT; |
|
913 |
for( TInt i = 0; i < iSettingItemArray->Count(); ++i ) |
|
914 |
{ |
|
915 |
if( iSettingItemArray->At(i)->Identifier() == aId ) |
|
916 |
{ |
|
917 |
TRACE_EXIT_POINT; |
|
918 |
return iSettingItemArray->At( i ); |
|
919 |
} |
|
920 |
} |
|
921 |
ASSERT( EFalse ); |
|
922 |
TRACE_EXIT_POINT; |
|
923 |
return NULL; |
|
924 |
} |
|
925 |
||
926 |
// ---------------------------------------------------------------------------- |
|
927 |
// CCalenSettingsUiContainer::ValidateWeekTitleItemL |
|
928 |
// Hides or shows the week title item based on whether the beginning of the |
|
929 |
// week is set to Monday or not. This should only be called on the week format item. |
|
930 |
// (other items were commented in a header). |
|
931 |
// ---------------------------------------------------------------------------- |
|
932 |
// |
|
933 |
void CCalenSettingsUiContainer::ValidateWeekTitleItemL( CAknSettingItem *aItem ) |
|
934 |
{ |
|
935 |
TRACE_ENTRY_POINT; |
|
936 |
||
937 |
ASSERT( aItem->Identifier() == ECalenWeekFormatItemId ); |
|
938 |
TBool wasShown = ShouldShowWeekTitleItem(); |
|
939 |
aItem->StoreL(); // Updates iWeekFormat variable |
|
940 |
TBool doShow = ShouldShowWeekTitleItem(); |
|
941 |
||
942 |
if ( wasShown != doShow ) |
|
943 |
{ |
|
944 |
Item( ECalenWeekTitleItemId )->SetHidden( !doShow ); |
|
945 |
Item( ECalenWeekNumberItemId )->SetHidden( !doShow ); |
|
946 |
||
947 |
if ( !doShow ) |
|
948 |
{ |
|
949 |
Item( ECalenWeekTitleItemId )->LoadL(); |
|
950 |
Item( ECalenWeekNumberItemId )->LoadL(); |
|
951 |
} |
|
952 |
||
953 |
iSettingItemArray->RecalculateVisibleIndicesL(); |
|
954 |
iListBox.HandleItemAdditionL(); |
|
955 |
iListBox.UpdateScrollBarsL(); |
|
956 |
} |
|
957 |
TRACE_EXIT_POINT; |
|
958 |
} |
|
959 |
||
960 |
// ---------------------------------------------------------------------------- |
|
961 |
// CCalenSettingsUiContainer::ShowOrHideWeekTitleL |
|
962 |
// Shows or hides the week title setting as appropriate. |
|
963 |
// (other items were commented in a header). |
|
964 |
// ---------------------------------------------------------------------------- |
|
965 |
// |
|
966 |
void CCalenSettingsUiContainer::ShowOrHideWeekTitleL() |
|
967 |
{ |
|
968 |
TRACE_ENTRY_POINT; |
|
969 |
||
970 |
CAknSettingItem* wkTitle = Item( ECalenWeekTitleItemId ); |
|
971 |
const TInt currentIndex( iListBox.CurrentItemIndex() ); |
|
972 |
||
973 |
const TBool wasLookingAtWeekTitle( currentIndex == wkTitle->VisibleIndex() ); |
|
974 |
const TBool doShow( ShouldShowWeekTitleItem() ); |
|
975 |
||
976 |
wkTitle->SetHidden( !doShow ); |
|
977 |
||
978 |
// Make sure we're still looking at a setting item after one was removed. |
|
979 |
if ( !doShow && wasLookingAtWeekTitle ) |
|
980 |
{ |
|
981 |
iListBox.SetCurrentItemIndex( Item( ECalenWeekFormatItemId )->VisibleIndex() ); |
|
982 |
} |
|
983 |
||
984 |
iSettingItemArray->RecalculateVisibleIndicesL(); |
|
985 |
iListBox.HandleItemAdditionL(); |
|
986 |
iListBox.UpdateScrollBarsL(); |
|
987 |
||
988 |
TRACE_EXIT_POINT; |
|
989 |
} |
|
990 |
||
991 |
// ---------------------------------------------------------------------------- |
|
992 |
// CCalenSettingsUiContainer::HandleListBoxSelectionL |
|
993 |
// Handles list box selection events. |
|
994 |
// (other items were commented in a header). |
|
995 |
// ---------------------------------------------------------------------------- |
|
996 |
// |
|
997 |
EXPORT_C void CCalenSettingsUiContainer::HandleListBoxSelectionL( TInt aCommand ,TBool& aPageStatus) |
|
998 |
{ |
|
999 |
TRACE_ENTRY_POINT; |
|
1000 |
||
1001 |
TInt index( iListBox.CurrentItemIndex() ); |
|
1002 |
||
1003 |
if ( index >= 0 ) // index is -1 if there are no items in the list |
|
1004 |
{ |
|
1005 |
CAknSettingItem* item; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1006 |
//Listbox will return the visible index |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1007 |
//So get the actual item index from visible index to get the correct item |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1008 |
TInt itemIndex = iSettingItemArray->ItemIndexFromVisibleIndex(index); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1009 |
item = iSettingItemArray->At( itemIndex ); |
30 | 1010 |
|
1011 |
// Open edit dialog if EAknCmdOpen, invert the value otherwise |
|
1012 |
aPageStatus = ETrue; |
|
1013 |
iPageStatus = aPageStatus; |
|
1014 |
// for week title only two options available |
|
1015 |
// so let's toggle instead of opening setting page |
|
1016 |
if( (item->Identifier() != ECalenWeekTitleItemId) && (item->Identifier() != ECalenWeekNumberItemId)) |
|
1017 |
{ |
|
1018 |
item->EditItemL( aCommand == EAknCmdOpen ); |
|
1019 |
} |
|
1020 |
aPageStatus = EFalse; |
|
1021 |
iPageStatus = aPageStatus; |
|
1022 |
TBool isNativeSettingChange = ETrue; |
|
1023 |
||
1024 |
if(item->Identifier() > 0 ) |
|
1025 |
{ |
|
1026 |
// Save the settings change, so if we have two settings windows open |
|
1027 |
// the background one can be updated. |
|
1028 |
switch( item->Identifier() ) |
|
1029 |
{ |
|
1030 |
case ECalenWeekFormatItemId: |
|
1031 |
// item->StoreL() gets called in ValidateWeekTitleItemL |
|
1032 |
ValidateWeekTitleItemL( item ); |
|
1033 |
iSetting->SetWeekFormat( static_cast<TDay>( iWeekFormat ) ); |
|
1034 |
break; |
|
1035 |
case ECalenAlarmToneItemId: |
|
1036 |
item->StoreL(); |
|
1037 |
// CCalenFileListSettingItem::StoreL saves the filename to cenrep. |
|
1038 |
break; |
|
1039 |
case ECalenSnoozeTimeItemId: |
|
1040 |
item->StoreL(); |
|
1041 |
iSetting->SetSnoozeTime( iSnoozeTime ); |
|
1042 |
break; |
|
1043 |
case ECalenDefaultViewItemId: |
|
1044 |
item->StoreL(); |
|
1045 |
iSetting->SetDefaultView( TUid::Uid( iDefView ) ); |
|
1046 |
break; |
|
1047 |
case ECalenWeekTitleItemId: |
|
1048 |
//item->StoreL(); |
|
1049 |
// toggling option done here |
|
1050 |
iSetting->SetWeekTitle( static_cast<TCalenWeekTitle>( iWeekTitle ) == EWeekTitleNumber ? |
|
1051 |
EWeekTitleDuration : EWeekTitleNumber ); |
|
1052 |
iWeekTitle = iSetting->WeekTitle(); |
|
1053 |
item->LoadL(); |
|
1054 |
item->UpdateListBoxTextL(); |
|
1055 |
break; |
|
1056 |
case ECalenWeekNumberItemId: |
|
1057 |
// toggling option done here |
|
1058 |
iSetting->SetWeekNumber( static_cast<TCalenWeekNumber>( iWeekNumberEnable ) == EWeekNumberOn ? |
|
1059 |
EWeekNumberOff : EWeekNumberOn ); |
|
1060 |
iWeekNumberEnable = iSetting->WeekNumberEnable(); |
|
1061 |
item->LoadL(); |
|
1062 |
item->UpdateListBoxTextL(); |
|
1063 |
break; |
|
1064 |
case ECalenDefaultMailboxId: |
|
1065 |
item->StoreL(); |
|
1066 |
StoreMailboxSettingsL(); |
|
1067 |
break; |
|
1068 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
1069 |
case ECalenExtCalendarItemId: |
|
1070 |
item->StoreL(); |
|
1071 |
iSetting->SetExtCalendar( iExtCalendar); |
|
1072 |
break; |
|
1073 |
#endif // RD_CALEN_EXTERNAL_CAL |
|
1074 |
#ifdef RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING |
|
1075 |
case ECalenToolbarItemId: |
|
1076 |
item->StoreL(); |
|
1077 |
iSetting->SetToolbar( iToolbar ); |
|
1078 |
break; |
|
1079 |
#endif // RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING |
|
1080 |
case ECalenPluginListItemId: |
|
1081 |
// No item to store, CCalenCheckboxSettingItem updated |
|
1082 |
// the customisation manager and CCalenSetting. Need to |
|
1083 |
// redraw the listboc |
|
1084 |
item->StoreL(); |
|
1085 |
PluginListChangedL(); |
|
1086 |
||
1087 |
break; |
|
1088 |
default: // Custom setting. |
|
1089 |
item->StoreL(); |
|
1090 |
// Custom settings won't generate a repository change, so keep listening. |
|
1091 |
isNativeSettingChange = EFalse; |
|
1092 |
break; |
|
1093 |
} |
|
1094 |
||
1095 |
if ( isNativeSettingChange ) |
|
1096 |
||
1097 |
{ |
|
1098 |
// Don't listen for changes to cenrep/TLocale for this settings change. |
|
1099 |
iIgnoreNextSettingsNotification = ETrue; |
|
1100 |
iSetting->SaveL(); |
|
1101 |
} |
|
1102 |
||
1103 |
||
1104 |
iListBox.DrawItem( index ); |
|
1105 |
} |
|
1106 |
} |
|
1107 |
TRACE_EXIT_POINT; |
|
1108 |
} |
|
1109 |
||
1110 |
// ---------------------------------------------------------------------------- |
|
1111 |
// CCalenSettingsUiContainer::PluginListChangedL() |
|
1112 |
// Cenrep watcher callback |
|
1113 |
// ---------------------------------------------------------------------------- |
|
1114 |
// |
|
1115 |
void CCalenSettingsUiContainer::PluginListChangedL() |
|
1116 |
{ |
|
1117 |
iSettingItemArray->ResetAndDestroy(); |
|
1118 |
||
1119 |
// Update the default view as it would have changed after enabling/disabling plugins |
|
1120 |
iDefView = iSetting->DefaultView().iUid; |
|
1121 |
iWeekFormat = iSetting->WeekFormat(); |
|
1122 |
iWeekTitle = iSetting->WeekTitle(); |
|
1123 |
iSnoozeTime = iSetting->SnoozeTime(); |
|
1124 |
CreateListBoxItemsL(); |
|
1125 |
||
1126 |
iSettingItemArray->RecalculateVisibleIndicesL(); |
|
1127 |
iListBox.HandleItemAdditionL(); |
|
1128 |
iListBox.UpdateScrollBarsL(); |
|
1129 |
} |
|
1130 |
||
1131 |
// ---------------------------------------------------------------------------- |
|
1132 |
// CCalenSettingsUiContainer::HandleNotifyGeneric |
|
1133 |
// Cenrep watcher callback |
|
1134 |
// ---------------------------------------------------------------------------- |
|
1135 |
// |
|
1136 |
void CCalenSettingsUiContainer::HandleNotifyGeneric( TUint32 aId ) |
|
1137 |
{ |
|
1138 |
TRACE_ENTRY_POINT; |
|
1139 |
||
1140 |
// Make sure it wasn't this object that generated the settings change. |
|
1141 |
if ( iIgnoreNextSettingsNotification ) |
|
1142 |
{ |
|
1143 |
iIgnoreNextSettingsNotification = EFalse; |
|
1144 |
} |
|
1145 |
else |
|
1146 |
{ |
|
1147 |
PIM_TRAPD_HANDLE( HandleExternalSettingsChangedL(aId)); |
|
1148 |
} |
|
1149 |
||
1150 |
// Use another trap to make sure we start listening again, regardless |
|
1151 |
// of whether the previous function left or not. |
|
1152 |
PIM_TRAPD_HANDLE( iCenRepNotifyHandler->StartListeningL() ); |
|
1153 |
||
1154 |
TRACE_EXIT_POINT |
|
1155 |
} |
|
1156 |
||
1157 |
// ---------------------------------------------------------------------------- |
|
1158 |
// CCalenSettingsUiContainer::HandleNotifyError |
|
1159 |
// Cenrep watcher error callback |
|
1160 |
// ---------------------------------------------------------------------------- |
|
1161 |
// |
|
1162 |
void CCalenSettingsUiContainer::HandleNotifyError( TUint32 /*aId*/, |
|
1163 |
TInt /*aError*/, |
|
1164 |
CCenRepNotifyHandler* /*aHandler*/ ) |
|
1165 |
{ |
|
1166 |
TRACE_ENTRY_POINT; |
|
1167 |
||
1168 |
PIM_TRAPD_HANDLE( iCenRepNotifyHandler->StartListeningL() ); |
|
1169 |
||
1170 |
TRACE_EXIT_POINT; |
|
1171 |
} |
|
1172 |
||
1173 |
// ---------------------------------------------------------------------------- |
|
1174 |
// CCalenSettingsUiContainer::LocaleCallbackL |
|
1175 |
// Locale watcher callback |
|
1176 |
// ---------------------------------------------------------------------------- |
|
1177 |
// |
|
1178 |
TInt CCalenSettingsUiContainer::LocaleCallbackL( TAny* aThisPtr ) |
|
1179 |
{ |
|
1180 |
TRACE_ENTRY_POINT; |
|
1181 |
||
1182 |
CCalenSettingsUiContainer* ptr = static_cast<CCalenSettingsUiContainer*>( aThisPtr ); |
|
1183 |
ptr->DoLocaleCallbackL(); |
|
1184 |
||
1185 |
TRACE_EXIT_POINT; |
|
1186 |
return FALSE; |
|
1187 |
} |
|
1188 |
||
1189 |
// ---------------------------------------------------------------------------- |
|
1190 |
// CCalenSettingsUiContainer::DoLocaleCallbackL |
|
1191 |
// Implementation of locale watcher callback |
|
1192 |
// ---------------------------------------------------------------------------- |
|
1193 |
// |
|
1194 |
void CCalenSettingsUiContainer::DoLocaleCallbackL() |
|
1195 |
{ |
|
1196 |
TRACE_ENTRY_POINT; |
|
1197 |
||
1198 |
if ( iLocaleChangeNotifier->Change() & EChangesLocale ) |
|
1199 |
{ |
|
1200 |
if( iIgnoreFirstLocaleChange ) |
|
1201 |
{ |
|
1202 |
// When initialising the locale change observer, we get a notification |
|
1203 |
// when observing starts. We ignore this as we don't need to act on it. |
|
1204 |
iIgnoreFirstLocaleChange = EFalse; |
|
1205 |
} |
|
1206 |
else |
|
1207 |
{ |
|
1208 |
// Make sure it wasn't this object that generated the settings change. |
|
1209 |
if ( iIgnoreNextSettingsNotification ) |
|
1210 |
{ |
|
1211 |
iIgnoreNextSettingsNotification = EFalse; |
|
1212 |
} |
|
1213 |
else |
|
1214 |
{ |
|
1215 |
HandleExternalSettingsChangedL(); |
|
1216 |
ShowOrHideWeekTitleL(); |
|
1217 |
// ValidateWeekTitleItemL( Item( ECalenWeekFormatItemId ) ); |
|
1218 |
} |
|
1219 |
} |
|
1220 |
} |
|
1221 |
||
1222 |
TRACE_EXIT_POINT; |
|
1223 |
} |
|
1224 |
||
1225 |
// ---------------------------------------------------------------------------- |
|
1226 |
// CCalenSettingsUiContainer::HandleExternalSettingsChangedL |
|
1227 |
// Called when something else changed our settings |
|
1228 |
// ---------------------------------------------------------------------------- |
|
1229 |
// |
|
1230 |
void CCalenSettingsUiContainer::HandleExternalSettingsChangedL(TUint32 aId) |
|
1231 |
{ |
|
1232 |
TRACE_ENTRY_POINT; |
|
1233 |
// Load from cenrep to member data. |
|
1234 |
LoadCurrentValuesL(); |
|
1235 |
||
1236 |
switch(aId) |
|
1237 |
{ |
|
1238 |
case KCalendarPluginAvailability: |
|
1239 |
{ |
|
1240 |
HandlePluginChange(); |
|
1241 |
if(!iPageStatus) |
|
1242 |
{ |
|
1243 |
PluginListChangedL(); |
|
1244 |
} |
|
1245 |
} |
|
1246 |
break; |
|
1247 |
||
1248 |
default: |
|
1249 |
{ |
|
1250 |
// If the starting day of a week is Monday, "Title of week view" setting item |
|
1251 |
// is also displayed. so the number of default items will be 5. |
|
1252 |
TInt maxDefaultSettingItems = ShouldShowWeekTitleItem()?5:4; |
|
1253 |
||
1254 |
for( TInt i=0; i<maxDefaultSettingItems; ++i ) |
|
1255 |
{ |
|
1256 |
iSettingItemArray->At( i )->LoadL(); |
|
1257 |
iSettingItemArray->At( i )->UpdateListBoxTextL(); |
|
1258 |
} |
|
1259 |
} |
|
1260 |
} |
|
1261 |
iListBox.HandleItemAdditionL(); |
|
1262 |
||
1263 |
TRACE_EXIT_POINT; |
|
1264 |
} |
|
1265 |
||
1266 |
// ---------------------------------------------------------------------------- |
|
1267 |
// CCalenSettingsUiContainer::LoadCurrentValuesL |
|
1268 |
// Loads current values from cenrep. |
|
1269 |
// ---------------------------------------------------------------------------- |
|
1270 |
// |
|
1271 |
void CCalenSettingsUiContainer::LoadCurrentValuesL() |
|
1272 |
{ |
|
1273 |
TRACE_ENTRY_POINT; |
|
1274 |
iSetting->LoadL(); |
|
1275 |
||
1276 |
iDefView = iSetting->DefaultView().iUid; |
|
1277 |
iWeekFormat = iSetting->WeekFormat(); |
|
1278 |
iWeekTitle = iSetting->WeekTitle(); |
|
1279 |
iWeekNumberEnable = iSetting->WeekNumberEnable(); |
|
1280 |
iSnoozeTime = iSetting->SnoozeTime(); |
|
1281 |
#ifdef RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING |
|
1282 |
iToolbar = iSetting->Toolbar(); |
|
1283 |
#endif |
|
1284 |
||
1285 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
1286 |
iExtCalendar = iSetting->ExtCalendar(); |
|
1287 |
#endif |
|
1288 |
||
1289 |
TRACE_EXIT_POINT; |
|
1290 |
} |
|
1291 |
||
1292 |
// ---------------------------------------------------------------------------- |
|
1293 |
// CCalenSettingsUiContainer::StoreMailboxSettingsL |
|
1294 |
// Stores the mailbox settings. |
|
1295 |
// ---------------------------------------------------------------------------- |
|
1296 |
// |
|
1297 |
void CCalenSettingsUiContainer::StoreMailboxSettingsL() |
|
1298 |
{ |
|
1299 |
TRACE_ENTRY_POINT; |
|
1300 |
||
1301 |
if( iGlobalData.InterimUtilsL().MRViewersEnabledL() ) |
|
1302 |
{ |
|
1303 |
// iHasSelectedMailbox will be EFalse if we didn't select a MR MB previously. |
|
1304 |
// However, they might have selected one this time. |
|
1305 |
if( !iHasSelectedMailbox && iDefMailbox != 0 ) |
|
1306 |
{ |
|
1307 |
iHasSelectedMailbox = ETrue; |
|
1308 |
--iDefMailbox; // This gets decremented as the first menu item was a blank, unselected choice. |
|
1309 |
} |
|
1310 |
||
1311 |
if( iHasSelectedMailbox ) |
|
1312 |
{ |
|
1313 |
CMRMailboxUtils& mbUtils = iGlobalData.MRMailboxUtilsL(); |
|
1314 |
||
1315 |
ListMailboxesL( mbUtils, iMailBoxes ); |
|
1316 |
||
1317 |
RImplInfoPtrArrayOwn implArray; |
|
1318 |
CleanupClosePushL( implArray ); |
|
1319 |
const TUid mrViewersIface = {KMRViewersInterfaceUID}; |
|
1320 |
REComSession::ListImplementationsL( mrViewersIface, implArray ); |
|
1321 |
TBuf16<KMaxUidName> mbName; |
|
1322 |
||
1323 |
TInt enumValue = 0; // How many mailboxes we have been through so far that are visible to the user. |
|
1324 |
// Convert from the enumeration to the default mailbox id. |
|
1325 |
for( TInt i=0; i < iMailBoxes.Count(); ++i ) |
|
1326 |
{ |
|
1327 |
for( TInt j=0; j<implArray.Count(); ++j ) |
|
1328 |
{ |
|
1329 |
CnvUtfConverter::ConvertToUnicodeFromUtf8( mbName, implArray[j]->DataType() ); |
|
1330 |
if( iMailBoxes[i].iMtmUid.Name().CompareF(mbName) == 0 ) |
|
1331 |
{ |
|
1332 |
// Found a match. This mailbox would have been shown in the settings list. |
|
1333 |
if( enumValue == iDefMailbox ) |
|
1334 |
{ |
|
1335 |
User::LeaveIfError( mbUtils.SetDefaultMRMailBoxL( iMailBoxes[iDefMailbox].iEntryId ) ); |
|
1336 |
break; |
|
1337 |
} |
|
1338 |
++enumValue; |
|
1339 |
} |
|
1340 |
} |
|
1341 |
} |
|
1342 |
CleanupStack::PopAndDestroy(); // implArray |
|
1343 |
} |
|
1344 |
} |
|
1345 |
||
1346 |
TRACE_EXIT_POINT; |
|
1347 |
} |
|
1348 |
||
1349 |
// ---------------------------------------------------------------------------- |
|
1350 |
// CCalenSettingsUiContainer::LoadMailboxSettingsL |
|
1351 |
// Loads the MR mailbox settings, if MR functionality is enabled. |
|
1352 |
// ---------------------------------------------------------------------------- |
|
1353 |
// |
|
1354 |
void CCalenSettingsUiContainer::LoadMailboxSettingsL() |
|
1355 |
{ |
|
1356 |
TRACE_ENTRY_POINT; |
|
1357 |
||
1358 |
if( iGlobalData.InterimUtilsL().MRViewersEnabledL() ) |
|
1359 |
{ |
|
1360 |
iHasSelectedMailbox = EFalse; |
|
1361 |
CMRMailboxUtils::TMailboxInfo defaultMailbox; |
|
1362 |
CMRMailboxUtils& mbUtils = iGlobalData.MRMailboxUtilsL(); |
|
1363 |
||
1364 |
ListMailboxesL( mbUtils, iMailBoxes ); |
|
1365 |
||
1366 |
TInt res = KErrNone; |
|
1367 |
TRAPD( err, res = mbUtils.GetDefaultMRMailBoxL( defaultMailbox ) ); |
|
1368 |
if( res == KErrNone && err == KErrNone ) |
|
1369 |
{ |
|
1370 |
// Convert from the default mailbox to an enumeration. |
|
1371 |
for( TInt i=0; i<iMailBoxes.Count(); ++i ) |
|
1372 |
{ |
|
1373 |
if( iMailBoxes[i].iEntryId == defaultMailbox.iEntryId ) |
|
1374 |
{ |
|
1375 |
iDefMailbox = i; |
|
1376 |
iHasSelectedMailbox = ETrue; |
|
1377 |
break; |
|
1378 |
} |
|
1379 |
} |
|
1380 |
} |
|
1381 |
else if ( err != KErrNotFound || err != KErrGeneral ) |
|
1382 |
{ |
|
1383 |
// KErrNotFound and KErrGeneral are thrown when no mailbox is selected. |
|
1384 |
// This is OK as iHasSelectedMailbox is EFalse, so we will show the blank option |
|
1385 |
// and allow the user to choose. Any other error needs to leave. |
|
1386 |
User::LeaveIfError( err ); |
|
1387 |
} |
|
1388 |
} |
|
1389 |
||
1390 |
TRACE_EXIT_POINT; |
|
1391 |
} |
|
1392 |
||
1393 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
1394 |
// ---------------------------------------------------------------------------- |
|
1395 |
// CCalenSettingViewDlg::ExtCalendarAvailableL() |
|
1396 |
// Return ETrue if we have service handler |
|
1397 |
// (other items were commented in a header). |
|
1398 |
// ---------------------------------------------------------------------------- |
|
1399 |
// |
|
1400 |
TBool CCalenSettingsUiContainer::ExtCalendarAvailableL() |
|
1401 |
{ |
|
1402 |
TRACE_ENTRY_POINT; |
|
1403 |
||
1404 |
// Create service handler instance. |
|
1405 |
if ( !iServiceHandler ) |
|
1406 |
{ |
|
1407 |
iServiceHandler = CAiwServiceHandler::NewL(); |
|
1408 |
} |
|
1409 |
||
1410 |
// create criteria item, this is used to specify which provider we are interested in. |
|
1411 |
CAiwCriteriaItem* crit = CAiwCriteriaItem::NewLC( ECalenExtAiwCommandId, |
|
1412 |
KAiwCmdView, |
|
1413 |
KContentTypeCalendar ); |
|
1414 |
||
1415 |
// we have a base service just for finding out if there is our provider available |
|
1416 |
// this should be fixed by AIW framework in the future so that we don't need extra service. |
|
1417 |
crit->SetServiceClass( TUid::Uid( KAiwClassBase ) ); |
|
1418 |
crit->SetMaxProviders( 1 ); |
|
1419 |
//crit->SetId(0x10282e42); |
|
1420 |
RCriteriaArray array; |
|
1421 |
array.Append( crit ); |
|
1422 |
// attach to the service provider if available, owenership of array is not transferred. |
|
1423 |
iServiceHandler->AttachL( array ); |
|
1424 |
||
1425 |
// if there is a provider here is count of suitable ones, if not it is zero |
|
1426 |
TInt num=iServiceHandler->NbrOfProviders( crit ); |
|
1427 |
||
1428 |
// if we detach, dll is unloaded, we don't want that as it is likely that we need it again. |
|
1429 |
// iServiceHandler->DetachL( array ); |
|
1430 |
array.ResetAndDestroy(); |
|
1431 |
CleanupStack::Pop( crit ); |
|
1432 |
||
1433 |
TBool res = EFalse; |
|
1434 |
||
1435 |
if ( num > 0 ) |
|
1436 |
{ |
|
1437 |
res = ETrue; |
|
1438 |
} |
|
1439 |
||
1440 |
TRACE_EXIT_POINT; |
|
1441 |
return res; |
|
1442 |
} |
|
1443 |
||
1444 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
1445 |
||
1446 |
// ---------------------------------------------------------------------------- |
|
1447 |
// CCalenSettingsUiContainer::PluginUidFinder |
|
1448 |
// Matches a uid and a plugin uid. Used by when finding a uid to match the |
|
1449 |
// setting's array against the customisation manager's array. |
|
1450 |
// (other items were commented in a header). |
|
1451 |
// ---------------------------------------------------------------------------- |
|
1452 |
// |
|
1453 |
TBool CCalenSettingsUiContainer::PluginUidFinder( const TUid* aUid, |
|
1454 |
const CImplementationInformation& aArrayItem ) |
|
1455 |
{ |
|
1456 |
TRACE_ENTRY_POINT; |
|
1457 |
TRACE_EXIT_POINT; |
|
1458 |
return ( *aUid == aArrayItem.ImplementationUid() ); |
|
1459 |
} |
|
1460 |
||
1461 |
void CCalenSettingsUiContainer::HandlePluginChange() |
|
1462 |
{ |
|
1463 |
TRACE_ENTRY_POINT; |
|
1464 |
||
1465 |
pluginAvail& pluginAvailablity = iSetting->PluginAvailability(); |
|
1466 |
for(TInt index = 0;index < pluginAvailablity.Count(); index++) |
|
1467 |
{ |
|
1468 |
TRAP_IGNORE(iCustomisationManager.SetPluginAvailabilityL(pluginAvailablity[index].iUid, |
|
1469 |
pluginAvailablity[index].iEnabled)); |
|
1470 |
} |
|
1471 |
TRACE_EXIT_POINT; |
|
1472 |
} |
|
1473 |
||
1474 |
// End of file |
|
1475 |