bearermanagement/mpm/src/mpmconnselectiondlgtimer.cpp
branchRCL_3
changeset 62 bb1f80fb7db2
equal deleted inserted replaced
58:83ca720e2b9a 62:bb1f80fb7db2
       
     1 /*
       
     2  * Copyright (c) 2010 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: Implementation of class CMPMConnSelectionDlgTimer.
       
    15  * This timer is used for preventing showing of connection selection
       
    16  * dialog when the user has cancelled the previous selection dialog.
       
    17  *
       
    18  */
       
    19 
       
    20 #include "mpmlogger.h"
       
    21 #include "mpmserver.h"
       
    22 #include "mpmexpirytimer.h"
       
    23 #include "mpmconnselectiondlgtimer.h"
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // Creates a new object by calling the two-phased constructor.
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CMPMConnSelectionDlgTimer* CMPMConnSelectionDlgTimer::NewL( CMPMServer* aServer )
       
    30     {
       
    31     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::NewL" )
       
    32             
       
    33     CMPMConnSelectionDlgTimer* self = new( ELeave ) CMPMConnSelectionDlgTimer( aServer );
       
    34     CleanupStack::PushL( self );
       
    35     self->ConstructL();
       
    36     CleanupStack::Pop( self );
       
    37     return self;
       
    38     }
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // Default C++ constructor.
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer( CMPMServer* aServer ) :
       
    45     iServer( aServer )
       
    46     {
       
    47     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer" )
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // Symbian 2nd phase constructor.
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 void CMPMConnSelectionDlgTimer::ConstructL()
       
    55     {
       
    56     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::ConstructL" )
       
    57     iExpiryTimer = CMPMExpiryTimer::NewL( *this, KTimeout );
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // Destructor.
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer()
       
    65     {
       
    66     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer" )
       
    67     if ( iExpiryTimer )
       
    68         {
       
    69         iExpiryTimer->Cancel();
       
    70         delete iExpiryTimer;
       
    71         }
       
    72     }
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 // Start the timer.
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 void CMPMConnSelectionDlgTimer::StartTimer()
       
    79     {
       
    80     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::StartTimer" )
       
    81     if ( iExpiryTimer )
       
    82         {
       
    83         iExpiryTimer->Cancel();
       
    84         iExpiryTimer->Start();    
       
    85         }
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 // Handles the timeout.
       
    90 // ---------------------------------------------------------------------------
       
    91 //
       
    92 void CMPMConnSelectionDlgTimer::HandleTimedOut()
       
    93     {
       
    94     MPMLOGSTRING( "CMPMConnSelectionDlgTimer::HandleTimedOut" )
       
    95     iServer->ResetConnSelectionDlgTimer();
       
    96     }