phoneapp/phoneuicontrol/src/cphonereconnectquery.cpp
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: CPhoneReconnectQuery implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <mpeengineinfo.h>
       
    21 #include "cphonereconnectquery.h"
       
    22 #include "phoneconstants.h"
       
    23 #include "phonelogger.h"
       
    24 #include "phonerssbase.h"
       
    25 #include "cphonetimer.h"
       
    26 #include "cphonestatehandle.h"
       
    27 #include "tphonecmdparamboolean.h"
       
    28 #include "tphonecmdparaminteger.h"
       
    29 #include "cphonemainresourceresolver.h"
       
    30 
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CPhoneReconnectQuery::CPhoneReconnectQuery
       
    35 // C++ default constructor can NOT contain any code, that
       
    36 // might leave.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CPhoneReconnectQuery::CPhoneReconnectQuery() : CCoeStatic( KUidReconnectQuerySingleton ),
       
    40     iReconQueryTimer ( NULL ),
       
    41     iIncludeVideo( EFalse )
       
    42     {
       
    43     }
       
    44 
       
    45 // Destructor
       
    46 CPhoneReconnectQuery::~CPhoneReconnectQuery()
       
    47     {
       
    48     CancelReconnectQueryTimer();
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CPhoneReconnectQuery::InstanceL
       
    53 // (other items were commented in a header).
       
    54 // ---------------------------------------------------------
       
    55 //
       
    56 EXPORT_C CPhoneReconnectQuery* CPhoneReconnectQuery::InstanceL()
       
    57     {
       
    58     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::InstanceL( ) ");
       
    59     CPhoneReconnectQuery* instance = static_cast<CPhoneReconnectQuery*>(
       
    60         CCoeEnv::Static( KUidReconnectQuerySingleton ) );
       
    61     if ( !instance )
       
    62         {
       
    63         instance = new ( ELeave ) CPhoneReconnectQuery;
       
    64         }
       
    65     return instance;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // CPhoneReconnectQuery::CancelReconnectQueryTimer
       
    70 // ---------------------------------------------------------
       
    71 //
       
    72 void CPhoneReconnectQuery::CancelReconnectQueryTimer()
       
    73     {
       
    74     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::CancelReconnectQueryTimer( ) ");
       
    75     if( iReconQueryTimer && iReconQueryTimer->IsActive() )
       
    76         {
       
    77         iReconQueryTimer->CancelTimer();
       
    78         }
       
    79     delete iReconQueryTimer;
       
    80     iReconQueryTimer = NULL;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------
       
    84 // CPhoneReconnectQuery::ShowReconnectQueryL
       
    85 // -----------------------------------------------------------
       
    86 //
       
    87 EXPORT_C void CPhoneReconnectQuery::ShowReconnectQueryL( TBool aShowVideo )
       
    88     {
       
    89     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::ShowReconnectQueryL( ) ");
       
    90     iIncludeVideo = aShowVideo;
       
    91     if( !iReconQueryTimer )
       
    92         {
       
    93         iReconQueryTimer = CPhoneTimer::NewL();
       
    94         }
       
    95 
       
    96     iReconQueryTimer->After( KInformationNoteDisplayTime, this );
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------
       
   100 // CPhoneReconnectQuery::HandleTimeOutL
       
   101 // -----------------------------------------------------------
       
   102 //
       
   103 void CPhoneReconnectQuery::HandleTimeOutL()
       
   104     {
       
   105     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::HandleTimeOutL( ) ");
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------
       
   109 // CPhoneReconnectQuery::OptionSelected
       
   110 // -----------------------------------------------------------
       
   111 //
       
   112 void CPhoneReconnectQuery::OptionSelected(
       
   113     MCaUiReconnectQueryObserver::TCaUiReconType aReconType )
       
   114     {
       
   115     __LOGMETHODSTARTEND( EPhoneControl,
       
   116         "CPhoneReconnectQuery::HandleReconConfQueryResultL( ) ");
       
   117     __PHONELOG1( EBasic, EPhoneControl,
       
   118         "CPhoneReconnectQuery::HandleReconConfQueryResultL aReconType = %d",
       
   119         aReconType );
       
   120 
       
   121     iDisplayingQuery = EFalse;
       
   122 
       
   123     switch( aReconType )
       
   124         {
       
   125         case ECallUiReconTypeVoice:
       
   126             CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
       
   127                 ->EngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice );
       
   128             CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
       
   129                 ->HandleMessage( MPEPhoneModel::EPEMessageDial );
       
   130             break;
       
   131 
       
   132         case ECallUiReconTypeVideo:
       
   133             CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
       
   134                 ->EngineInfo()->SetCallTypeCommand( EPECallTypeVideo );
       
   135             CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
       
   136                 ->HandleMessage( MPEPhoneModel::EPEMessageDial );
       
   137             break;
       
   138 
       
   139         case ECallUiReconTypeMsg:
       
   140             // CallUi launches message editor
       
   141             break;
       
   142 
       
   143         default:
       
   144             // Do nothing
       
   145             break;
       
   146         }
       
   147     }
       
   148 
       
   149 // -----------------------------------------------------------
       
   150 // CPhoneReconnectQuery::ShowNumberEntryL
       
   151 // -----------------------------------------------------------
       
   152 //
       
   153 void CPhoneReconnectQuery::ShowNumberEntryL()
       
   154     {
       
   155     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::ShowNumberEntryL( ) ");
       
   156     // Show number entry
       
   157     TPhoneCmdParamBoolean booleanParam;
       
   158     booleanParam.SetBoolean( ETrue );
       
   159     CPhoneStateHandle::Instance()->ViewCommandHandle()->
       
   160         ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
       
   161 
       
   162     // Set Number Entry CBA
       
   163     TPhoneCmdParamInteger integerParam;
       
   164     integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
       
   165         ResolveResourceID( EPhoneNumberAcqCBA ) );
       
   166     CPhoneStateHandle::Instance()->ViewCommandHandle()->
       
   167         ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
       
   168     }
       
   169 
       
   170 // -----------------------------------------------------------
       
   171 // CPhoneReconnectQuery::IsDisplayingQuery
       
   172 // -----------------------------------------------------------
       
   173 //
       
   174 TBool CPhoneReconnectQuery::IsDisplayingQuery()
       
   175     {
       
   176     return iDisplayingQuery;
       
   177     }
       
   178 
       
   179 
       
   180 // End of File