phoneapp/phoneuicontrol/src/cphonestateidle.cpp
author Fionntina Carville <fionntinac@symbian.org>
Mon, 15 Nov 2010 11:44:32 +0000
branchRCL_3
changeset 84 1dabaed15bcd
parent 81 c26cc2a7c548
permissions -rw-r--r--
Bug 3539. Update localisation mappings for phone.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: Implementation of CPhoneStateIdle class.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
// INCLUDES
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <eikenv.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <e32property.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <connect/sbdefs.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <w32std.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <StringLoader.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <apgcli.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <telephonyvariant.hrh>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <featmgr.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include <settingsinternalcrkeys.h>
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    30
#include <ScreensaverInternalPSKeys.h>
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include <mpeengineinfo.h>
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    32
#include <activeidle2domainpskeys.h>
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include <mpeclientinformation.h>
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include <bldvariant.hrh>
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    35
#include <MProEngEngine.h>
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    36
#include <ProEngFactory.h>
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#include "cphonepubsubproxy.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "cphonecenrepproxy.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
#include "cphonestateidle.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include "tphonecmdparaminteger.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
#include "tphonecmdparamboolean.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
#include "tphonecmdparamglobalnote.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
#include "tphonecmdparamstring.h"
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    45
#include "tphonecmdparamspeeddial.h"
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
#include "tphonecmdparamboolean.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
#include "mphonestatemachine.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
#include "phonestatedefinitions.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
#include "tphonecmdparamappinfo.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
#include "cphonekeys.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
#include "tphonecmdparamcallstatedata.h"
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    53
#include "tphonecmdparamcallheaderdata.h"
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
#include "phoneviewcommanddefinitions.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
#include "phoneui.hrh"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
#include "phonerssbase.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
#include "cphonemainresourceresolver.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
#include "cphonecenrepproxy.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
#include "cphonepubsubproxy.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
#include "phonelogger.h"
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
#include "phoneui.pan"
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    62
#include "phoneconstants.h"
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
#include "mphonecustomization.h"
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    64
#include <easydialingcommands.hrh>
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    65
#include "mphonesecuritymodeobserver.h"
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    67
//CONSTANTS
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    68
const TInt  KMaxParamLength = 1024;
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
// ================= MEMBER FUNCTIONS =======================
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
// C++ default constructor can NOT contain any code, that
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
// might leave.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
EXPORT_C CPhoneStateIdle::CPhoneStateIdle( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    MPhoneStateMachine* aStateMachine, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    MPhoneViewCommandHandle* aViewCommandHandle,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    MPhoneCustomization* aCustomization ) : 
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    79
    CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ),
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    80
    iCallInitialized( EFalse )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// Destructor
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
EXPORT_C CPhoneStateIdle::~CPhoneStateIdle()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
// CPhoneStateIdle::ConstructL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
EXPORT_C void CPhoneStateIdle::ConstructL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
    CPhoneState::BaseConstructL();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    97
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    98
    // Set send key activation on.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
    99
    TPhoneCmdParamBoolean boolean;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   100
    boolean.SetBoolean( ETrue );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   101
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   102
                &boolean );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   103
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   104
    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreatePhoneBookServices ); 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   105
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   106
    // If Sim is not ok and we are not at foreground, bring ourselves to foreground
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   107
    // so that the security note can be seen.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   108
    TPhoneCmdParamInteger foregroundAppParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   109
    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   110
                                         &foregroundAppParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   111
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   112
    if ( !IsSimOk() && KUidPhoneApplication.iUid != foregroundAppParam.Integer() )
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   113
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   114
        TPhoneCmdParamInteger uidParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   115
        // Bring Phone app in the foreground
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   116
        uidParam.SetInteger( KUidPhoneApplication.iUid );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   117
        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   118
            &uidParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   119
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   120
        // Set Phone as the top application
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   121
        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   122
            &uidParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   123
        }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
// CPhoneStateIdle::NewL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
CPhoneStateIdle* CPhoneStateIdle::NewL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
    MPhoneStateMachine* aStateMachine, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
    MPhoneViewCommandHandle* aViewCommandHandle,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
    MPhoneCustomization* aPhoneCustomization )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
    CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
        aStateMachine, aViewCommandHandle, aPhoneCustomization );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
    CleanupStack::PushL( self );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
    self->ConstructL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    CleanupStack::Pop( self );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
    return self;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
// CPhoneStateIdle::HandleKeyEventL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
EXPORT_C void CPhoneStateIdle::HandleKeyEventL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
    const TKeyEvent& aKeyEvent, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
    TEventCode aEventCode )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) ");
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   154
    
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
    // Number entry is blocked, if active Query
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
    if ( !IsAnyQueryActiveL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
        // Handle numeric keys when key events are received in idle state
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
        HandleNumericKeyEventL( aKeyEvent, aEventCode );  
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
        }
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   161
    else if ( iStateMachine->SecurityMode()->IsSecurityMode()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   162
        && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
        // Handle numeric keys when key events are received in single state
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
        HandleNumericKeyEventL( aKeyEvent, aEventCode );  
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
    else if ( aEventCode == EEventKeyUp )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
        // Provide up event to engine. 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
        // Otherwise DTMF tone keeps playing.    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
           iStateMachine->SendPhoneEngineMessage( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
                MPEPhoneModel::EPEMessageEndDTMF );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
         __PHONELOG( EBasic, EPhoneControl,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
                "PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
// CPhoneStateIdle::HandleNumberEntryClearedL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
    if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
        //  if still idle ( f.e not incoming call arrived when rfs )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
        if ( iStateMachine->State() == this )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
            DisplayIdleScreenL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
   else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
        StartShowSecurityNoteL(); 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
// CPhoneStateIdle::HandleKeyMessageL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
    TPhoneKeyEventMessages aMessage,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
    TKeyCode aCode )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   211
    if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   212
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   213
        return;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   214
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   215
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
    switch ( aCode )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
        case EKeyEnd:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
            // This key even occur only in idle state, behaviour for this should
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
            // be same as long end-key press. (Bug in window server)
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
            HandleEndKeyPressL( EPhoneKeyLongPress );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
        // end-key
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
        case EKeyNo:
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   226
            HandleEndKeyPressL( aMessage );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
        // send-key
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
        case EKeyYes:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
            if ( iOnScreenDialer )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
                {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
                if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
                    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   236
                   
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
                    TPhoneCmdParamInteger numberEntryCountParam;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
                    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
                    &numberEntryCountParam );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
                    TInt neLength( numberEntryCountParam.Integer() );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
                    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
                    // Query on top of dialer
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
                    if ( IsAnyQueryActiveL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
                        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
                        return;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
                        }
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   247
                    else if ( IsMenuBarVisibleL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   248
                        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   249
                        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   250
                        return;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   251
                        }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
                    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   253
                    else if ( neLength == 0 && !iStateMachine->SecurityMode()->IsSecurityMode() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
                        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
                        // start logs
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
                        iViewCommandHandle->HandleCommandL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
                        EPhoneDialerCmdLog );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
                        return;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
                        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
                    HandleSendCommandL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
                    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
                // If dialer is not open but phone is in foreground and phone receives
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
                // send-key event we have to check if security mode is true and if it
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
                // is then open emergency dialer.
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   265
                else if ( !IsNumberEntryUsedL() ) 
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
                    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   267
                   if ( iStateMachine->SecurityMode()->IsSecurityMode() )
44
3c221667e687 Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   268
                        {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   269
                        iViewCommandHandle->HandleCommandL( EPhoneViewOpenNumberEntry );
44
3c221667e687 Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   270
                        }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
                    }           
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
            else // iOnScreenDialer false, non-touch.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
                {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
                HandleSendCommandL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
        case EKeyApplication0:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
            // If dialer is not open but phone is in foreground and phone receives
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   282
            // applicaion-key event we have to open emergency dialer. 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   283
            // Securitymode check because Applicationkey only open dialer in securitymode.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   284
            if ( iStateMachine->SecurityMode()->IsSecurityMode() && !IsNumberEntryUsedL() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
                {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   286
                iViewCommandHandle->HandleCommandL( EPhoneViewOpenNumberEntry );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
                }           
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
            
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   291
        // "O" key
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   292
        case KPhoneDtmf0Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   293
            if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   294
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   295
                LaunchApplicationL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   296
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   297
            break;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   298
            
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   299
        // number key
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   300
        case KPhoneDtmf1Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   301
        case KPhoneDtmf2Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   302
        case KPhoneDtmf3Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   303
        case KPhoneDtmf4Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   304
        case KPhoneDtmf5Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   305
        case KPhoneDtmf6Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   306
        case KPhoneDtmf7Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   307
        case KPhoneDtmf8Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   308
        case KPhoneDtmf9Character:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   309
            if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   310
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   311
                HandleNumberLongKeyPressL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   312
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   313
            break;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   314
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
#ifdef RD_INTELLIGENT_TEXT_INPUT   
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
        case EKeyEnter:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
            if ( IsNumberEntryVisibleL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
                {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   319
                if ( IsDialingExtensionInFocusL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   320
                    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   321
                    HandleCommandL( EEasyDialingEnterKeyAction );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   322
                    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   323
                else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   324
                    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   325
                    TPhoneCmdParamInteger numberEntryCountParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   326
                    iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   327
                            EPhoneViewGetNumberEntryCount,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   328
                            &numberEntryCountParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   329
                    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   330
                    TInt neLength( numberEntryCountParam.Integer() );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   331
                    if ( neLength > 0 )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   332
                        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   333
                        HandleSendCommandL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   334
                        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   335
                    }               
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
#endif
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
        default:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
// CPhoneStateIdle::HandlePhoneEngineMessageL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
    const TInt aMessage, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
    TInt aCallId )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
    switch ( aMessage )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
        {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   356
        case MEngineMonitor::EPEMessageInitiatedMoCall:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   357
            SetCallInitialized( ETrue );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   358
            break;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   359
                    
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
        case MEngineMonitor::EPEMessageIncoming:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
            HandleIncomingL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
        case MEngineMonitor::EPEMessageDialing:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
            HandleDialingL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
        case MEngineMonitor::EPEMessageConnected:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
            HandleConnectedL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
        case MEngineMonitor::EPEMessageIssuedUSSDRequest:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
            // Note that after the sending of SS 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
            // strings the view stays in Dialer.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
            if ( !iOnScreenDialer )  
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
                {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
                if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
                    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
                    // Show the number entry if it exists
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   380
                    SetNumberEntryVisibilityL(ETrue);
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
                    }    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   382
                else if ( NeedToReturnToForegroundAppL() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
                    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
                    // Continue displaying current app but set up the 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
                    // idle screen in the background
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
                    SetupIdleScreenInBackgroundL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
                    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
                else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
                    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
                     // Display idle screen
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
                    DisplayIdleScreenL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
                    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
        case MEngineMonitor::EPEMessageIdle:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
            HandleIdleL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
            
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   400
        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   401
            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
        case MEngineMonitor::EPEMessageValidEmergencyNumber:
58
40a3f856b14d Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 57
diff changeset
   405
            DialVoiceCallL();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
            break; 
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   407
        
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
        default:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
// CPhoneStateIdle::HandleIncomingL( TInt aCallId )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
// Default handling for incoming message
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
// (other items were commented in a header).
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   423
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
    HandleAudioAvailableOutputChangedL();
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   425
    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   426
    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   427
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
    SetRingingTonePlaybackL( aCallId );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   429
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   430
    CPhonePubSubProxy::Instance()->ChangePropertyValue(
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   431
        KPSUidScreenSaver,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   432
        KScreenSaverAllowScreenSaver,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   433
        EPhoneScreensaverNotAllowed );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   434
    
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   435
    IsNumberEntryUsedL() ? 
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   436
        BeginTransEffectLC( ECallUiAppear ) :
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   437
        BeginTransEffectLC( ENumberEntryOpen );
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   438
    BeginUiUpdateLC();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
    // Hide the number entry if it exists
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
    if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
        SetNumberEntryVisibilityL(EFalse);    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
     
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   446
    // Close fast swap window if it's displayed
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   447
    CEikonEnv::Static()->DismissTaskList();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   448
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
    // Show incoming call buttons
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
    SetTouchPaneButtons( EPhoneIncomingCallButtons );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   451
    SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   452
    SetTouchPaneButtonEnabled( EPhoneInCallCmdHold );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
    
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   454
    // Display incoming call
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   455
    DisplayIncomingCallL( aCallId );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   456
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   457
    EndUiUpdate();
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   458
    EndTransEffect();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
    
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   460
    // Go to incoming state
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
    iCbaManager->UpdateIncomingCbaL( aCallId );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   462
    UpdateSilenceButtonDimming();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   463
    UpdateIncomingContextMenuL( aCallId );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   464
    //Dim toolbar items
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   465
    SetToolbarDimming( ETrue );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
    //request that dimmed toolbar is visible.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
    iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   468
    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   469
    ChangeTo( EPhoneStateIncoming );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   470
         
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   471
    // Reset divert indication
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   472
    SetDivertIndication( EFalse );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
// -----------------------------------------------------------
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   476
// CPhoneStateIdle::HandleDialingL
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
// Default handling for dialling message
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
// (other items were commented in a header).
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId )
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   482
    {    
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) ");
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   484
    DisplayCallSetupL( aCallId );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   485
    ChangeTo( EPhoneStateCallSetup );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   486
    }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   488
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   489
// CPhoneStateIdle::DoStateSpecificCallSetUpDefinitionsL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   490
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   491
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   492
EXPORT_C void CPhoneStateIdle::DoStateSpecificCallSetUpDefinitionsL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   493
    {
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
    // Show call setup buttons
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   495
    SetTouchPaneButtons( EPhoneCallSetupButtons );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   496
    SetTouchPaneButtonDisabled( EPhoneInCallCmdHold );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   497
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   498
    SetToolbarDimming( ETrue );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   499
    SetToolbarButtonLoudspeakerEnabled();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   500
    SetToolbarButtonHandsetEnabled();
69
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   501
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   502
    TPhoneCmdParamInteger uidParam;
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   503
    uidParam.SetInteger( KUidPhoneApplication.iUid );
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   504
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   505
    // Set Phone as the top application
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   506
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
8baf28733c3d Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   507
       &uidParam );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
// CPhoneStateIdle::HandleConnectedL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
// Message Handling function for message EPEMessageConnected
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
// This could happen during transaction from Emergency mode
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
// to Normal mode where a network status change is received
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
// from PE after PE initiates an MO call. Since PE messages
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
// are asynchronous, this sequence can occur in any order.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
// (other items were commented in a header).
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
void CPhoneStateIdle::HandleConnectedL( TInt aCallId )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
    // Keep Phone app in the foreground if it is external
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
    if ( !TopAppIsDisplayedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
        TPhoneCmdParamInteger uidParam;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
        uidParam.SetInteger( KUidPhoneApplication.iUid );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
            &uidParam );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
        }
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   531
    BeginTransEffectLC( ENumberEntryClose );
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   532
    BeginUiUpdateLC();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   533
    
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
    // Remove the number entry
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
    // Display call setup header
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
    DisplayCallSetupL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
    // Update single active call
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
    UpdateSingleActiveCallL( aCallId );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
    // Update touch buttons
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
    SetTouchPaneButtons( EPhoneIncallButtons );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   545
    SetToolbarDimming( EFalse );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
    
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   547
    EndUiUpdate();
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   548
    EndTransEffect();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
  
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   550
    // Go to single state
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
    iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   552
    ChangeTo( EPhoneStateSingle );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
// CPhoneStateIdle::HandleCommandL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
    TBool commandStatus = ETrue;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
    switch( aCommand )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
        case EPhoneCmdOptions:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
            {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   568
            // Open number entry menubar
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   569
            TInt menuId( GetNumberAcqMenuIdL() );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   570
            TPhoneCmdParamInteger integerParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   571
            integerParam.SetInteger( menuId );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   572
            iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   573
                EPhoneViewMenuBarOpen, &integerParam );
58
40a3f856b14d Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 57
diff changeset
   574
            }
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   575
            break;
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
        case EPhoneNumberAcqCmdCall:
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   577
            HandleVoiceCallCommandL( EFalse );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
        case EPhoneNumberAcqCmdSendCommand:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
            HandleSendCommandL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   581
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
        case EPhoneNumberAcqCmdVideoCall:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
            DialVideoCallL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
        case EPhoneCmdBack:
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   588
            BeginTransEffectLC( ENumberEntryClose );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   589
            HandleBackCommandL();
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   590
            EndTransEffect();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   591
            break;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   592
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   593
        case EPhoneViewOpenNumberEntry:
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   594
            BeginTransEffectLC( ENumberEntryOpen );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   595
            commandStatus = CPhoneState::HandleCommandL( aCommand );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   596
            EndTransEffect();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   597
            break;
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
        default:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
            commandStatus = CPhoneState::HandleCommandL( aCommand );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
            break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
    return commandStatus;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
// CPhoneStateIdle::ProcessCommandL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
    TBool commandStatus = EFalse;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
    switch( aCommand )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
       {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
       case EAknSoftkeyContextOptions:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
           {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   618
           // Open number entry OK menubar
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   619
           TPhoneCmdParamInteger integerParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   620
           integerParam.SetInteger( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   621
               CPhoneMainResourceResolver::Instance()->
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   622
               ResolveResourceID( EPhoneNumberAcqOkMenubar ) );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   623
           iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   624
               EPhoneViewMenuBarOpen, &integerParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   625
           commandStatus = ETrue;
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
           }
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   627
           break;
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
       default:
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
           commandStatus = CPhoneState::ProcessCommandL( aCommand );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
           break;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
       }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
    return commandStatus;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
// CPhoneStateIdle::HandleRemConCommandL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL(
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
    TRemConCoreApiOperationId /*aOperationId */, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
    TRemConCoreApiButtonAction /*aButtonAct*/ )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
    return EFalse;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
// CPhoneStateIdle::DialL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
EXPORT_C void CPhoneStateIdle::DialL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
        const TDesC& aNumber, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
        TPhoneNumberType aNumberType,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
        TDialInitiationMethod /*aDialMethod*/ )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
    if ( aNumberType == EPhoneNumberTypeVideo &&
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
        FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
        DialMultimediaCallL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
    else if ( EPhoneNumberTypeVoip == aNumberType &&
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
              iCustomization )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
        iCustomization->HandleDialL( aNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
    else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
        {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   669
        DialVoiceCallL();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
    }
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   672
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   673
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   674
// CPhoneStateIdle::HandleBackCommandL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   675
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   676
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   677
void CPhoneStateIdle::HandleBackCommandL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   678
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   679
    TBool previousApp(EFalse);
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   680
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   681
    // If previous app activation is true then open
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   682
    // previous application.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   683
    if ( iOnScreenDialer && 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   684
        IsSimOk() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   685
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   686
        TPhoneCmdParamBoolean booleanParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   687
        iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   688
            EPhoneViewGetActivatePreviousApp, &booleanParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   689
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   690
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   691
        if ( booleanParam.Boolean() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   692
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   693
            // Open previous app.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   694
            iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   695
                EPhoneViewActivatePreviousApp );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   696
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   697
            // Remove number entry from screen
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   698
            iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   699
                EPhoneViewRemoveNumberEntry ); 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   700
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   701
            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   702
            previousApp = ETrue;   
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   703
            }        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   704
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   705
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   706
    if ( !previousApp )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   707
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   708
        // Remove number entry from screen
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   709
        iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   710
            EPhoneViewRemoveNumberEntry );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   711
         
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   712
        // Do state-specific operation when number entry is cleared
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   713
        HandleNumberEntryClearedL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   714
        }  
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   715
 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   716
    }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
// CPhoneStateIdle::DialVideoCallL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
void CPhoneStateIdle::DialVideoCallL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
    if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
        // get the number entry contents
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
        HBufC* phoneNumber = PhoneNumberFromEntryLC();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
#ifdef _DEBUG
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
        if ( (*phoneNumber).Compare( KExit ) == 0 )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
            CleanupStack::PopAndDestroy( phoneNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
            SendExitCommandL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
        else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
#endif // _DEBUG
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
            {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   738
            if ( IsSpeedDialNumber( (*phoneNumber) ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   739
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   740
                // Handle speed dial
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   741
                SpeedDialL( (*phoneNumber)[0], EDialMethodMenuSelection );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   742
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   743
            else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   744
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   745
                // call the number
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   746
                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   747
                DialMultimediaCallL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   748
                }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
            CleanupStack::PopAndDestroy( phoneNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
        }       
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
// CPhoneStateIdle::DisplayIncomingCallL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
        Panic( EPhoneCtrlInvariant ) );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   764
    // Close menu bar, if it is displayed
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   765
    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
    // Remove any phone dialogs if they are displayed
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
    // Capture keys when there is an incoming call
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
    CaptureKeysDuringCallNotificationL( ETrue );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   773
    // Indicate that the Foreground application needs to be sent to the foreground 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   774
    // after call is ended.
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   775
    TPhoneCmdParamBoolean booleanParam;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   776
    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   777
    iViewCommandHandle->ExecuteCommandL( 
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   778
        EPhoneViewSetNeedToReturnToForegroundAppStatus,
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   779
        &booleanParam );
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   780
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
    // Bring Phone app in the foreground
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
    TPhoneCmdParamInteger uidParam;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
    uidParam.SetInteger( KUidPhoneApplication.iUid );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
        &uidParam );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
    // Set Phone as the top application
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
        &uidParam );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
        
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
    // Disable global notes when there is an incoming call
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   792
    DisableGlobalNotifiersL();
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   793
    DisableEikonNotifiersL();
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
    DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
// CPhoneStateIdle::HandleIdleForegroundEventL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
    if ( IsNumberEntryUsedL() )
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   807
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   808
        // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   809
        // to ensure that numberentry/dialler is drawn to UI.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   810
        TPhoneViewResponseId respond = 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   811
            iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   812
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   813
        if ( respond && IsNumberEntryVisibleL() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
            // Set Number Entry CBA
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
    else if ( !IsAnyQueryActiveL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
        // Set idle as top application
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   822
        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
// CPhoneStateIdle::HandlePhoneForegroundEventL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   832
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneForegroundEventL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   833
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   834
    TBool activatePhone = CPhonePubSubProxy::Instance()->Value(
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   835
                    KPSUidAiInformation, KActiveIdleState ) == EPSAiNumberEntry;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   836
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   837
    if ( activatePhone )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   838
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   839
        // If activatePhone is true then user has pressed some numeric
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   840
        // key and icon must be set to FSW. In this case number entry is not yet open so it
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   841
        // it is not enough to call EPhoneViewUpdateFSW.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   842
        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdatePhoneIconToFSW );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   843
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   844
    // If number entry is used update FSW accordingly.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   845
    else if ( IsNumberEntryUsedL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   846
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   847
        // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   848
        // to ensure that numberentry/dialler is drawn to UI.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   849
        TPhoneViewResponseId respond = 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   850
            iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   851
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   852
        if ( respond && IsNumberEntryVisibleL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   853
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   854
            // Set Number Entry CBA
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   855
            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   856
            }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   857
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   858
        // If dialer is open add icon to FSW list.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   859
        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   860
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   861
    /*iCallInitialized has to be checked because if it true then phoneapp 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   862
    is already initializing call bubble and we cant bring idle to screen. */
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   863
    else if ( !IsNumberEntryUsedL() && 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   864
              !iStateMachine->SecurityMode()->IsSecurityMode() &&
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   865
              !iCallInitialized )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   866
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   867
        // Bring Idle app to the foreground
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   868
        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   869
        }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
// CPhoneStateIdle::HandlePhoneFocusLostEventL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
    if ( !IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
         {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
         // If NE/dialer is open add icon to FSW list.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
         }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   887
// CPhoneStateIdle::HandleIdleL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   888
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   891
    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   892
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" );
61
41a7f70b3818 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   893
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   894
    CloseClearNumberEntryAndLoadEffectL( ECallUiDisappear );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   895
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   896
    // Reset flag.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   897
    SetCallInitialized( EFalse );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   898
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   899
 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   900
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   901
// CPhoneStateIdle::SpeedDialL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   902
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   903
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   904
EXPORT_C void CPhoneStateIdle::SpeedDialL( const TUint& aDigit, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   905
        TDialInitiationMethod aDialMethod )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   906
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   907
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   908
    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   909
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   910
    TPhoneCmdParamSpeedDial speedDialParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   911
    HBufC* phoneNumber = NumberForSpeedDialLocationL( aDigit, speedDialParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   912
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   913
    // Store serviceId received from vmbx handler
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   914
    iStateMachine->PhoneEngineInfo()->SetServiceIdCommand( speedDialParam.ServiceId() );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   915
    CleanupStack::PushL( phoneNumber );
61
41a7f70b3818 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
   916
    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   917
    if ( NULL != phoneNumber && KNullDesC() != *phoneNumber )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   918
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   919
        DialL( *phoneNumber, speedDialParam.NumberType(), aDialMethod );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   920
        RemoveNumberEntryAndSetIdleToBackgroundIfNeededL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   921
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   922
    else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   923
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   924
        // User cancelled dialog or didn't give a valid number
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   925
        SpeedDialCanceledL( aDigit );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   926
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   927
    CleanupStack::PopAndDestroy( phoneNumber );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   928
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   929
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   930
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   931
// CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   932
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   933
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   934
void CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   935
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   936
    __LOGMETHODSTARTEND(EPhoneControl, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   937
    "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   938
    if ( IsNumberEntryUsedL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   939
        {
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   940
        BeginTransEffectLC( ECallUiAppear );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   941
        /*NE should be removed because if speeddial dial is interupted during
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   942
        call setup phone should not return to NE/Dialler view.*/
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   943
        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   944
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   945
        /*It might be possible that some async operation was ongoing and 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   946
        state has already in that case do not set idle to background.*/
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   947
        if ( iStateMachine->State() == this )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   948
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   949
            iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   950
            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   951
            }
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
   952
        EndTransEffect();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   953
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   954
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   955
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   956
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   957
// CPhoneStateIdle::SpeedDialCanceledL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   958
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   959
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   960
EXPORT_C void CPhoneStateIdle::SpeedDialCanceledL( const TUint& aDigit )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   962
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   963
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialCanceledL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   964
    if ( IsNumberEntryUsedL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   965
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   966
        if ( aDigit == KPhoneDtmf1Character || 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   967
                  ( aDigit == KPhoneDtmf2Character && 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   968
                    iViewCommandHandle->HandleCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   969
                     EPhoneViewIsStraightCallToVideoMailBox ) == EPhoneViewResponseSuccess ) ) 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   970
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   971
            // Remove number entry and set idle background on non-touch products
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   972
            if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   973
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   974
                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   975
                
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   976
                // Set Idle background, if still idle ( f.e not incoming call arrived )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   977
                if ( iStateMachine->State() == this )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   978
                    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   979
                    // idle screen in the background
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   980
                    SetupIdleScreenInBackgroundL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   981
                    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   982
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   983
            }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   984
        }        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   985
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   986
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   987
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   988
// CPhoneStateIdle::HandleNumberLongKeyPressL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   989
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   990
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   991
EXPORT_C void CPhoneStateIdle::HandleNumberLongKeyPressL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   992
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   993
    __LOGMETHODSTARTEND(EPhoneControl, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   994
        "CPhoneStateIdle::HandleNumberLongKeyPressL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   995
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   996
    HBufC* phoneNumber = PhoneNumberFromEntryLC();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   997
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   998
    if ( phoneNumber && IsSpeedDialNumber ( *phoneNumber ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
   999
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1000
        SpeedDialL( (*phoneNumber)[0], EDialMethodOneKeyDialing );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1001
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1002
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1003
    CleanupStack::PopAndDestroy( phoneNumber );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1004
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1005
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1006
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1007
// CPhoneStateIdle::IsSpeedDialNumber()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1008
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1009
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1010
EXPORT_C TBool CPhoneStateIdle::IsSpeedDialNumber( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1011
        const TDesC& aNumber ) const
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1012
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1013
    return ( aNumber.Length() == KPhoneDtmfSpeedDialPrefixLength 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1014
            && aNumber[0] >= KPhoneDtmf1Character 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1015
            && aNumber[0] <= KPhoneDtmf9Character );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1016
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1017
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1018
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1019
// CPhoneStateIdle::HandleSendCommandL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1020
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1021
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1022
EXPORT_C void CPhoneStateIdle::HandleSendCommandL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1023
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1024
    __LOGMETHODSTARTEND(
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1025
        EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1026
    
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1027
    HandleVoiceCallCommandL( ETrue );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1028
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1029
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1030
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1031
// CPhoneStateIdle::LaunchApplicationL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1032
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1033
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1034
void CPhoneStateIdle::LaunchApplicationL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1035
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1036
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchApplicationL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1037
    // Check if only one number exists in the number
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1038
    // entry
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1039
    TPhoneCmdParamInteger numberEntryCountParam;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1040
    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1041
        &numberEntryCountParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1042
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1043
    if ( numberEntryCountParam.Integer() == 1 )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1044
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1045
        // Remove the number entry window
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1046
        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1047
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1048
        iStateMachine->SendPhoneEngineMessage( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1049
                MPEPhoneModel::EPEMessageEndDTMF );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1050
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1051
        // Launch application.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1052
        iViewCommandHandle->ExecuteCommandL(
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1053
            EPhoneViewLaunchApplication );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1054
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1055
        // Continue displaying current app but set up the 
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1056
        // idle screen in the background
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1057
        SetupIdleScreenInBackgroundL();
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1058
        }
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1059
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1060
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1061
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1062
// CPhoneStateIdle:SendExitCommandL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1063
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1064
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1065
void CPhoneStateIdle::SendExitCommandL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1066
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1067
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) ");
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1068
    // Remove number entry from screen
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1069
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1070
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1071
    // Simulate exit command
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1072
    RWsSession& wsSession = CEikonEnv::Static()->WsSession();
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1073
    TKeyEvent keyEvent;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1074
    keyEvent.iCode = EEikCmdExit;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1075
    keyEvent.iScanCode = EEikCmdExit;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1076
    keyEvent.iModifiers = 0;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1077
    keyEvent.iRepeats = 0;
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1078
    wsSession.SimulateKeyEvent( keyEvent );
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1079
    wsSession.Flush();  
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1080
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
// CPhoneStateIdle::HandleEndKeyPressL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1085
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1089
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
    // End key not handled also in phone startup when pressed during country/time/date query
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1091
    RWsSession sess = CCoeEnv::Static()->WsSession();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1092
    TApaTaskList appList( sess );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1093
    TApaTask startup = appList.FindApp( KUidStartupApplication );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1094
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1095
    if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1096
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1097
        //Cancels e.g. USB notifier and Audio notifier.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1098
        iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1099
        iViewCommandHandle->ExecuteCommandL( EPhoneViewExitApplications );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1100
        // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1101
        // remove security note from screen.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
        if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1103
                !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1104
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1105
            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
            }
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1107
        // Handle end key if all startup related queries and graphics have been displayed.
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1108
        if ( IsSimOk() && AllStartupQueriesDisplayed() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1110
            if ( aMessage == EPhoneKeyLongPress )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1111
                {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
                // Close all connections
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
                iStateMachine->SendPhoneEngineMessage(
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
                        MPEPhoneModel::EPEMessageTerminateAllConnections );   
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
                if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
                    {
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1118
                    CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
                    // If long end key event occures then all calls are terminated and
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
                    // dialer is closed, therefore tel.icon must be removed from FSW.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
                    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
                    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
                if ( !TopAppIsDisplayedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
                    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
                    DisplayIdleScreenL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
                    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
            else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
                {
81
c26cc2a7c548 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 69
diff changeset
  1130
                CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
            else if ( !TopAppIsDisplayedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
                {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
                // Phone might not be the topmost app since it has
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1135
                // some dialog/query open therefore we need to remove dialog/phone.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1136
                if ( !IsSimStateNotPresentWithSecurityModeEnabled() )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
                    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1138
                    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1139
                    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1140
                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
                iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1142
                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
                }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
        else if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
            // Remove number entry from screen
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
            iViewCommandHandle->ExecuteCommandL( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
                EPhoneViewRemoveNumberEntry );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
            StartShowSecurityNoteL();    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
// ---------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
// CPhoneStateIdle::OnlyHashInNumberEntryL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
// ---------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) ");
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1162
    if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1163
        KTelephonyLVFlagMannerMode ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1164
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1165
        ChangeMannerModeL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1166
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1167
    else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1168
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1169
        StartAlsLineChangeTimerL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1170
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1171
    // Check if any application launch functionality
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1172
    // is configured for pressing hash for a long time
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1173
    // the return value of CheckAppLaunchingL ignored.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1174
    CheckAppLaunchingL( TKeyCode( KPhoneDtmfHashCharacter ) );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
// ---------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
// CPhoneStateIdle::ChangeMannerModeL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
// ---------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
void CPhoneStateIdle::ChangeMannerModeL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
    {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1183
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1184
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1185
    // Get the profile information
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1186
    MProEngEngine* profileEngine = ProEngFactory::NewEngineLC();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1187
    const TInt profileId =
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1188
            profileEngine->ActiveProfileId();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1189
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1190
    TInt newProfile;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1191
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1192
    if ( profileId == EProfileSilentId )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1193
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1194
        newProfile = EProfileGeneralId;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1195
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1196
    else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1197
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1198
        newProfile = EProfileSilentId;    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1199
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1200
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1201
    profileEngine->SetActiveProfileL( newProfile );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1202
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1203
    CleanupStack::Pop(); // profileEngine 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1204
    profileEngine->Release();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1205
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1206
    // Stop playing DTMF tone
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1207
    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1208
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1209
    if ( !iOnScreenDialer )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1210
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1211
        // Remove the number entry
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1212
        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1213
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1214
    else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1215
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1216
        NumberEntryClearL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1217
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1218
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1219
    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1220
 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1221
     // Bring Idle app to the top app
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1222
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );            
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1223
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1224
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
// CPhoneStateIdle::DialMultimediaCallL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() ");
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
        Panic( EPhoneCtrlInvariant ) );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
    if ( RestoreOngoing() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
        CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
    else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
        CPhoneState::DialMultimediaCallL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1242
        }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
// CPhoneStateIdle::DialVoiceCallL
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
EXPORT_C void CPhoneStateIdle::DialVoiceCallL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() ");
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1252
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
    CPhoneState::DialVoiceCallL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1256
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
// CPhoneStateIdle::RestoreOngoing
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
// -----------------------------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
//
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1260
TBool CPhoneStateIdle::RestoreOngoing()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
    TInt restoreValue;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
    RProperty::Get( KUidSystemCategory, 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
                    conn::KUidBackupRestoreKey,
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1266
                    restoreValue );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1267
        
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1268
    return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ));
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1269
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1271
// -----------------------------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1272
// CPhoneStateIdle::CheckAppLaunchingL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1273
// -----------------------------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1274
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1275
TBool CPhoneStateIdle::CheckAppLaunchingL( const TKeyCode aCode )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1276
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1277
    TBool valuesFetched( EFalse );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1278
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1279
    if( !IsSimOk() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1280
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1281
        return valuesFetched;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1282
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1283
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1284
    TPhoneCmdParamAppInfo appInfo;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1285
    HBufC8* appParam = HBufC8::NewL( KMaxParamLength );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1286
    CleanupStack::PushL( appParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1287
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1288
    TBool isValidAppLaunchingKeyEvent = ETrue;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1289
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1290
    // By-pass checking of number entry length in case of #-character.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1291
    // #-character is handled differently from other keys, and number 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1292
    // entry length has been checked earlier. Checking number entry length
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1293
    // for #-character is difficult here, because we cannot know if FEP
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1294
    // has removed the long-# from number entry or not.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1295
    if ( TKeyCode( KPhoneDtmfHashCharacter ) != aCode )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1296
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1297
        TPhoneCmdParamInteger numberEntryCount;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1298
        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1299
            &numberEntryCount );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1300
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1301
        isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 1 );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1302
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1303
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1304
    if ( isValidAppLaunchingKeyEvent )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1305
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1306
        TRAPD( err, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1307
            CPhoneCenRepProxy::Instance()->FetchValuesFromCenRepL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1308
            appInfo, aCode, appParam, valuesFetched ) );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1309
        
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1310
        if ( KErrNone == err && valuesFetched )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1311
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1312
            // Remove the number entry window
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1313
            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1314
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1315
            // Stop playing DTMF tone
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1316
            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1317
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1318
            TPhoneCommandParam* phoneCommandParam = 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1319
                static_cast<TPhoneCommandParam*>( &appInfo );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1320
            iViewCommandHandle->ExecuteCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1321
                        EPhoneViewActivateAppViewConventional,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1322
                        phoneCommandParam ); 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1323
            
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1324
            // Continue displaying current app but set up the 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1325
            // idle screen in the background
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1326
            SetupIdleScreenInBackgroundL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1327
            }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1328
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1329
    CleanupStack::PopAndDestroy( appParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1330
    return valuesFetched;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1331
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1332
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1333
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1334
// CPhoneStateIdle::NumberForSpeedDialLocationL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1335
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1336
// 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1337
HBufC* CPhoneStateIdle::NumberForSpeedDialLocationL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1338
        const TUint& aDigit,
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1339
        TPhoneCmdParamSpeedDial& aSpeedDialParam ) const
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1340
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1341
    // Set the speed dial location from the digit in buffer. Character
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1342
    // '1' means location 1, and so on.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1343
    const TInt location = aDigit - KPhoneDtmf1Character + 1;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1344
    aSpeedDialParam.SetLocation( location );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1345
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1346
    // Get the number and type from the speed dial location.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1347
    HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1348
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1349
    TPtr ptr( phoneNumber->Des() );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1350
    aSpeedDialParam.SetPhoneNumber( &ptr );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1351
    iViewCommandHandle->HandleCommandL( 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1352
        EPhoneViewGetNumberFromSpeedDialLocation, &aSpeedDialParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1353
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1354
    CleanupStack::Pop( phoneNumber );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1355
    return phoneNumber;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1356
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1357
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
// CPhoneStateIdle::HandleVoiceCallCommandL()
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
// -----------------------------------------------------------
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
//
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1362
void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey )
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
    {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
    __LOGMETHODSTARTEND(
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
        EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
    if ( IsNumberEntryUsedL() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
        {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
        // Handle send key short press, get the number entry contents.
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
        HBufC* phoneNumber = PhoneNumberFromEntryLC();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
        
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
        if ( !IsSimOk() )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
            iStateMachine->SendPhoneEngineMessage( 
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
            CleanupStack::PopAndDestroy( phoneNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
            return;
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
            
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
#ifdef _DEBUG
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
        if ( (*phoneNumber).Compare( KExit ) == 0 )
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
            {
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
            CleanupStack::PopAndDestroy( phoneNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
            SendExitCommandL();
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
        else
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
#endif // _DEBUG
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
            {
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1390
            if ( IsDialingExtensionInFocusL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1391
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1392
                CPhoneState::HandleCommandL( EEasyDialingVoiceCall );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1393
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1394
            
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1395
            else if ( IsSpeedDialNumber( *phoneNumber ) )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1396
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1397
                // Handle speed dial
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1398
                SpeedDialL( (*phoneNumber)[0], aSendKey ? EDialMethodSendCommand : EDialMethodMenuSelection );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1399
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1400
            else
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1401
                {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1402
                // call the number
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1403
                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1404
                DialVoiceCallL();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1405
                }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1406
            
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
            CleanupStack::PopAndDestroy( phoneNumber );
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
            }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
        }    
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
    }
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
62
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1412
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1413
// CPhoneStateIdle::GetNumberAcqMenuIdL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1414
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1415
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1416
TInt CPhoneStateIdle::GetNumberAcqMenuIdL()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1417
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1418
    TInt menuId = CPhoneMainResourceResolver::Instance()->
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1419
            ResolveResourceID( EPhoneNumberAcqMenubar );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1420
    
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1421
    // Use easy dialing menu id, if easydialing is in focus.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1422
    // Otherwise use number acquisition menu id.
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1423
    if ( IsDialingExtensionInFocusL() )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1424
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1425
        // Fetch easydialing menu id, check its validity and assign to menuId
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1426
        TPhoneCmdParamInteger integerParam;  
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1427
        iViewCommandHandle->ExecuteCommandL(
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1428
                EPhoneViewGetEasyDialingMenuId, &integerParam );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1429
        if ( integerParam.Integer() ) 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1430
            {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1431
            menuId = integerParam.Integer();
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1432
            }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1433
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1434
    return menuId;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1435
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1436
	
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1437
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1438
// CPhoneStateIdle::HandleErrorL
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1439
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1440
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1441
EXPORT_C void CPhoneStateIdle::HandleErrorL( const TPEErrorInfo& aErrorInfo )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1442
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1443
    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateIdle::HandleErrorL() ");
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1444
    if( KErrNotFound < aErrorInfo.iCallId )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1445
        {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1446
        SetCallInitialized( EFalse );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1447
        }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1448
    CPhoneState::HandleErrorL( aErrorInfo );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1449
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1450
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1451
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1452
// CPhoneStateIdle::ChangeTo
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1453
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1454
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1455
void CPhoneStateIdle::ChangeTo( TInt aState )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1456
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1457
    __PHONELOG1( EBasic, EPhoneControl, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1458
           "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ",
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1459
           aState );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1460
    SetCallInitialized( EFalse );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1461
    iStateMachine->ChangeState( aState );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1462
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1463
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1464
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1465
// CPhoneStateIdle::SetBubbleInitialized
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1466
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1467
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1468
void CPhoneStateIdle::SetCallInitialized( TBool aValue )
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1469
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1470
    __PHONELOG1( EBasic, EPhoneControl, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1471
            "PhoneUIControl: CPhoneStateIdle::SetCallInitialized - iCallInitialized =%d ",
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1472
            aValue );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1473
    iCallInitialized = aValue;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1474
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1475
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1476
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1477
// CPhoneStateIdle::IsBubbleInitialized
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1478
// -----------------------------------------------------------
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1479
//
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1480
TBool CPhoneStateIdle::IsCallInitialized()
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1481
    {
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1482
    __PHONELOG1( EBasic, EPhoneControl, 
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1483
            "PhoneUIControl: CPhoneStateIdle::IsCallInitialized - iCallInitialized =%d ",
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1484
            iCallInitialized );
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1485
    return iCallInitialized;
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1486
    }
5266b1f337bd Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 61
diff changeset
  1487
0
5f000ab63145 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
// End of File