cellular/psetnotesui/src/psuiwaitingobs.cpp
author hgs
Wed, 21 Jul 2010 18:26:52 +0300
changeset 33 8d5d7fcf9b59
permissions -rw-r--r--
201027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Handles requests for showing Call Waiting notes.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
// INCLUDE FILES
hgs
parents:
diff changeset
    20
#include <psui.rsg> 
hgs
parents:
diff changeset
    21
#include <psuicontainer.h> 
hgs
parents:
diff changeset
    22
#include <etelsat.h>
hgs
parents:
diff changeset
    23
 
hgs
parents:
diff changeset
    24
#include "psuiinternalconstants.h" 
hgs
parents:
diff changeset
    25
#include "psuinotecontroller.h" 
hgs
parents:
diff changeset
    26
#include "psuivariationproxy.h" 
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
//  MEMBER FUNCTIONS
hgs
parents:
diff changeset
    29
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    30
// Symbian OS two-phased Constructor.
hgs
parents:
diff changeset
    31
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    32
EXPORT_C CPsuiWaitingObs* CPsuiWaitingObs::NewL( CPsuiContainer& aContainer )
hgs
parents:
diff changeset
    33
    {
hgs
parents:
diff changeset
    34
    CPsuiWaitingObs* self = new( ELeave ) CPsuiWaitingObs;
hgs
parents:
diff changeset
    35
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    36
    self->ConstructL( aContainer );
hgs
parents:
diff changeset
    37
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    38
    return self;
hgs
parents:
diff changeset
    39
    }
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    42
// Symbian OS 2nd phase Constructor.
hgs
parents:
diff changeset
    43
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    44
void CPsuiWaitingObs::ConstructL( CPsuiContainer& aContainer )
hgs
parents:
diff changeset
    45
    {
hgs
parents:
diff changeset
    46
    iContainer = &aContainer;
hgs
parents:
diff changeset
    47
  
hgs
parents:
diff changeset
    48
    CPSuiVariationProxy* variationProxy = CPSuiVariationProxy::NewL();
hgs
parents:
diff changeset
    49
    CleanupStack::PushL( variationProxy );
hgs
parents:
diff changeset
    50
    iCallWaitingDistinguishEnabled = variationProxy->FeatureEnabled( KCallWaitingDistiquishNotProvisioned);
hgs
parents:
diff changeset
    51
    CleanupStack::PopAndDestroy( variationProxy );
hgs
parents:
diff changeset
    52
    
hgs
parents:
diff changeset
    53
    }
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    56
// Handles changing of call waiting.
hgs
parents:
diff changeset
    57
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    58
void CPsuiWaitingObs::HandleCallWaitingChangedL
hgs
parents:
diff changeset
    59
( const MPsetCallWaiting::TSetCallWaiting aSetting, const TInt /* aResult */ )
hgs
parents:
diff changeset
    60
    {
hgs
parents:
diff changeset
    61
    if ( aSetting == MPsetCallWaiting::EActivateCallWaiting )
hgs
parents:
diff changeset
    62
        {
hgs
parents:
diff changeset
    63
        CPsuiNoteController::InstanceL()->ShowNoteL( 
hgs
parents:
diff changeset
    64
            EPsuiConfirmationNote, R_CW_ACTIVE_NOTE );
hgs
parents:
diff changeset
    65
        }
hgs
parents:
diff changeset
    66
    else if ( aSetting == MPsetCallWaiting::EDeactivateCallWaiting )
hgs
parents:
diff changeset
    67
        {
hgs
parents:
diff changeset
    68
        CPsuiNoteController::InstanceL()->ShowNoteL( 
hgs
parents:
diff changeset
    69
            EPsuiConfirmationNote, R_CW_CANCEL_NOTE );
hgs
parents:
diff changeset
    70
        }
hgs
parents:
diff changeset
    71
    }  
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    74
// Sets engine contact for observer.
hgs
parents:
diff changeset
    75
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    76
void CPsuiWaitingObs::SetEngineContact( MPsetCallWaiting& aEngineContact )
hgs
parents:
diff changeset
    77
    {
hgs
parents:
diff changeset
    78
    CPsuiNoteController::InstanceL()->SetEngineContacts( 
hgs
parents:
diff changeset
    79
        &aEngineContact, NULL, NULL, NULL );
hgs
parents:
diff changeset
    80
    }
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    83
// Handles requesting notes (show/hide).
hgs
parents:
diff changeset
    84
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    85
void CPsuiWaitingObs::HandleCWRequestingL( TBool aOngoing, TBool aInterrupted )
hgs
parents:
diff changeset
    86
    {
hgs
parents:
diff changeset
    87
    if ( aInterrupted )
hgs
parents:
diff changeset
    88
        {
hgs
parents:
diff changeset
    89
        CPsuiNoteController::InstanceL()->RemoveNotesL();
hgs
parents:
diff changeset
    90
        return;
hgs
parents:
diff changeset
    91
        }
hgs
parents:
diff changeset
    92
    
hgs
parents:
diff changeset
    93
    if ( aOngoing )
hgs
parents:
diff changeset
    94
        {
hgs
parents:
diff changeset
    95
        CPsuiNoteController::InstanceL()->ShowNoteL( 
hgs
parents:
diff changeset
    96
            EPsuiWaitingNote, -1 );
hgs
parents:
diff changeset
    97
        }
hgs
parents:
diff changeset
    98
    else
hgs
parents:
diff changeset
    99
        {
hgs
parents:
diff changeset
   100
        CPsuiNoteController::InstanceL()->KillStaticNoteL();
hgs
parents:
diff changeset
   101
        }
hgs
parents:
diff changeset
   102
    }
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   105
// Handles the get status notifications.
hgs
parents:
diff changeset
   106
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   107
//
hgs
parents:
diff changeset
   108
void CPsuiWaitingObs::HandleCallWaitingGetStatusL( 
hgs
parents:
diff changeset
   109
    const MPsetCallWaiting::TGetCallWaitingStatus aStatus, 
hgs
parents:
diff changeset
   110
    TUint8 aBsc[KPSUIMaxBscNumber] )
hgs
parents:
diff changeset
   111
    {
hgs
parents:
diff changeset
   112
    
hgs
parents:
diff changeset
   113
    if ( iCallWaitingDistinguishEnabled && aStatus == MPsetCallWaiting::EStatusNotProvisioned )
hgs
parents:
diff changeset
   114
        {
hgs
parents:
diff changeset
   115
        CPsuiNoteController::InstanceL()->ShowNoteL( 
hgs
parents:
diff changeset
   116
            EPsuiConfirmationNote, R_CW_NOT_PROVISIONED_NOTE );
hgs
parents:
diff changeset
   117
        }
hgs
parents:
diff changeset
   118
    else if ( aStatus != MPsetCallWaiting::EStatusActive )
hgs
parents:
diff changeset
   119
        {
hgs
parents:
diff changeset
   120
        CPsuiNoteController::InstanceL()->ShowNoteL( 
hgs
parents:
diff changeset
   121
            EPsuiConfirmationNote, R_CW_NOT_ACTIVE_NOTE );
hgs
parents:
diff changeset
   122
        }
hgs
parents:
diff changeset
   123
    else
hgs
parents:
diff changeset
   124
        {
hgs
parents:
diff changeset
   125
        if( iCallWaitingDistinguishEnabled )
hgs
parents:
diff changeset
   126
            {
hgs
parents:
diff changeset
   127
                
hgs
parents:
diff changeset
   128
            //show only "CW active" even if the bsc list is present. 
hgs
parents:
diff changeset
   129
            //This change is to fix the error ENYI-6DYFKZ
hgs
parents:
diff changeset
   130
            CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiConfirmationNote, 
hgs
parents:
diff changeset
   131
                R_CW_ACTIVE_NO_BSC_NOTE );
hgs
parents:
diff changeset
   132
            }
hgs
parents:
diff changeset
   133
        else
hgs
parents:
diff changeset
   134
            {
hgs
parents:
diff changeset
   135
                
hgs
parents:
diff changeset
   136
            //if no bsc-list present, show only "CW active"
hgs
parents:
diff changeset
   137
            if ( aBsc[0] == KPSUINoBscGroup )
hgs
parents:
diff changeset
   138
                {
hgs
parents:
diff changeset
   139
                CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiConfirmationNote, 
hgs
parents:
diff changeset
   140
                R_CW_ACTIVE_NO_BSC_NOTE );
hgs
parents:
diff changeset
   141
                }
hgs
parents:
diff changeset
   142
            else
hgs
parents:
diff changeset
   143
                {
hgs
parents:
diff changeset
   144
            
hgs
parents:
diff changeset
   145
                CPsuiNoteController::InstanceL()->ShowBscListL( 
hgs
parents:
diff changeset
   146
                R_CW_STATUS_HEADING, 
hgs
parents:
diff changeset
   147
                aBsc );
hgs
parents:
diff changeset
   148
                }
hgs
parents:
diff changeset
   149
            }
hgs
parents:
diff changeset
   150
        }
hgs
parents:
diff changeset
   151
    }
hgs
parents:
diff changeset
   152
hgs
parents:
diff changeset
   153
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   154
// This function handles errors in call waiting requests.
hgs
parents:
diff changeset
   155
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
   156
//
hgs
parents:
diff changeset
   157
void CPsuiWaitingObs::HandleCWErrorL( TInt aReason )
hgs
parents:
diff changeset
   158
    {
hgs
parents:
diff changeset
   159
    if ( aReason != KErrSatControl  )
hgs
parents:
diff changeset
   160
        {
hgs
parents:
diff changeset
   161
        TInt errorResource(
hgs
parents:
diff changeset
   162
            CPsuiNoteController::InstanceL()->SetErrorNoteResourceID( aReason ) );
hgs
parents:
diff changeset
   163
            
hgs
parents:
diff changeset
   164
        CPsuiNoteController::InstanceL()->ShowNoteL( EPsuiErrorNote, errorResource );
hgs
parents:
diff changeset
   165
        }
hgs
parents:
diff changeset
   166
    }
hgs
parents:
diff changeset
   167
hgs
parents:
diff changeset
   168
// End of File