phoneapp/phoneuistates/src/cphonesingleandalerting.cpp
author hgs
Fri, 09 Jul 2010 15:40:55 +0300
changeset 50 377c906a8701
parent 46 bc5a64e5bc3c
child 65 2a5d4ab426d3
permissions -rw-r--r--
201027
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-2008 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 CPhoneSingleAndAlerting 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 <pevirtualengine.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <cpephonemodelif.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include "cphonesingleandalerting.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include "tphonecmdparamboolean.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include "mphonestatemachine.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include "tphonecmdparamboolean.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include "tphonecmdparaminteger.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include "tphonecmdparamcallheaderdata.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include "tphonecmdparamglobalnote.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include "tphonecmdparamcallstatedata.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include "phoneviewcommanddefinitions.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include "phoneui.hrh"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include "cphonemainresourceresolver.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include "phonerssbase.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include "phonestatedefinitionsgsm.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include "phonelogger.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
// ================= MEMBER FUNCTIONS =======================
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
// C++ default constructor can NOT contain any code, that
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
// might leave.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
CPhoneSingleAndAlerting::CPhoneSingleAndAlerting( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
    MPhoneStateMachine* aStateMachine, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    MPhoneViewCommandHandle* aViewCommandHandle,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
    MPhoneCustomization* aPhoneCustomization ) : 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
    CPhoneAlerting( aStateMachine, aViewCommandHandle, aPhoneCustomization )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
    {
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
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
// CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
// Destructor
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
    {
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
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
// CPhoneSingleAndAlerting::ConstructL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// Constructor
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
void CPhoneSingleAndAlerting::ConstructL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    CPhoneAlerting::ConstructL();
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
// CPhoneSingleAndAlerting::NewL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
// Constructor
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
// (other items were commented in a header).
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
CPhoneSingleAndAlerting* CPhoneSingleAndAlerting::NewL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
    MPhoneStateMachine* aStateMachine, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
    MPhoneViewCommandHandle* aViewCommandHandle,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
    MPhoneCustomization* aPhoneCustomization )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
    CPhoneSingleAndAlerting* self = new( ELeave ) CPhoneSingleAndAlerting( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
        aStateMachine, aViewCommandHandle, aPhoneCustomization );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    CleanupStack::PushL( self );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
    self->ConstructL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    CleanupStack::Pop( self );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    return self;
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
// CPhoneSingleAndAlerting::HandlePhoneEngineMessageL
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
void CPhoneSingleAndAlerting::HandlePhoneEngineMessageL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
    const TInt aMessage, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
    TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    __LOGMETHODSTARTEND( EPhoneUIStates, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
        "CPhoneSingleAndAlerting::HandlePhoneEngineMessageL()");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    switch ( aMessage )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
        case MEngineMonitor::EPEMessageConnected:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
            HandleConnectedL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
            break;
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
        case MEngineMonitor::EPEMessageIdle:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
            HandleIdleL( aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
            break;
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
        default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
            CPhoneAlerting::HandlePhoneEngineMessageL( aMessage, aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
        }
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
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
// --------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
// CPhoneSingleAndAlerting::HandleKeyMessageL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
// --------------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
void CPhoneSingleAndAlerting::HandleKeyMessageL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    TPhoneKeyEventMessages aMessage,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    TKeyCode aCode )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
    __LOGMETHODSTARTEND( EPhoneUIStates, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
        "CPhoneSingleAndAlerting::HandleKeyMessageL()");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    switch ( aCode )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
        // send-key
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
        case EKeyYes:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
            if ( CPhoneState::IsNumberEntryUsedL() )
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
                // send a manual control sequence
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
                CPhoneState::CallFromNumberEntryL();    
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
            else
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
                // Show not allowed note
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
                CPhoneState::SendGlobalErrorNoteL( 
46
bc5a64e5bc3c Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   141
                    EPhoneNoteTextNotAllowed, ETrue );
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
            break;
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
        // end-key
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
        case EKeyNo:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
            if ( aMessage == EPhoneKeyLongPress )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
                iStateMachine->SendPhoneEngineMessage(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
                    CPEPhoneModelIF::EPEMessageTerminateAllConnections );        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
                }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
            else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
                DisconnectOutgoingCallL();               
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
            if ( CPhoneState::IsNumberEntryUsedL() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
                {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
                // Remove number entry from screen
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
                iViewCommandHandle->ExecuteCommandL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
                      EPhoneViewRemoveNumberEntry );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
                // Do state-specific operation when number entry is cleared
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
                HandleNumberEntryClearedL();
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
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
        default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
            // do base operation
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
            CPhoneAlerting::HandleKeyMessageL( aMessage, aCode );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    }
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
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
// CPhoneSingleAndAlerting::HandleConnectedL
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
void CPhoneSingleAndAlerting::HandleConnectedL( TInt aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
    __LOGMETHODSTARTEND( EPhoneUIStates, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
        "CPhoneSingleAndAlerting::HandleConnectedL()");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
    // Find the alerting call
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
    TPhoneCmdParamCallStateData callStateData;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
    callStateData.SetCallState( EPEStateConnecting );                    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
    iViewCommandHandle->HandleCommandL(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
        EPhoneViewGetCallIdByState, &callStateData );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
    if( callStateData.CallId() == aCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
        {    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
        // Keep Phone in the foreground
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
        TPhoneCmdParamBoolean booleanParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
        booleanParam.SetBoolean( EFalse );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
        iViewCommandHandle->ExecuteCommandL( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
            EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
        CPhoneState::BeginUiUpdateLC();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
        // Show bubble
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
        TPhoneCmdParamCallHeaderData callHeaderParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
        callHeaderParam.SetCallState( EPEStateConnected );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
            &callHeaderParam );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
        CPhoneState::SetTouchPaneButtons( EPhoneTwoSinglesButtons );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
        CPhoneState::EndUiUpdate();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
              
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
        // Set Hold flag to view
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
        TPhoneCmdParamBoolean holdFlag;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
        holdFlag.SetBoolean( EFalse );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );  
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
        
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
        // Set Two singles softkeys
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
        // Go to two singles state
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
        iStateMachine->ChangeState( EPhoneStateTwoSingles );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
    else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
        // Show bubble
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
        TPhoneCmdParamCallHeaderData callHeaderParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
        callHeaderParam.SetCallState( EPEStateConnected );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
            &callHeaderParam );  
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
        TPhoneCmdParamBoolean holdFlag;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
        holdFlag.SetBoolean( EFalse );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   231
        }    
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
// CPhoneSingleAndAlerting::HandleIdleL
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
void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId )
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
    __LOGMETHODSTARTEND( EPhoneUIStates, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
        "CPhoneSingleAndAlerting::HandleIdleL()");
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
    BeginUiUpdateLC();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    // Remove call 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    if ( !TopAppIsDisplayedL() )
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
        // Continue displaying current app but set up the 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
        // idle screen in the background
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
        SetupIdleScreenInBackgroundL();
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
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
    TPhoneCmdParamInteger countParam;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam);
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
    if ( countParam.Integer() )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
        SetTouchPaneButtons( EPhoneIncallButtons );    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
        // Set Hold flag to view
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
        TPhoneCmdParamBoolean holdFlag;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
        holdFlag.SetBoolean( ETrue );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
        UpdateCbaL( EPhoneCallHandlingInCallCBA );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
        iStateMachine->ChangeState( EPhoneStateSingle );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
    else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
        // Display call termination note, if necessary
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
        DisplayCallTerminationNoteL();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
        SetTouchPaneButtons( EPhoneCallSetupButtons );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
        UpdateCbaL( EPhoneCallHandlingInCallCBA );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
        iStateMachine->ChangeState( EPhoneStateAlerting );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
    EndUiUpdate();
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
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
// -----------------------------------------------------------
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
// CPhoneSingleAndAlerting::UpdateInCallCbaL
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
//
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
void CPhoneSingleAndAlerting::UpdateInCallCbaL()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneSingleAndAlerting::UpdateInCallCbaL() ");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
    UpdateCbaL( EPhoneCallHandlingInCallCBA );
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
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
// End of File