syncmlfw/common/obex/obexdsplugin/src/PluginServiceTimer.cpp
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  SyncML Obex plugin for data syncronization
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "NSmlObexDSplugin.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CPluginServiceTimer::CPluginServiceTimer( CNSmlObexDSplugin* aEngine )
       
    28 //
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CPluginServiceTimer::CPluginServiceTimer( CNSmlObexDSplugin* aEngine, TInt aValue )
       
    32 	: CActive( EPriorityStandard ), iEngine( aEngine ), iValue( aValue ) {}
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CPluginServiceTimer::ConstructL()
       
    36 //
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 void CPluginServiceTimer::ConstructL()
       
    40 	{
       
    41 	DBG_FILE( _S8( "CPluginServiceTimer::ConstructL()" ) );
       
    42 	// create a thread-relative timer
       
    43 	User::LeaveIfError( iTimer.CreateLocal() );
       
    44 	DBG_FILE( _S8( "CPluginServiceTimer::ConstructL() : end" ) );
       
    45 	}
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CPluginServiceTimer::~CPluginServiceTimer()
       
    49 //
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CPluginServiceTimer::~CPluginServiceTimer()
       
    53 	{
       
    54 	DBG_FILE( _S8( "CPluginServiceTimer::~CPluginServiceTimer()" ) );
       
    55 	iTimer.Close();
       
    56 	DBG_FILE( _S8( "CPluginServiceTimer::~CPluginServiceTimer() : end" ) );
       
    57 	}
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CPluginServiceTimer::StartTimer()
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void CPluginServiceTimer::StartTimer()
       
    64 	{
       
    65 	DBG_FILE( _S8( "CPluginServiceTimer::StartTimer()" ) );
       
    66 	if( !IsActive() )
       
    67 		{
       
    68 		DBG_FILE( _S8( "!IsActive()" ) );
       
    69 		iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iValue ) );
       
    70 		iEngine->iSessionActive = ETrue;
       
    71 		SetActive();
       
    72 		DBG_FILE( _S8( "SetActive()" ) );
       
    73 		}
       
    74 
       
    75 	DBG_FILE( _S8( "CPluginServiceTimer::StartTimer() : end" ) );
       
    76 	}
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CPluginServiceTimer::StopTimer()
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CPluginServiceTimer::StopTimer()
       
    83 	{
       
    84 	DBG_FILE( _S8( "CPluginServiceTimer::StopTimer()" ) );
       
    85 	iEngine->iSessionActive = ETrue;	
       
    86 	DBG_FILE( _S8( "iSessiActive = ETrue" ) );
       
    87 	DBG_FILE( _S8( "CPluginServiceTimer::StopTimer() : end" ) );
       
    88 	}
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CPluginServiceTimer::DoCancel()
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void CPluginServiceTimer::DoCancel()
       
    95 	{
       
    96 	DBG_FILE( _S8( "CPluginServiceTimer::DoCancel()" ) );
       
    97 	iTimer.Cancel();
       
    98 	DBG_FILE( _S8( "CPluginServiceTimer::DoCancel() : end" ) );
       
    99 	}
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CPluginServiceTimer::RunL()
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void CPluginServiceTimer::RunL()
       
   106 	{
       
   107 	DBG_FILE( _S8( "CPluginServiceTimer::RunL()" ) );
       
   108 	iEngine->iSessionActive = EFalse;
       
   109 	DBG_FILE( _S8( "iSessionActive = EFalse" ) );
       
   110 	iEngine->iStartTimer = EFalse;
       
   111 	DBG_FILE( _S8( "iStartTimer = EFalse" ) );
       
   112 	DBG_FILE( _S8( "CPluginServiceTimer::RunL() : end" ) );
       
   113 	}