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