locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp
branchRCL_3
changeset 19 b73252188534
equal deleted inserted replaced
18:63c982fb92f2 19:b73252188534
       
     1 /*
       
     2 * Copyright (c) 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:  Connection close timer handler
       
    15 */
       
    16 
       
    17 #include "connectiontimerhandler.h"
       
    18 #include "locationmanagerdebug.h"
       
    19 
       
    20 
       
    21 // ----------------------------------------------------------------------------
       
    22 // CConnectionTimerHandler::CConnectionTimerHandler()
       
    23 // ----------------------------------------------------------------------------
       
    24 
       
    25 
       
    26 CConnectionTimerHandler::CConnectionTimerHandler(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface):
       
    27         CTimer(EPriorityStandard ),
       
    28         iConnectionTimeoutHandlerInterface(aConnectionTimeoutHandlerInterface)
       
    29 {
       
    30 
       
    31 }
       
    32 
       
    33 // ----------------------------------------------------------------------------
       
    34 // CConnectionTimerHandler::~CConnectionTimerHandler()
       
    35 // ----------------------------------------------------------------------------
       
    36 CConnectionTimerHandler::~CConnectionTimerHandler()
       
    37     {
       
    38     }
       
    39 
       
    40 // ----------------------------------------------------------------------------
       
    41 // CConnectionTimerHandler::NewL()
       
    42 // ----------------------------------------------------------------------------
       
    43 CConnectionTimerHandler* CConnectionTimerHandler::NewL(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface)
       
    44     {
       
    45     LOG("CConnectionTimerHandler::NewL ,begin");
       
    46     CConnectionTimerHandler* self = new( ELeave ) CConnectionTimerHandler(aConnectionTimeoutHandlerInterface);
       
    47        CleanupStack::PushL( self );
       
    48        self->ConstructL();
       
    49        CleanupStack::Pop(); // self
       
    50        
       
    51        return self;
       
    52     }
       
    53 
       
    54 // ----------------------------------------------------------------------------
       
    55 // CConnectionTimerHandler::ConstructL()
       
    56 // ----------------------------------------------------------------------------
       
    57 void CConnectionTimerHandler::ConstructL()
       
    58     {
       
    59     LOG("CConnectionTimerHandler::ConstructL ,begin");
       
    60 	CActiveScheduler::Add(this);
       
    61     CTimer::ConstructL();
       
    62     LOG("CConnectionTimerHandler::ConstructL ,end");
       
    63     }
       
    64 
       
    65 // ----------------------------------------------------------------------------
       
    66 // CConnectionTimerHandler::StartTimer
       
    67 // starts a timer 
       
    68 // ----------------------------------------------------------------------------
       
    69 void CConnectionTimerHandler::StartTimer(const TInt aTimeoutVal)
       
    70     {
       
    71     LOG("CConnectionTimerHandler::StartTimer ,begin");
       
    72     if(!IsActive())
       
    73         {
       
    74         // already active.
       
    75         LOG("Timer started");
       
    76         After(aTimeoutVal);
       
    77         }
       
    78     LOG("CConnectionTimerHandler::StartTimer ,end");
       
    79     }
       
    80 
       
    81 // ----------------------------------------------------------------------------
       
    82 // CConnectionTimerHandler::RunL
       
    83 // ----------------------------------------------------------------------------
       
    84 void CConnectionTimerHandler::RunL( )
       
    85     {
       
    86     LOG("CConnectionTimerHandler::RunL ,begin");
       
    87     iConnectionTimeoutHandlerInterface.HandleTimedoutEvent(iStatus.Int());
       
    88 	LOG("CConnectionTimerHandler::RunL ,end");
       
    89     }
       
    90     
       
    91 
       
    92 
       
    93 // End of file
       
    94