gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:20:44 +0100
branchRCL_3
changeset 54 7e0eff37aedb
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7e0eff37aedb 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".
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  Main view handling for Call Divert.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
// INCLUDE FILES
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include "GSCallDivertContainer.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include "GSCallDivertModel.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include "GSCallDivertQuery.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include "GSCallDivertView.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include "GsLogger.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include "GSPhoneSettingConstants.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include "GSRestrictedDivertContainer.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include "LocalViewId.h"
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <AiwContactSelectionDataTypes.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <AiwGenericParam.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <aknnotewrappers.h>        //for AknErrorNote
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <AknUtils.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <aknViewAppUi.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <CPbk2SortOrderManager.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include <CPbk2StoreConfiguration.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include <CPbkContactItem.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include <CPbkSingleItemFetchDlg.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include <CVPbkContactLinkArray.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include <CVPbkContactManager.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include <featmgr.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include <gscommon.hrh>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include <gsfwviewuids.h>          // for restricted call forward
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include <gscalldivertpluginrsc.rsg>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include <MPbk2ContactNameFormatter.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include <MVPbkContactFieldData.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include <MVPbkContactFieldTextData.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
#include <MVPbkContactLink.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include <MVPbkContactOperationBase.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#include <MVPbkContactStoreList.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include <MVPbkStoreContact.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include <NumberGrouping.h>         // for Number Grouping
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include <Pbk2ContactNameFormatterFactory.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include <PsetCallDiverting.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include <PsuiConstants.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
#include <RPbkViewResourceFile.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
#include <AiwServiceHandler.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
#include <coeaui.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
#include <CVPbkContactStoreUriArray.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
#include <CVPbkFieldTypeSelector.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
#include <hlplch.h>                 // for Help Launcher
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
#include <hlplch.h>             // For HlpLauncher
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
#include <RVPbkContactFieldDefaultPriorities.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
#include <StringLoader.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
#include <VPbkContactViewFilterBuilder.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
#include <voicemailboxdomaincrkeys.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
#include <centralrepository.h>
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
using namespace AiwContactAssign;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
// LOCAL CONSTANTS
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
_LIT( KGSDivertClassName, "CGSCallDivertView" );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
_LIT( KCallDivertInvalidchars, " ()" );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
// ========================= MEMBER FUNCTIONS ================================
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
// CGSCallDivertView::CGSCallDivertView
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
// C++ constructor.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
CGSCallDivertView::CGSCallDivertView( CGSCallDivertModel* aModel )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
    : iModel( aModel )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
// CGSCallDivertView::ConstructL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
// Symbian OS two-phased constructor.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
void CGSCallDivertView::ConstructL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
            iModel->SetDivertServiceGroup( EGSSettIdVoiceDivert );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    iModel->SetDivertView( this );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    iStoresOpened = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    iNumberFetchedAsynchronously = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    BaseConstructL( R_CF_DIV_VIEW );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
    iTitles = iCoeEnv->ReadDesCArrayResourceL( R_TITLE_ARRAY );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
    iRockerPress = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
    //Check video mailbox suppport from cenrep
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    //Since it is static feature, needs to be checked only once
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
    CRepository* videoMailboxRepository = 
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
                        CRepository::NewLC( KCRUidVideoMailbox );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    videoMailboxRepository->Get( KVideoMbxSupport, iVideoMailboxSupported );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    CleanupStack::PopAndDestroy( videoMailboxRepository );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
    // AIW for pbk2 contact selection functionality. Construct contact manager
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    // with the same store configuration as in Phonebook currently.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
    iServiceHandler = CAiwServiceHandler::NewL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    iServiceHandler->AttachL( R_CALL_DIVERT_CONTACT_SELECTION_INTEREST );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
    CPbk2StoreConfiguration* configuration = CPbk2StoreConfiguration::NewL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
    CleanupStack::PushL( configuration );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
    CVPbkContactStoreUriArray* uriArray = configuration->CurrentConfigurationL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    CleanupStack::PushL( uriArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    iContactManager = CVPbkContactManager::NewL( *uriArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    iContactManager->ContactStoresL().OpenAllL( *this );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
    CleanupStack::PopAndDestroy( uriArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
    CleanupStack::PopAndDestroy( configuration );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
// CGSCallDivertView::~CGSCallDivertView
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
// Destructor.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
CGSCallDivertView::~CGSCallDivertView()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
    if ( iTitles )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
        delete iTitles;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
    if( iRetrieveOperation )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
        delete iRetrieveOperation;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
        iRetrieveOperation = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
    if( iContactLinks )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
        delete iContactLinks;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
        iContactLinks = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
    
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
    TRAP_IGNORE
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
        (
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
        if( iContactManager )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
            iContactManager->ContactStoresL().CloseAll( *this );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
            iStoresOpened = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
            delete iContactManager;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
        );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    delete iServiceHandler;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    if( iContextMenuItems )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    	{
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
    	delete iContextMenuItems;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
    	iContextMenuItems = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
    	}
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
// CGSCallDivertView::NewLC
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
// 1st phase constructor.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
CGSCallDivertView* CGSCallDivertView::NewLC( CGSCallDivertModel* aModel )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
    CGSCallDivertView* self;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
    self = new ( ELeave ) CGSCallDivertView( aModel );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
    CleanupStack::PushL( self );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    self->ConstructL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
    return self;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
// CGSCallDivertView::NewContainerL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
// Creates new iContainer.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
void CGSCallDivertView::NewContainerL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
        iContainer = new (ELeave) CGSRestrictedDivertContainer();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
        iContainer = new (ELeave) CGSCallDivertContainer(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
                     iModel->DivertServiceGroup() );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
// CGSCallDivertView::Id
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
// implementation of the frameworks virtual function, closely related with view
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
// architecture and has little or no relevance here
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
TUid CGSCallDivertView::Id() const
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
        return KCallDivertPluginId;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
        return KCallDivertViewId;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
// CGSCallDivertView::HandleCommandL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
// Handles the received commands
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
void CGSCallDivertView::HandleCommandL( TInt aCommand )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
    iVoiceMailboxDivert = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
    TBool sendRequest = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
    RMobilePhone::TMobilePhoneServiceAction info =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        RMobilePhone::EServiceActionRegister;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
    TCallDivertSetting divertRequest;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
    if ( aCommand != ECFCmdCancelAll && iContainer )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
        if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
            CGSRestrictedDivertContainer& container =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
                *static_cast<CGSRestrictedDivertContainer*>( iContainer );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
            iCurrentItem = container.CurrentFeatureId();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
            CGSCallDivertContainer& container =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
                *static_cast<CGSCallDivertContainer*>( iContainer );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
            iCurrentItem = container.CurrentFeatureId();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
        __GSLOGSTRING1("[CGSCallDivertView::HandleCommandL] iCurrentItem: %d", iCurrentItem);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
        __ASSERT_ALWAYS( iCurrentItem != KErrNotFound, Panic( KGSDivertClassName,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
                                                              EInvalidCurrentItem ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    switch ( aCommand )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        case EGSCmdAppChange:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
            iRockerPress = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
            if ( iContainer )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
            	{
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
            	HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
            	}            
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
        case EAknSoftkeyBack:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
                iAppUi->ActivateLocalViewL( KGSTelPluginUid );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
            else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
                iAppUi->ActivateLocalViewL( KCallDivertPluginId );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
        case EAknSoftkeyExit:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
            AppUi()->HandleCommandL( EEikCmdExit );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
        case ECFCmdActivate:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
            divertRequest.iSetting = EActivateDiverting;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
            info = RMobilePhone::EServiceActionRegister;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
            // Activate depends on the selected call type (voice/data/fax)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
            switch( iModel->DivertServiceGroup() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
                case EGSSettIdVoiceDivert:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
                    // Handle voice divert. Fetch used numbers and show it in query.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
                    ExecuteDivertQueryL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
                        divertRequest.iNumber,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
                        iTitles->MdcaPoint( iCurrentItem ),
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
                        iVoiceMailboxDivert );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
                    sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
                case EGSSettIdVideoDivert:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
                    if( iVideoMailboxSupported )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
                        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
                        // Fetch used data divert number and show it in query.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
                        ExecuteDivertQueryL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
                                divertRequest.iNumber,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
                                iTitles->MdcaPoint( iCurrentItem ),
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
                                iVoiceMailboxDivert );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
                        sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
                        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
                    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
                        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
                        DisplayDataCallDivertNumberQueryL( divertRequest.iNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
                        sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
                        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
                default:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
                    User::Panic( KGSDivertClassName, KErrArgument );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
        case ECFCmdCancel:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
                sendRequest = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
                iModel->CancelRestrictedCallDivertL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
            else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
                sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
                divertRequest.iSetting = ECancelDiverting;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
                info = RMobilePhone::EServiceActionErase;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
        case ECFCmdCheckStatus:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
            if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
                sendRequest = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
                iModel->CheckStatusRestrictedCallDivertL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
            else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
                sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
                divertRequest.iSetting = ECheckStatus;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
                info = RMobilePhone::EServiceActionUnspecified;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
        case ECFCmdCancelAll:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
            sendRequest = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
            divertRequest.iSetting = EEraseDiverting;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
            info = RMobilePhone::EServiceActionErase;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
        case EAknCmdHelp:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
                HlpLauncher::LaunchHelpApplicationL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
        default:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
            iAppUi->HandleCommandL( aCommand );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
            break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
    // If a request needs to be sent.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
    if ( sendRequest )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
        // will not divert in case empty number
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
        iModel->SendCallDivertRequestL( divertRequest,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
                                        info,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
                                        iVoiceMailboxDivert,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
                                        aCommand,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
                                        (TGSCallDivertServices) iCurrentItem );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
// CGSCallDivertView::HandleListBoxSelectionL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
// Handles List box selection
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
void CGSCallDivertView::HandleListBoxSelectionL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
    iRockerPress = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
    CEikMenuBar* menuBar = MenuBar();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
    if ( iRockerPress )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
        menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_OPTIONS_VIEW );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
        menuBar->SetMenuType( CEikMenuBar::EMenuContext );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
        menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_DIV_VIEW );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
        menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
    // Display menu bar.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
    menuBar->TryDisplayMenuBarL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
    // Reset menu type to original default (EMenuOptions).
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
    menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
    iRockerPress = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
// CGSCallDivertView::ExecuteDivertQueryL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
// --> voice calls -> all voice calls -> activate -> this popup.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
//                          OR
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
// --> video calls -> all video calls -> activate -> this popup.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
// ---Example---
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
// All [voice/]video calls:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
// To [voice/]video mailbox
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
// [050512345678]
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
// [543454545435]
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
// [342343242343]
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
// To other number
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
void CGSCallDivertView::ExecuteDivertQueryL( TTelNumber& aTelNumber,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
                                             const TPtrC& aTitle,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
                                             TBool& aVmbxValidNumber )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
    __GSLOGSTRING("[CGSCallDivertView::ExecuteDivertQueryL]");
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
    CAknSinglePopupMenuStyleListBox* list =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
        new ( ELeave ) CAknSinglePopupMenuStyleListBox;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    CleanupStack::PushL( list );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
    CDesC16ArrayFlat* defNumbers =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
        new ( ELeave ) CDesC16ArrayFlat( KCFDefaultNumbers );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
    CleanupStack::PushL( defNumbers );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
    CAknPopupList* divertPopup =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
        CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
    CleanupStack::PushL( divertPopup );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
    list->ConstructL( divertPopup,CEikListBox::ELeftDownInViewRect );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
    list->CreateScrollBarFrameL( ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
    list->ScrollBarFrame()->SetScrollBarVisibilityL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
        CEikScrollBarFrame::EOff,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
        CEikScrollBarFrame::EAuto );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
    divertPopup->SetTitleL( aTitle );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
    if( iContextMenuItems )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
    	{
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
    	delete iContextMenuItems;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
    	iContextMenuItems = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
    	}
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
    iContextMenuItems = new ( ELeave ) CDesCArrayFlat( KCFMaxNrOfTargets );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
    if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
        CreateVoiceDivertItemsL( *iContextMenuItems, *defNumbers );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
        CreateVideoDivertItemsL( *iContextMenuItems );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
    __GSLOGSTRING2( "[CGSCallDivertView::ExecuteDivertQueryL] ItemCount: %d, defNumCount: %d",
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
                    iContextMenuItems->Count(),
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
                    defNumbers->Count() );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
    CTextListBoxModel* model = list->Model();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
    model->SetItemTextArray( iContextMenuItems );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
    model->SetOwnershipType( ELbmDoesNotOwnItemArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
    // Executeld handles the events in the list
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
    TBool modified = divertPopup->ExecuteLD();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
    __GSLOGSTRING1("[CGSCallDivertView::ExecuteDivertQueryL] modified: %d", modified);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
    CleanupStack::Pop(); //voiceDivertPopup
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
    if ( modified )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
        if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
            aTelNumber = HandleVoiceDivertSelectionL( *list,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
                                                      *defNumbers,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
                                                      aVmbxValidNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
            aTelNumber = HandleVideoDivertSelectionL( *list );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
    __GSLOGSTRING1( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] aTelNumber: %S",
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
                    &aTelNumber);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
    CleanupStack::PopAndDestroy( 2 ); //defNumbers, list
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
    __GSLOGSTRING( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] End." );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
// CGSCallDivertView::HandleVoiceDivertSelectionL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
// Handles user's choice in the Target list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
TTelNumber CGSCallDivertView::HandleVoiceDivertSelectionL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
    CAknSinglePopupMenuStyleListBox& aList,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
    CDesC16ArrayFlat& aDefNumbers,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
    TBool& aVmbxDivert )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
    __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] Start...");
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
    TTelNumber telNumber;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
    telNumber.Zero();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
    TInt index = aList.CurrentItemIndex();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
    __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] index: %d", index);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
    if ( index == KCFDivertToMailBox )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
        if ( iModel->VoiceMailActivationL( telNumber ) == KErrNone )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
            if ( telNumber == KNullDesC )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
                ShowErrorNoteL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
            aVmbxDivert = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
    //To other number - make a dataquery
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
    else if ( index == ( aList.Model()->NumberOfItems() - 1 ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
        ExecuteDivertNumberQueryL( telNumber, R_TEXT_PRMPT_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
        __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] telNumber: %S", &telNumber);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
        UpdateDefaultVoiceDivertNumbersL( telNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
    //To pre-defined default number
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
        telNumber = aDefNumbers.MdcaPoint( index - 1 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
        iModel->DivertHandler()->SwapDefaultNumberL( index );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
    __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] End.");
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
    return telNumber;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
// CGSCallDivertView::HandleVideoDivertSelectionL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
// Handles user's choice in the video Target list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
TTelNumber CGSCallDivertView::HandleVideoDivertSelectionL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
    CAknSinglePopupMenuStyleListBox& aList )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Start");
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
    TTelNumber telNumber( 0 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
    TInt index = aList.CurrentItemIndex();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
    if ( index == KCFDivertToMailBox )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
        if ( iModel->VideoMailActivationL( telNumber ) == KErrNone )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
            if ( telNumber == KNullDesC )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
                ShowErrorNoteL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
    else if( index == ( aList.Model()->NumberOfItems() - 1 ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
        { // To other number - make a dataquery (Last item in list)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
        DisplayDataCallDivertNumberQueryL( telNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
        __GSLOGSTRING1("[GSCallDivertView::HandleVideoDivertSelectionL] telNumber: %S", &telNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
    __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Finished");
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
    return telNumber;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
// CGSCallDivertView::DisplayDataCallDivertNumberQueryL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
// Displays data call number query and sets call divert
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
void CGSCallDivertView::DisplayDataCallDivertNumberQueryL( TTelNumber& aTelNumber )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
    aTelNumber = *iModel->DivertHandler()->GetUsedDataNumberLC();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
    ExecuteDivertNumberQueryL( aTelNumber, R_TEXT_PRMPT_DATA_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
    if( aTelNumber != KNullDesC )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
        iModel->DivertHandler()->SetUsedDataNumberL( aTelNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
    CleanupStack::PopAndDestroy(); // aTelNumber from GetUsedDataNumberLC()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
// CGSCallDivertView::ExecuteDivertNumberQueryL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
// Executes general number query dialog used by all diverts (voice/data/fax)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
void CGSCallDivertView::ExecuteDivertNumberQueryL( TDes& aValue, TInt aType )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
    TBool accepted = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
    while ( !accepted )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
        RemoveInvalidChars( aValue ); 
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
        if ( aValue.Length() > KGSMaxDataLength )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
            //Chop the first extra digits and keep the last KGSMaxDataLength
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
            //digits intact. This is according to the spec.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
            aValue.Delete( 0, aValue.Length() - KGSMaxDataLength );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
        __GSLOGSTRING1("[CGSCallDivertView]    ExecuteDivertNumberQueryL: aValue: %S", &aValue);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
        if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeEditorDefault ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aValue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
        CGSCallDivertQuery* query = CGSCallDivertQuery::NewL( aValue,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
            CAknQueryDialog::ENoTone,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
            R_AVKON_SOFTKEYS_OK_CANCEL__OK, R_CF_SOFTKEYS_SEARCH_CANCEL );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
        CleanupStack::PushL( query );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
        SetPromptToQueryL( *query, aType );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
        TInt queryAction = query->ExecuteLD( R_DATA_QUERY );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
        CleanupStack::Pop( query );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
        AknTextUtils::ConvertDigitsTo( aValue, EDigitTypeWestern );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
        switch ( queryAction )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
            case EAknSoftkeySearch:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
                if( iStoresOpened )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
                    // Reset the number selection because 'search' is selected.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
                    aValue.Zero();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
                    StartAsyncPhoneNumberFetchL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
                    accepted = ETrue;// Change to asynchronous mode
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
                break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
            case EAknSoftkeyOk:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
                accepted = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
                if ( ValidatePhoneNumberL( aValue ) > KCFValidPhoneNumber ||
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
                     aValue.Length() == 0 )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
                    accepted = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
                if ( iNumberFetchedAsynchronously )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
                	{
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
                	switch( iModel->DivertServiceGroup() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
                	    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
                	    case EGSSettIdVoiceDivert:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
                        	UpdateDefaultVoiceDivertNumbersL( aValue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
                        	break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
                	    case EGSSettIdVideoDivert:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
                            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
                	        TTelNumber dataNumber( aValue );// Convert to TTelNumber
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
                	        iModel->DivertHandler()->SetUsedDataNumberL( dataNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
                	        break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
                            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
                	    default:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
                	        break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
                	    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
                	iNumberFetchedAsynchronously = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
                	}
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
                break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
            case EAknSoftkeyBack:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
            case EAknSoftkeyCancel:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
            default:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
                accepted = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
                aValue.Zero();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
                break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
// CGSCallDivertView::StartAsyncPhoneNumberFetchL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
// Fetches values from phonebook ASYNCHRONOUSLY (pbk2 requirement).
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
void CGSCallDivertView::StartAsyncPhoneNumberFetchL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
    TUint fetchFlags = 0;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
    // Construct empty filter
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
    CVPbkFieldTypeSelector* contactViewFilter =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
                            CVPbkFieldTypeSelector::NewL(iContactManager->FieldTypes());
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
    CleanupStack::PushL(contactViewFilter);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
    // Append the filter object with suitable criteria (only contacts with
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
    // phone number shown)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
    VPbkContactViewFilterBuilder::BuildContactViewFilterL(*contactViewFilter,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
                              EVPbkContactViewFilterPhoneNumber, *iContactManager);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
    RVPbkContactFieldDefaultPriorities array;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
    CleanupClosePushL(array);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
    TAiwSingleItemSelectionDataV3 data = TAiwSingleItemSelectionDataV3();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
    // Details selection shows only phone numbers
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
    data.SetAddressSelectType(EAiwPhoneNumberSelect);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
    data.SetDefaultPriorities(array);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
    // Contact list shows only contacts that have phone number(s)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
    data.SetFetchFilter(contactViewFilter);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
    data.SetFlags(fetchFlags);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
    CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
    TAiwGenericParam param(EGenericParamContactSelectionData,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
                     TAiwVariant(TAiwSingleItemSelectionDataV3Pckg(data)));
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
    inParamList.AppendL(param);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
    iServiceHandler->ExecuteServiceCmdL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
            KAiwCmdSelect,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
            inParamList,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
            iServiceHandler->OutParamListL(),
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
            0,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
            this);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
    CleanupStack::PopAndDestroy(); // array
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
    CleanupStack::PopAndDestroy( contactViewFilter );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
// CGSCallDivertView::ValidatePhoneNumberL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
// Puts a single resource string into a list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
TInt CGSCallDivertView::ValidatePhoneNumberL( const TDesC& aDivertTo )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
    TInt enteredNumber = KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
    TInt noOfInvalidChars = KCFInvalidChars().Length();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
    // Plus is a special case, as it is accepted as first character.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
    // FindPlus returns KCFErrIllegalNumber(1) if the number is not
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
    // acceptable.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
    enteredNumber += FindPlus( aDivertTo );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
    for ( TInt index = 0; index < noOfInvalidChars; index++ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
        enteredNumber += aDivertTo.Find(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
            KCFInvalidChars().Mid( index, 1 ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
    // Find returns KErrNotFound(-1), if character(s) is not found.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
    // Therefore, after four searches for special characters in the
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
    // number, all results that have greater than -5 as result are not
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
    // acceptable.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
    if ( enteredNumber > KCFValidPhoneNumber )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
        ShowErrorNoteL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
        __GSLOGSTRING( "[CGSCallDivertView::ValidatePhoneNumberL] Invalid phone number. " );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
    return enteredNumber;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
// CGSCallDivertView::AppendDelayItemL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
// Appends items to delay time list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
void CGSCallDivertView::AppendDelayItemL( CDesCArrayFlat& aArrayToAppend,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
                                          TInt aIndex )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
    //Delay times are defined as 5,10,15,20,25,30.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
    //Append each of these to a list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
    TInt delaySeconds = KCFDelayStep * ( aIndex + 1);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
    HBufC* string = StringLoader::LoadLC( R_TEXT_SLIST_SECONDS, delaySeconds );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
    TPtr bufPtr = string->Des();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
    if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
        AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
    aArrayToAppend.AppendL( *string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
    CleanupStack::PopAndDestroy( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
// CGSCallDivertView::CreateVoiceDivertItemsL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
// Creates items for the targert list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
void CGSCallDivertView::CreateVoiceDivertItemsL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
    CDesCArray& aItems,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
    CDesC16ArrayFlat& aDefaultNumbers )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
    HBufC* item = StringLoader::LoadLC( R_TEXT_DIVERT_TO_VOICE_MAIL );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
    aItems.AppendL( *item );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
    CleanupStack::PopAndDestroy( item );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
    ReadDefaultVoiceDivertNumbersL( aItems, aDefaultNumbers );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
    HBufC* string = StringLoader::LoadLC( R_TEXT_DIVERT_TO_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
    aItems.AppendL( *string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
    CleanupStack::PopAndDestroy( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
// CGSCallDivertView::CreateVideoDivertItemsL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
// Creates items for the data target list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
void CGSCallDivertView::CreateVideoDivertItemsL( CDesCArray& aItems )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
    HBufC* item = StringLoader::LoadLC( R_QTN_SS_DIVERT_TO_VIDEO_MAILBOX );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
    aItems.AppendL( *item );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
    CleanupStack::PopAndDestroy( item );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
    HBufC* string = StringLoader::LoadLC( R_QTN_SS_DIVERT_VCALL_TO_OTHER_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
    aItems.AppendL( *string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
    CleanupStack::PopAndDestroy( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
// Seeks '+' from given number. If '+' is first character, it is ignored.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
TInt CGSCallDivertView::FindPlus( const TDesC& aDivertTo )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
    TInt seekPlus = aDivertTo.Find( KCFPlusSign );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
    if ( seekPlus == KErrNotFound )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
        //no '+' in the number
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
        return KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
    //first char '+', but there can additional '+'s
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
    if ( seekPlus == 0 )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
        //ignore first '+'
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
        TPtrC concat = aDivertTo.Right( aDivertTo.Length() - 1 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
        seekPlus = concat.Find( KCFPlusSign );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
        if ( seekPlus != KErrNotFound )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
            return KCFErrIllegalNumber; //two '+'s in number
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
        return KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
    //'+' in number, but not first char
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
        return KCFErrIllegalNumber;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
// CGSCallDivertView::SetPromptToQueryL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
// Sets prompt to a query.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
void CGSCallDivertView::SetPromptToQueryL( CGSCallDivertQuery& aQuery,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
                                           const TInt& aType )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
    HBufC* title = StringLoader::LoadLC( aType );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
    aQuery.SetPromptL( *title );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
    CleanupStack::PopAndDestroy( title );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
// CGSCallDivertView::CreateDelayTimeItemsL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
// Creates items for delay time list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
void CGSCallDivertView::CreateDelayTimeItemsL( CDesCArrayFlat& aItems)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
    for ( TInt index = 0; index < KGSNrOfDelays; index++ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
        AppendDelayItemL( aItems, index );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
// CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
// Creates items for Delay time list for restricted call divert.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
void CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
    CDesCArrayFlat& aItems )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
    // first item is 0 seconds
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
    AppendDelayItemL( aItems, -1);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
    for ( TInt index = 0; index < KGSNrOfDelays; index++ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
        AppendDelayItemL( aItems, index );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
    AppendDelayItemL( aItems, ( 60 / KCFDelayStep ) - 1);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
    AppendDelayItemL( aItems, ( 90 / KCFDelayStep ) - 1);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
    AppendDelayItemL( aItems, ( 120 / KCFDelayStep ) - 1);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
// -----------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
// CGSCallDivertView::ProcessCommandL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
// -----------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
void CGSCallDivertView::ProcessCommandL( TInt aCommand )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
    MenuBar()->SetContextMenuTitleResourceId( R_CALL_DIVERT_MSK_CONTEXTMENUBAR );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
    // Call base class
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
    CAknView::ProcessCommandL( aCommand );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
// Before showing a options menu, delete options key specific settings if
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
// rocker key has been pressed.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   896
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   897
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   898
void CGSCallDivertView::DynInitMenuPaneL( TInt aResourceId,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   899
                                          CEikMenuPane* aMenuPane )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   900
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   901
    TInt currentItem;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   902
    CEikMenuBar* menuBar = MenuBar();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
        CGSRestrictedDivertContainer &container =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
            *static_cast<CGSRestrictedDivertContainer*>( iContainer );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
        currentItem = container.CurrentFeatureId();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
        CGSCallDivertContainer& container =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
            *static_cast<CGSCallDivertContainer*>( iContainer );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
        currentItem = container.CurrentFeatureId();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
    if ( aResourceId == R_CF_DIV_VIEW_MENU )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
        if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType() == CEikMenuBar::EMenuOptions)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
        	{
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   920
        	aMenuPane->SetItemDimmed( ECFCmdActivate, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
        	aMenuPane->SetItemDimmed( ECFCmdCancel, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
        	aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
        	}
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
        //remove help, if not supported from the main divert view
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
        //in this step, help is added to context menu too, which
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   926
        //is deleted in the next conditional stmt
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
        if ( FeatureManager::FeatureSupported ( KFeatureIdHelp ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   929
            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
        if ( iRockerPress )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
            //remove Exit & Help from the menu
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
            aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
            iRockerPress = EFalse;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
    if ( aResourceId == R_CF_MSK_DIV_VIEW_MENU ||
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
         aResourceId == R_CF_DIV_VIEW_MENU )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
        // when not available does not have check status
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
        if ( currentItem == ECFDivertWhenNotAvailable )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
            aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
// ---------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
// CGSCallDivertView::ShowErrorNote
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
// ---------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
void CGSCallDivertView::ShowErrorNoteL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
    HBufC* string = StringLoader::LoadLC( R_INVALID_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
    CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
    note->ExecuteLD( *string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
    CleanupStack::PopAndDestroy( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
// CGSCallDivertView::ReadDefaultVoiceDivertNumbersL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
// Creates defcault items for the target list.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
void CGSCallDivertView::ReadDefaultVoiceDivertNumbersL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
    CDesCArray& aItems,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
    CDesC16ArrayFlat& aDefaultNumbers )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
    TInt amount = KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
    // this is for fetching name to a number from phonebook
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
    HBufC* defaultName = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
    //Default numbers are fetched from shared data
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
    amount = iModel->DivertHandler()->GetDefaultNumbersL( aDefaultNumbers );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
    __ASSERT_ALWAYS( amount == aDefaultNumbers.MdcaCount(),
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
        Panic( KGSDivertClassName, ECFDefaultNumberCountError ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
    for ( TInt i = 0; i < amount; i++ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   991
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   992
        //Default numbers should be checked, if there is a contact name associated
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   993
        // with it.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   994
        defaultName = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
        defaultName = iModel->MatchNumberToContactLC( aDefaultNumbers.MdcaPoint( i ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   996
        __GSLOGSTRING1("[CGSCallDivertView]    ReadDefaultVoiceDivertNumbersL: defaultName: %S", &defaultName);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   997
        if ( defaultName )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
            aItems.AppendL( *defaultName );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
            TTelNumber string;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
            if ( iModel->NumberGroupingSupportedL() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
                CPNGNumberGrouping* numberGrouping = CPNGNumberGrouping::NewL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
                    KPSUIMaxPSUIItemLength );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
                CleanupStack::PushL( numberGrouping );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
                if ( aDefaultNumbers.MdcaPoint( i ).Length() <=
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
                    numberGrouping->MaxDisplayLength() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
                    numberGrouping->Set( aDefaultNumbers.MdcaPoint( i ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
                    string = numberGrouping->FormattedNumber();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
                CleanupStack::PopAndDestroy( numberGrouping );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
            if ( !string.Length() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
                string = aDefaultNumbers.MdcaPoint(i);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
            aItems.AppendL( string );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
            __GSLOGSTRING1("[CGSCallDivertView]    ReadDefaultVoiceDivertNumbersL: string: %S", &string);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
        CleanupStack::PopAndDestroy(); //defaultName
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
// CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
// Updates most recently used numbers to cenrep
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
void CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL(  TDes& aNumber )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
    if ( aNumber !=  KNullDesC && iContextMenuItems )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
        //If activation is done to already existing default number,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
        //but using the "Other number" selection, this must be verified.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
        HBufC* contactName = iModel->MatchNumberToContactLC( aNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
        TInt found = KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
        TInt loc = KErrNotFound;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
        if ( contactName )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
            found = iContextMenuItems->Find( *contactName, loc );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
            found = iContextMenuItems->Find( aNumber, loc );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
        CleanupStack::PopAndDestroy(); //contactName
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
        if ( found > 0 ) //number is not part of current def.numbers
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
            iModel->DivertHandler()->SetNewDefaultNumberL( aNumber );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
            iModel->DivertHandler()->SwapDefaultNumberL( loc );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
        __GSLOGSTRING( "[CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL] iContextMenuItems == NULL!!" );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
// CGSCallDivertView::HandleNotifyL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
// AIW callback function.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
TInt CGSCallDivertView::HandleNotifyL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
    TInt aCmdId,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
    TInt aEventId,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
    CAiwGenericParamList& aEventParamList,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
    const CAiwGenericParamList& /*aInParamList*/ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
    TInt err = KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
    if( ( aCmdId == KAiwCmdSelect ) || ( aCmdId == KAiwCmdAssign ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
        if( aEventId == KAiwEventCompleted )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
            TInt index = 0;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
            iNumberFetchedAsynchronously = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
            const TAiwGenericParam* param = aEventParamList.FindFirst(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
                index, EGenericParamContactLinkArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
            if( param && iStoresOpened )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
                if( iContactLinks )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
                    delete iContactLinks;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
                    iContactLinks = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
                TPtrC8 contactLinks = param->Value().AsData();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
                CVPbkContactLinkArray* localContactLinks =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
                    CVPbkContactLinkArray::NewLC(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
                    contactLinks,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
                    iContactManager->ContactStoresL() );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
                CleanupStack::Pop( localContactLinks );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
                iContactLinks = localContactLinks;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
                if( iContactLinks->Count() > 0 )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
                    iRetrieveOperation = iContactManager->RetrieveContactL( iContactLinks->At( 0 ), *this );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
        else if (aEventId == KAiwEventCanceled)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
            // Do nothing.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
        else if (aEventId == KAiwEventOutParamCheck)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
            // This is needed as PBK2 mysteriously crashes if check is not
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
            // acccepted. There's no actual need to check anything but to go
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
            // ahead here so setting to ETrue.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
            err = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
        else if (aEventId == KAiwEventQueryExit)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
            err = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
    return err;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
// CGSCallDivertView::VPbkSingleContactOperationComplete
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
void CGSCallDivertView::VPbkSingleContactOperationComplete(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
    MVPbkContactOperationBase& /*aOperation*/,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
    MVPbkStoreContact* aContact )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
    if( iRetrieveOperation )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
        delete iRetrieveOperation;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
        iRetrieveOperation = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
    TRAP_IGNORE
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
        (
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
        MVPbkStoreContactField* field = aContact->Fields().RetrieveField( iContactLinks->At( 0 ) );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
        if ( field && field->FieldData().DataType() == EVPbkFieldStorageTypeText )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
            // aContact has selected phone number from Pbk2 dialog. Set this as
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
            // a text for ExecuteDivertNumberQueryL.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
            TCallDivertSetting setting;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
            setting.iSetting = EActivateDiverting;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
            setting.iNumber = MVPbkContactFieldTextData::Cast( field->FieldData() ).Text();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
            //Ask for user input.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
            ExecuteDivertNumberQueryL( setting.iNumber, R_TEXT_PRMPT_NUMBER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
            // ExecuteDivertNumberQueryL() will set setting.iNumber to KNullDesC if user
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
            // selected 'search'. In this case program execution is moved to
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
            // pbk2 asynchronous dialog and this function can exit without
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
            // sending call divert request.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
            if( setting.iNumber != KNullDesC )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
                // Send divert request.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
                iModel->SendCallDivertRequestL( setting,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1172
                                                RMobilePhone::EServiceActionRegister,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
                                                iVoiceMailboxDivert,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
                                                ECFCmdActivate,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
                                                (TGSCallDivertServices) iCurrentItem );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
        );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
    delete aContact;// Ownership is taken by this
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
// CGSCallDivertView::VPbkSingleContactOperationFailed
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
void CGSCallDivertView::VPbkSingleContactOperationFailed(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
    MVPbkContactOperationBase& /*aOperation*/,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
    TInt /*aError*/)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
    if( iRetrieveOperation )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
        delete iRetrieveOperation;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
        iRetrieveOperation = NULL;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
// CGSCallDivertView::OpenComplete
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
void CGSCallDivertView::OpenComplete()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1205
    iStoresOpened = ETrue;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
// CGSCallDivertView::StoreReady
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
void CGSCallDivertView::StoreReady( MVPbkContactStore& /*aContactStore*/ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1214
    // Do nothing
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
// CGSCallDivertView::StoreUnavailable
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1221
void CGSCallDivertView::StoreUnavailable
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1222
        ( MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1223
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1224
    // Do nothing
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1225
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1226
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1227
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1228
// CGSCallDivertView::HandleStoreEventL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1229
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1230
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1231
void CGSCallDivertView::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1232
        TVPbkContactStoreEvent /*aStoreEvent*/ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1233
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1234
    // Do nothing
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1235
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1236
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1237
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1238
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1239
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1240
// CGSCallDivertView::CreateTimeListL
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1241
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1242
// Activates this view's popup list in order to change time-setting.
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1243
// ---------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1244
TInt CGSCallDivertView::CreateTimeListL()
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1245
    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1246
    CAknSinglePopupMenuStyleListBox* list =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1247
        new ( ELeave ) CAknSinglePopupMenuStyleListBox;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1248
    CleanupStack::PushL( list );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1249
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1250
    CAknPopupList* popupList =
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1251
        CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1252
    CleanupStack::PushL( popupList );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1253
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1254
    HBufC* title = StringLoader::LoadLC( R_TEXT_DELAY_HEADER );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1255
    popupList->SetTitleL( *title );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1256
    CleanupStack::PopAndDestroy( title );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1257
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1258
    list->ConstructL( popupList,CEikListBox::ELeftDownInViewRect );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1259
    list->CreateScrollBarFrameL( ETrue );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1260
    list->ScrollBarFrame()->SetScrollBarVisibilityL(
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1261
        CEikScrollBarFrame::EOff,
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1262
        CEikScrollBarFrame::EAuto );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1263
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1264
    CDesCArrayFlat* items;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1265
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1266
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1267
        items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays + 4 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1268
        CleanupStack::PushL( items );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1269
        CreateRestrictedCallDivertDelayTimeItemsL( *items );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1270
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1271
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1272
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1273
        items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1274
        CleanupStack::PushL( items );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1275
        CreateDelayTimeItemsL( *items );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1276
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1277
    CTextListBoxModel* model = list->Model();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1278
    model->SetItemTextArray( items );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1279
    model->SetOwnershipType( ELbmOwnsItemArray );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1280
    CleanupStack::Pop(); //items
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1281
    list->HandleItemAdditionL();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1282
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1283
    //set focus according to file read by phonesettings
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1284
    //set delay timer field value
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1285
    TInt currIndex = KErrNone;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1286
    if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1287
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1288
        TInt itemCount = items->Count();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1289
        if (( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) > ( itemCount - 4))
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1290
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1291
            // Within 60, 90, 120 range
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1292
            switch ( iModel->DivertHandler()->GetTimerValueL() )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1293
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1294
                case 60:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1295
                    currIndex = itemCount - 3;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1296
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1297
                case 90:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1298
                    currIndex = itemCount - 2;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1299
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1300
                case 120:
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1301
                    currIndex = itemCount - 1;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1302
                    break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1303
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1304
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1305
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1306
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1307
            currIndex = iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1308
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1309
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1310
    else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1311
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1312
        currIndex = ( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) - 1;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1313
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1314
    __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] currIndex: %d", currIndex );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1315
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1316
    list->SetCurrentItemIndex( currIndex );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1317
    //if possible show topmost item
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1318
    list->SetTopItemIndex(0);
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1319
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1320
    TInt keyPress = popupList->ExecuteLD();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1321
    CleanupStack::Pop( popupList );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1322
    if ( keyPress )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1323
        {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1324
        TInt index = list->CurrentItemIndex();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1325
        __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] index: %d", index );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1326
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1327
        if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1328
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1329
            TInt itemCount = items->Count();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1330
            if ( index > ( itemCount - 4))
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1331
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1332
                // Within 60, 90, 120 range
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1333
                if ( index == itemCount - 3)
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1334
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1335
                    iModel->DivertHandler()->SetTimerValueL( 60 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1336
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1337
                else if ( index == itemCount - 2 )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1338
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1339
                    iModel->DivertHandler()->SetTimerValueL( 90 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1340
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1341
                else if ( index == itemCount - 1 )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1342
                    {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1343
                    iModel->DivertHandler()->SetTimerValueL( 120 );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1344
                    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1345
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1346
            else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1347
                {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1348
                // first entry is 0 seconds
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1349
                currIndex = iModel->DivertHandler()->SetTimerValueL( index * KCFDelayStep );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1350
                }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1351
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1352
        else
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1353
            {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1354
            //save to file the correct value calculated from index
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1355
            iModel->DivertHandler()->SetTimerValueL( ( index + 1 ) * KCFDelayStep );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1356
            }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1357
        }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1358
    CleanupStack::PopAndDestroy( list );
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1359
    return keyPress;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1360
    }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1361
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1362
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1363
// CGSCallDivertView::RemoveInvalidChars
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1364
// Remove invalid " ", "()" which were sync with PC suite. 
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1365
// --------------------------------------------------------------------------
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1366
//
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1367
void CGSCallDivertView::RemoveInvalidChars( TDes& aNumber )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1368
  {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1369
  TInt noOfInvalidchars = KCallDivertInvalidchars().Length();
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1370
  TInt location = KErrNone; 
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1371
  // delete the invalid chars of KCallDivertInvalidchars. 
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1372
  //aNumber changed to valid phone number if it contains invalid chars
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1373
  for ( TInt index = 0; index < noOfInvalidchars; index++ )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1374
       {     
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1375
       while ( ETrue )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1376
           {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1377
           location = aNumber.Find( KCallDivertInvalidchars().Mid( index, 1 ) );   
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1378
           if ( location == KErrNotFound )
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1379
               {
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1380
               break;
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1381
               }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1382
           aNumber.Delete( location, 1 ); //delete the invalid char, aNumber changed
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1383
           }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1384
       }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1385
  }
7e0eff37aedb Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1386
// End of File