phoneapp/phoneuicontrol/src/cphonestateidle.cpp
author hgs
Fri, 15 Oct 2010 12:58:46 +0300
changeset 78 baacf668fe89
parent 76 cfea66083b62
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description: Implementation of CPhoneStateIdle class.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
// INCLUDES
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <eikenv.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <e32property.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <connect/sbdefs.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <w32std.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <StringLoader.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <apgcli.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <telephonyvariant.hrh>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <featmgr.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <settingsinternalcrkeys.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <mpeengineinfo.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <mpeclientinformation.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <bldvariant.hrh>
78
hgs
parents: 76
diff changeset
    33
#include <apaid.h>
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include "cphonepubsubproxy.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include "cphonecenrepproxy.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include "cphonestateidle.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include "tphonecmdparaminteger.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "tphonecmdparamboolean.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "tphonecmdparamglobalnote.h"
46
bc5a64e5bc3c Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
    41
#include "tphonecmdparamkeycapture.h"
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include "tphonecmdparamstring.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include "tphonecmdparamboolean.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include "mphonestatemachine.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include "phonestatedefinitions.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include "tphonecmdparamappinfo.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include "cphonekeys.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include "phoneviewcommanddefinitions.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#include "phoneui.hrh"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include "phonerssbase.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include "cphonemainresourceresolver.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include "phonelogger.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include "phoneui.pan"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include "mphonecustomization.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
78
hgs
parents: 76
diff changeset
    57
const TUid KNetworkHandlingStarterUid = { 0x2002E67A };
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
// ================= MEMBER FUNCTIONS =======================
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
// C++ default constructor can NOT contain any code, that
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// might leave.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
EXPORT_C CPhoneStateIdle::CPhoneStateIdle( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
    MPhoneStateMachine* aStateMachine, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
    MPhoneViewCommandHandle* aViewCommandHandle,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
    MPhoneCustomization* aCustomization ) : 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    CPhoneState( aStateMachine, aViewCommandHandle, aCustomization )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
// Destructor
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
EXPORT_C CPhoneStateIdle::~CPhoneStateIdle()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
    {
78
hgs
parents: 76
diff changeset
    75
    __LOGMETHODSTARTEND(
hgs
parents: 76
diff changeset
    76
        EPhoneControl, "CPhoneStateIdle::~CPhoneStateIdle()" );
hgs
parents: 76
diff changeset
    77
    CloseQtProcess(KNetworkHandlingStarterUid);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
// CPhoneStateIdle::ConstructL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
EXPORT_C void CPhoneStateIdle::ConstructL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    CPhoneState::BaseConstructL();
78
hgs
parents: 76
diff changeset
    88
hgs
parents: 76
diff changeset
    89
    LaunchQtProcessL(KNetworkHandlingStarterUid);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
// CPhoneStateIdle::NewL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
CPhoneStateIdle* CPhoneStateIdle::NewL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
    MPhoneStateMachine* aStateMachine, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
    MPhoneViewCommandHandle* aViewCommandHandle,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    MPhoneCustomization* aPhoneCustomization )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
        aStateMachine, aViewCommandHandle, aPhoneCustomization );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
    CleanupStack::PushL( self );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    self->ConstructL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    CleanupStack::Pop( self );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
    return self;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
// CPhoneStateIdle::HandleKeyEventL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
EXPORT_C void CPhoneStateIdle::HandleKeyEventL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    const TKeyEvent& aKeyEvent, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    TEventCode aEventCode )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) ");
65
hgs
parents: 50
diff changeset
   118
    TPhoneCmdParamBoolean isSecurityMode;
hgs
parents: 50
diff changeset
   119
    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
hgs
parents: 50
diff changeset
   120
    if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( 
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
        aKeyEvent, aEventCode ) )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    else if ( aEventCode == EEventKeyUp )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
        // Provide up event to engine. 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
        // Otherwise DTMF tone keeps playing.    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
           iStateMachine->SendPhoneEngineMessage( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
                MPEPhoneModel::EPEMessageEndDTMF );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
         __PHONELOG( EBasic, EPhoneControl,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
                "PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
// CPhoneStateIdle::HandleNumberEntryClearedL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
    if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
        //  if still idle ( f.e not incoming call arrived when rfs )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
        if ( iStateMachine->State() == this )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
            {
74
hgs
parents: 65
diff changeset
   148
            RemoveDialogsAndSendPhoneToBackgroundL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
   else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
        StartShowSecurityNoteL(); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
// CPhoneStateIdle::HandleKeyMessageL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    TPhoneKeyEventMessages aMessage,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    TKeyCode aCode )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
    switch ( aCode )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
        case EKeyEnd:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
            // This key even occur only in idle state, behaviour for this should
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
            // be same as long end-key press. (Bug in window server)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
            HandleEndKeyPressL( EPhoneKeyLongPress );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
        // end-key
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
        case EKeyNo:
65
hgs
parents: 50
diff changeset
   176
            HandleEndKeyPressL( aMessage );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
        // send-key
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
        case EKeyYes:
74
hgs
parents: 65
diff changeset
   180
            if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
                {
65
hgs
parents: 50
diff changeset
   182
                TPhoneCmdParamBoolean isSecurityMode;
hgs
parents: 50
diff changeset
   183
                iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
hgs
parents: 50
diff changeset
   184
                
hgs
parents: 50
diff changeset
   185
                TPhoneCmdParamInteger numberEntryCountParam;
hgs
parents: 50
diff changeset
   186
                iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
hgs
parents: 50
diff changeset
   187
                &numberEntryCountParam );
hgs
parents: 50
diff changeset
   188
                
hgs
parents: 50
diff changeset
   189
                TInt neLength( numberEntryCountParam.Integer() );
74
hgs
parents: 65
diff changeset
   190
                if ( neLength == 0 && !isSecurityMode.Boolean())
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
                    {
65
hgs
parents: 50
diff changeset
   192
                    // start logs
hgs
parents: 50
diff changeset
   193
                    iViewCommandHandle->HandleCommandL( 
hgs
parents: 50
diff changeset
   194
                    EPhoneDialerCmdLog );
hgs
parents: 50
diff changeset
   195
                    return;
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
                    }
65
hgs
parents: 50
diff changeset
   197
                HandleSendCommandL();
hgs
parents: 50
diff changeset
   198
                }
hgs
parents: 50
diff changeset
   199
            // If dialer is not open but phone is in foreground and phone receives
hgs
parents: 50
diff changeset
   200
            // send-key event we have to check if security mode is true and if it
hgs
parents: 50
diff changeset
   201
            // is then open emergency dialer.
74
hgs
parents: 65
diff changeset
   202
            else
65
hgs
parents: 50
diff changeset
   203
                {
hgs
parents: 50
diff changeset
   204
                TPhoneCmdParamBoolean isSecurityMode;
hgs
parents: 50
diff changeset
   205
                iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
hgs
parents: 50
diff changeset
   206
                if ( isSecurityMode.Boolean())
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
                    {
65
hgs
parents: 50
diff changeset
   208
                    // launch dialer.
hgs
parents: 50
diff changeset
   209
                    HandleCommandL(EPhoneNumberAcqSecurityDialer);
hgs
parents: 50
diff changeset
   210
                    }
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
        case EKeyApplication0:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
            // If dialer is not open but phone is in foreground and phone receives
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
            // applicaion-key event we have to open emergency dialer. No need own
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
            // securitymode check because Applicationkey only captured in securitymode.
74
hgs
parents: 65
diff changeset
   219
            if ( !iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
                HandleCommandL(EPhoneNumberAcqSecurityDialer);
65
hgs
parents: 50
diff changeset
   222
                }
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
            break;
65
hgs
parents: 50
diff changeset
   225
#ifdef RD_INTELLIGENT_TEXT_INPUT
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
        case EKeyEnter:
74
hgs
parents: 65
diff changeset
   227
            if ( iNumberEntryManager->IsNumberEntryVisibleL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
                HandleCommandL( EPhoneCmdOptions );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
#endif
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
        default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
// CPhoneStateIdle::HandlePhoneEngineMessageL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
    const TInt aMessage, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    switch ( aMessage )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
        case MEngineMonitor::EPEMessageIncoming:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
            HandleIncomingL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
        case MEngineMonitor::EPEMessageDialing:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
            HandleDialingL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        case MEngineMonitor::EPEMessageConnected:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
            HandleConnectedL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
        case MEngineMonitor::EPEMessageIssuedUSSDRequest:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
            // Note that after the sending of SS 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
            // strings the view stays in Dialer.
74
hgs
parents: 65
diff changeset
   264
            if ( !iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue ) )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
                {
74
hgs
parents: 65
diff changeset
   266
                RemoveDialogsAndSendPhoneToBackgroundL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
        case MEngineMonitor::EPEMessageIdle:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
            HandleIdleL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
            
65
hgs
parents: 50
diff changeset
   274
        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
hgs
parents: 50
diff changeset
   275
            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
        case MEngineMonitor::EPEMessageValidEmergencyNumber:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
            DialVoiceCallL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
            break; 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
                        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
        default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
// CPhoneStateIdle::HandleIncomingL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
// Default handling for incoming message
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
    HandleAudioAvailableOutputChangedL();
78
hgs
parents: 76
diff changeset
   298
    
hgs
parents: 76
diff changeset
   299
    TPhoneCmdParamBoolean ringingParam;
hgs
parents: 76
diff changeset
   300
    ringingParam.SetBoolean( ETrue );        
hgs
parents: 76
diff changeset
   301
    iViewCommandHandle->ExecuteCommand(
hgs
parents: 76
diff changeset
   302
            EPhoneViewSetRingingFlag,&ringingParam);
74
hgs
parents: 65
diff changeset
   303
    
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
    BeginUiUpdateLC();
74
hgs
parents: 65
diff changeset
   305
    iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
    DisplayIncomingCallL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
    SetBackButtonActive(EFalse);
74
hgs
parents: 65
diff changeset
   308
    UpdateUiCommands();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
    EndUiUpdate();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
    
78
hgs
parents: 76
diff changeset
   311
	SetRingingTonePlaybackL( aCallId );
hgs
parents: 76
diff changeset
   312
	
74
hgs
parents: 65
diff changeset
   313
    ChangeTo( EPhoneStateIncoming );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
// -----------------------------------------------------------
74
hgs
parents: 65
diff changeset
   317
// CPhoneStateIdle::HandleDialingL
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
// Default handling for dialling message
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
    {
74
hgs
parents: 65
diff changeset
   324
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) ");   
hgs
parents: 65
diff changeset
   325
    TPhoneCmdParamKeyCapture captureParam;
hgs
parents: 65
diff changeset
   326
    captureParam.SetKeyCode( EKeyNo );
hgs
parents: 65
diff changeset
   327
    iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
hgs
parents: 65
diff changeset
   328
    DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse );
hgs
parents: 65
diff changeset
   329
    SetToolbarButtonLoudspeakerEnabled();
hgs
parents: 65
diff changeset
   330
    ChangeTo( EPhoneStateCallSetup );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
// CPhoneStateIdle::HandleConnectedL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
// Message Handling function for message EPEMessageConnected
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
// This could happen during transaction from Emergency mode
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
// to Normal mode where a network status change is received
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
// from PE after PE initiates an MO call. Since PE messages
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
// are asynchronous, this sequence can occur in any order.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
void CPhoneStateIdle::HandleConnectedL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
    BeginUiUpdateLC();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
74
hgs
parents: 65
diff changeset
   348
    DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
    UpdateSingleActiveCallL( aCallId );
74
hgs
parents: 65
diff changeset
   350
    UpdateUiCommands();
65
hgs
parents: 50
diff changeset
   351
    EndUiUpdate();
74
hgs
parents: 65
diff changeset
   352
    ChangeTo( EPhoneStateSingle );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
// CPhoneStateIdle::HandleCommandL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
    TBool commandStatus = ETrue;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
    switch( aCommand )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
        case EPhoneCmdOptions:
65
hgs
parents: 50
diff changeset
   366
        case EPhoneCmdBack:
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
        case EPhoneNumberAcqCmdCall:
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   370
            HandleVoiceCallCommandL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
            break;
65
hgs
parents: 50
diff changeset
   372
            
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
        case EPhoneNumberAcqCmdSendCommand:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
            HandleSendCommandL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
        case EPhoneNumberAcqCmdVideoCall:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
            DialVideoCallL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
        default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
            commandStatus = CPhoneState::HandleCommandL( aCommand );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
    return commandStatus;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
// CPhoneStateIdle::ProcessCommandL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
    TBool commandStatus = EFalse;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
    switch( aCommand )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
       {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
       case EAknSoftkeyContextOptions:
65
hgs
parents: 50
diff changeset
   399
           break;
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
           
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
       default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
           commandStatus = CPhoneState::ProcessCommandL( aCommand );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
           break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
       }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
    return commandStatus;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
// CPhoneStateIdle::HandleRemConCommandL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
    TRemConCoreApiOperationId /*aOperationId */, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
    TRemConCoreApiButtonAction /*aButtonAct*/ )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
    return EFalse;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
// CPhoneStateIdle::DialL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
EXPORT_C void CPhoneStateIdle::DialL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
        const TDesC& aNumber, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
        TPhoneNumberType aNumberType,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
        TDialInitiationMethod /*aDialMethod*/ )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
    if ( aNumberType == EPhoneNumberTypeVideo &&
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
        FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
        DialMultimediaCallL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
    else if ( EPhoneNumberTypeVoip == aNumberType &&
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
              iCustomization )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
        iCustomization->HandleDialL( aNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
    else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
        {
65
hgs
parents: 50
diff changeset
   441
        DialVoiceCallL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
// CPhoneStateIdle::DialVideoCallL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
void CPhoneStateIdle::DialVideoCallL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) ");
74
hgs
parents: 65
diff changeset
   452
    if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
        // get the number entry contents
74
hgs
parents: 65
diff changeset
   455
        HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
#ifdef _DEBUG
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
        if ( (*phoneNumber).Compare( KExit ) == 0 )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
            CleanupStack::PopAndDestroy( phoneNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
            SendExitCommandL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
        else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
#endif // _DEBUG
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
            {
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   465
            // call the number
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   466
            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
78
hgs
parents: 76
diff changeset
   467
            DialMultimediaCall();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
            CleanupStack::PopAndDestroy( phoneNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
            }
65
hgs
parents: 50
diff changeset
   470
        }
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
// CPhoneStateIdle::DisplayIncomingCallL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
        Panic( EPhoneCtrlInvariant ) );
65
hgs
parents: 50
diff changeset
   482
    
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
46
bc5a64e5bc3c Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   484
    TPhoneCmdParamKeyCapture captureParam;
bc5a64e5bc3c Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   485
    captureParam.SetKeyCode( EKeyNo );
bc5a64e5bc3c Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   486
    iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
74
hgs
parents: 65
diff changeset
   487
    
hgs
parents: 65
diff changeset
   488
    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground );
hgs
parents: 65
diff changeset
   489
    
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
    // Disable global notes when there is an incoming call
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
    TPhoneCmdParamBoolean globalNotifierParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
    globalNotifierParam.SetBoolean( ETrue );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
        &globalNotifierParam );
74
hgs
parents: 65
diff changeset
   495
    iViewCommandHandle->ExecuteCommandL(EPhoneViewCreateCallHeader, aCallId);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
// CPhoneStateIdle::HandlePhoneFocusLostEventL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) ");
74
hgs
parents: 65
diff changeset
   505
    if ( !iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
         {
65
hgs
parents: 50
diff changeset
   507
         // If dialer is open add icon to FSW list.
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
         }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
// CPhoneStateIdle::HandleIdleL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
    {
65
hgs
parents: 50
diff changeset
   518
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
65
hgs
parents: 50
diff changeset
   520
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
hgs
parents: 50
diff changeset
   521
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
// CPhoneStateIdle::HandleSendCommandL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
EXPORT_C void CPhoneStateIdle::HandleSendCommandL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
    __LOGMETHODSTARTEND(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
        EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   532
    HandleVoiceCallCommandL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
// CPhoneStateIdle:SendExitCommandL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
void CPhoneStateIdle::SendExitCommandL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) ");
74
hgs
parents: 65
diff changeset
   542
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); 
hgs
parents: 65
diff changeset
   543
    // Simulate exit command 
hgs
parents: 65
diff changeset
   544
    RWsSession& wsSession = EikonEnv()->WsSession(); 
hgs
parents: 65
diff changeset
   545
    TKeyEvent keyEvent; 
hgs
parents: 65
diff changeset
   546
    keyEvent.iCode = EEikCmdExit; 
hgs
parents: 65
diff changeset
   547
    keyEvent.iScanCode = EEikCmdExit; 
hgs
parents: 65
diff changeset
   548
    keyEvent.iModifiers = 0; 
hgs
parents: 65
diff changeset
   549
    keyEvent.iRepeats = 0; 
hgs
parents: 65
diff changeset
   550
    wsSession.SimulateKeyEvent( keyEvent ); 
hgs
parents: 65
diff changeset
   551
    wsSession.Flush(); 
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
    iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
// CPhoneStateIdle::HandleEndKeyPressL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
    // End key not handled also in phone startup when pressed during country/time/date query
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
    RWsSession sess = CCoeEnv::Static()->WsSession();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
    TApaTaskList appList( sess );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
    TApaTask startup = appList.FindApp( KUidStartupApplication );
74
hgs
parents: 65
diff changeset
   567
    if ( !IsAutoLockOn() && !startup.Exists() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
        //Cancels e.g. USB notifier and Audio notifier.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
        iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
        // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
        // remove security note from screen.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
        if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
                !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
        if ( IsSimOk() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
            if ( aMessage == EPhoneKeyLongPress )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
                iStateMachine->SendPhoneEngineMessage(
65
hgs
parents: 50
diff changeset
   584
                        MPEPhoneModel::EPEMessageTerminateAllConnections );
74
hgs
parents: 65
diff changeset
   585
                if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
                    {
65
hgs
parents: 50
diff changeset
   587
                    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
                    // Do state-specific operation when number entry is cleared
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
                    HandleNumberEntryClearedL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
                    // If long end key event occures then all calls are terminated and
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
                    // dialer is closed, therefore tel.icon must be removed from FSW.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
                    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
                    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
                }
74
hgs
parents: 65
diff changeset
   595
            else if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
                {
65
hgs
parents: 50
diff changeset
   597
                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
                // Do state-specific operation when number entry is cleared
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
                HandleNumberEntryClearedL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
            }
74
hgs
parents: 65
diff changeset
   602
        else if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
            {
65
hgs
parents: 50
diff changeset
   604
            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
hgs
parents: 50
diff changeset
   605
            StartShowSecurityNoteL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
// CPhoneStateIdle::DialMultimediaCallL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() ");
65
hgs
parents: 50
diff changeset
   617
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
    if ( RestoreOngoing() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
        CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
    else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
        {
78
hgs
parents: 76
diff changeset
   624
        CPhoneState::DialMultimediaCall();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
// CPhoneStateIdle::DialVoiceCallL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
EXPORT_C void CPhoneStateIdle::DialVoiceCallL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() ");
65
hgs
parents: 50
diff changeset
   635
    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
    TPhoneCmdParamBoolean globalNotifierParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
    globalNotifierParam.SetBoolean( ETrue );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
        &globalNotifierParam );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
    CPhoneState::DialVoiceCallL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
// CPhoneStateIdle::RestoreOngoing
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
// -----------------------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
TBool CPhoneStateIdle::RestoreOngoing()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
    TInt restoreValue;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
    RProperty::Get( KUidSystemCategory, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
                    conn::KUidBackupRestoreKey,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
                    restoreValue );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
    return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
// CPhoneStateIdle::HandleVoiceCallCommandL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
//
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   660
void CPhoneStateIdle::HandleVoiceCallCommandL()
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
    __LOGMETHODSTARTEND(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
        EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" );
74
hgs
parents: 65
diff changeset
   664
    if ( iNumberEntryManager->IsNumberEntryUsedL() )
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
        {
74
hgs
parents: 65
diff changeset
   666
        HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
        if ( !IsSimOk() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
            iStateMachine->SendPhoneEngineMessage( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
            CleanupStack::PopAndDestroy( phoneNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
            return;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
#ifdef _DEBUG
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
        if ( (*phoneNumber).Compare( KExit ) == 0 )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
            {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
            CleanupStack::PopAndDestroy( phoneNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
            SendExitCommandL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
        else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
#endif // _DEBUG
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
            {
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   685
            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   686
            DialVoiceCallL();
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
            CleanupStack::PopAndDestroy( phoneNumber );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
        }    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
74
hgs
parents: 65
diff changeset
   692
// -----------------------------------------------------------
hgs
parents: 65
diff changeset
   693
// CPhoneStateIdle::ChangeTo
hgs
parents: 65
diff changeset
   694
// -----------------------------------------------------------
hgs
parents: 65
diff changeset
   695
//
hgs
parents: 65
diff changeset
   696
void CPhoneStateIdle::ChangeTo( TInt aState )
hgs
parents: 65
diff changeset
   697
    {
hgs
parents: 65
diff changeset
   698
    __PHONELOG1( EBasic, EPhoneControl, 
hgs
parents: 65
diff changeset
   699
           "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ",
hgs
parents: 65
diff changeset
   700
           aState );
hgs
parents: 65
diff changeset
   701
    iStateMachine->ChangeState( aState );
hgs
parents: 65
diff changeset
   702
    }
78
hgs
parents: 76
diff changeset
   703
    
hgs
parents: 76
diff changeset
   704
// -----------------------------------------------------------
hgs
parents: 76
diff changeset
   705
// CPhoneStateIdle::LaunchQtProcessL
hgs
parents: 76
diff changeset
   706
// -----------------------------------------------------------
hgs
parents: 76
diff changeset
   707
//
hgs
parents: 76
diff changeset
   708
void CPhoneStateIdle::LaunchQtProcessL(TUid aUid)
hgs
parents: 76
diff changeset
   709
    {
hgs
parents: 76
diff changeset
   710
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchQtProcessL()" );
hgs
parents: 76
diff changeset
   711
    TApaAppInfo appInfo;
hgs
parents: 76
diff changeset
   712
    RApaLsSession lsSession;
hgs
parents: 76
diff changeset
   713
    User::LeaveIfError( lsSession.Connect() );
hgs
parents: 76
diff changeset
   714
    CleanupClosePushL( lsSession );
hgs
parents: 76
diff changeset
   715
    User::LeaveIfError( lsSession.GetAppInfo( appInfo, aUid ) );
hgs
parents: 76
diff changeset
   716
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
hgs
parents: 76
diff changeset
   717
    cmdLine->SetExecutableNameL( appInfo.iFullName );
hgs
parents: 76
diff changeset
   718
    cmdLine->SetCommandL( EApaCommandRun );
hgs
parents: 76
diff changeset
   719
    User::LeaveIfError( lsSession.StartApp( *cmdLine ) );
hgs
parents: 76
diff changeset
   720
    CleanupStack::PopAndDestroy( 2 );
hgs
parents: 76
diff changeset
   721
    }
74
hgs
parents: 65
diff changeset
   722
78
hgs
parents: 76
diff changeset
   723
// -----------------------------------------------------------
hgs
parents: 76
diff changeset
   724
// CPhoneStateIdle::CloseQtProcess
hgs
parents: 76
diff changeset
   725
// -----------------------------------------------------------
hgs
parents: 76
diff changeset
   726
//
hgs
parents: 76
diff changeset
   727
void CPhoneStateIdle::CloseQtProcess(TUid aUid)
hgs
parents: 76
diff changeset
   728
    {
hgs
parents: 76
diff changeset
   729
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::CloseQtProcess()" );
hgs
parents: 76
diff changeset
   730
    TApaTaskList appList( iEnv->WsSession() );
hgs
parents: 76
diff changeset
   731
    TApaTask task = appList.FindApp( aUid );
hgs
parents: 76
diff changeset
   732
    if ( task.Exists() )
hgs
parents: 76
diff changeset
   733
        {
hgs
parents: 76
diff changeset
   734
        task.KillTask();
hgs
parents: 76
diff changeset
   735
        }
hgs
parents: 76
diff changeset
   736
    }
hgs
parents: 76
diff changeset
   737
    
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
// End of File