locationsystemui/locationsysui/locverifier/src/lpdverifierquerylauncher.cpp
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2002 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:  Class which handles the dialog and expiration timer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "lpdverifierquerylauncher.h"
       
    21 #include "lpdglobalplugindialog.h"
       
    22 #include "lpdresulthandler.h"
       
    23 #include "locverifierdlg.hrh"
       
    24 #include <locverifierdlg.rsg>
       
    25 #include <avkon.hrh>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 const TInt KNonPeriodicRequest = 0;
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CLpdVerifierQueryLauncher::CLpdVerifierQueryLauncher
       
    35 // C++ default constructor can NOT contain any code, that
       
    36 // might leave.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CLpdVerifierQueryLauncher::CLpdVerifierQueryLauncher( 
       
    40     MLpdResultHandler& aHandler ) 
       
    41     : CLpdQueryLauncherBase( aHandler )
       
    42     {
       
    43     // Intentionally empty
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CLpdVerifierQueryLauncher::ConstructL
       
    48 // Symbian 2nd phase constructor can leave.
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 void CLpdVerifierQueryLauncher::ConstructL()
       
    52     {
       
    53     BaseConstructL();
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CLpdVerifierQueryLauncher::NewL
       
    58 // Two-phased constructor.
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 CLpdVerifierQueryLauncher* CLpdVerifierQueryLauncher::NewL( 
       
    62     MLpdResultHandler& aHandler )
       
    63     {
       
    64     CLpdVerifierQueryLauncher* self =
       
    65         new( ELeave ) CLpdVerifierQueryLauncher( aHandler );
       
    66     
       
    67     CleanupStack::PushL( self );
       
    68     self->ConstructL();
       
    69     CleanupStack::Pop(self);
       
    70 
       
    71     return self;
       
    72     }
       
    73 
       
    74 // Destructor
       
    75 CLpdVerifierQueryLauncher::~CLpdVerifierQueryLauncher()
       
    76     {
       
    77     // Intentionally empty
       
    78     }
       
    79 
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CLpdVerifierQueryLauncher::PrepareVerificationResourcesL
       
    83 // (other items were commented in a header).
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 void CLpdVerifierQueryLauncher::PrepareVerificationResourcesL(
       
    87     TPosRequestSource aSource,
       
    88     TPosRequestDecision aDefault)
       
    89     {
       
    90     if ( aSource == EPosRequestSourceNetwork && 
       
    91          aDefault == EPosDecisionAccepted )
       
    92         {
       
    93         PrepareQueryResourcesL( R_LPD_GLOBAL_VERIFICATION_DEFAULT_A, KNonPeriodicRequest );
       
    94         }
       
    95     else if ( aSource == EPosRequestSourceNetwork && 
       
    96               aDefault == EPosDecisionRejected )
       
    97         {
       
    98         PrepareQueryResourcesL( R_LPD_GLOBAL_VERIFICATION_DEFAULT_R, KNonPeriodicRequest );
       
    99         }
       
   100     else
       
   101         { // Terminal request, EPosDecisionNotAvailable or future extensions
       
   102         PrepareQueryResourcesL( R_LPD_GLOBAL_VERIFICATION_DEFAULT_N, KNonPeriodicRequest );
       
   103         }
       
   104 
       
   105     iQueryDlg->SetTone( EAvkonSIDLocationRequest );
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CLpdVerifierQueryLauncher::PrepareSuplVerificationResourcesL
       
   110 // (other items were commented in a header).
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 void CLpdVerifierQueryLauncher::PrepareSuplVerificationResourcesL()
       
   114 {
       
   115   PrepareQueryResourcesL( R_LPD_SUPL_PERIODIC_VERIFICATION_DEFAULT, KNonPeriodicRequest );
       
   116   iQueryDlg->SetTone( EAvkonSIDLocationRequest );
       
   117 }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CLpdVerifierQueryLauncher::ExtendedHandleDlgDismissedL
       
   121 // (other items were commented in a header).
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 void CLpdVerifierQueryLauncher::ExtendedHandleDlgDismissedL()
       
   125     {
       
   126     TInt retValue = KErrNone;
       
   127     switch ( iResult )
       
   128         {
       
   129         case EAknSoftkeyOk:
       
   130             {
       
   131             retValue = KErrNone;
       
   132             break;
       
   133             }
       
   134         case EAknSoftkeyCancel:
       
   135             {
       
   136             retValue = KErrAccessDenied;
       
   137             break;
       
   138             }
       
   139         case EEikCmdExit:
       
   140             {
       
   141             retValue = iExitReason;
       
   142             break;
       
   143             }
       
   144         case ELpdCmdEmergency:
       
   145             { // emergency call support
       
   146             retValue = KErrAbort;
       
   147             break;
       
   148             }
       
   149         default:
       
   150             {
       
   151             retValue = KErrGeneral;
       
   152             break;
       
   153             }
       
   154         }
       
   155     iHandler.HandleVerificationResultL( retValue );
       
   156     }
       
   157 
       
   158 //  End of File