btobexprofiles/obexserviceman/utils/src/obexutilsdialogtimer.cpp
changeset 32 19bd632b5100
equal deleted inserted replaced
31:a0ea99b6fa53 32:19bd632b5100
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "obexutilsdialogtimer.h"
       
    21 #include "obexutilsdebug.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // C++ default constructor can NOT contain any code, that
       
    27 // might leave.
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 CObexUtilsDialogTimer::CObexUtilsDialogTimer( CObexUtilsDialog* aParent)
       
    31                                : CTimer( EPriorityLow ), 
       
    32                                  iParent( aParent )
       
    33     {
       
    34     CActiveScheduler::Add( this );
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CObexUtilsDialogTimer::ConstructL
       
    39 // Symbian OS default constructor can leave.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 void CObexUtilsDialogTimer::ConstructL()
       
    43     {
       
    44     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL()"));
       
    45 
       
    46     CTimer::ConstructL();
       
    47 
       
    48     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::ConstructL() completed"));
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CObexUtilsDialogTimer::NewL
       
    53 // -----------------------------------------------------------------------------
       
    54 CObexUtilsDialogTimer* CObexUtilsDialogTimer::NewL( CObexUtilsDialog* aParent)
       
    55     {
       
    56     CObexUtilsDialogTimer* self = 
       
    57         new( ELeave ) CObexUtilsDialogTimer( aParent );
       
    58 
       
    59     CleanupStack::PushL( self );
       
    60     self->ConstructL();
       
    61     CleanupStack::Pop( self );
       
    62     return self;
       
    63     }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // Destructor
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 CObexUtilsDialogTimer::~CObexUtilsDialogTimer()
       
    70     {
       
    71     Cancel();
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CObexUtilsDialogTimer::Tickle
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 void CObexUtilsDialogTimer::Tickle()
       
    79     {
       
    80     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle()"));
       
    81 
       
    82     Cancel();
       
    83     After( iTimeout );
       
    84 
       
    85     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::Tickle() completed"));
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CObexUtilsDialogTimer::RunL
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CObexUtilsDialogTimer::RunL()
       
    93     {
       
    94     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL()"));
       
    95     if (iParent)
       
    96         {
       
    97         iParent->UpdateProgressDialog();
       
    98         }
       
    99 
       
   100     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialogTimer::RunL() completed"));
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CObexUtilsDialogTimer::SetTimeout
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 void CObexUtilsDialogTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout )
       
   108     {
       
   109     iTimeout = aTimeout;
       
   110     }
       
   111 
       
   112 //  End of File