tsrc/VCXTestCommon/src/CIptvTestEvent.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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 //  INCLUDES
       
    20 #include "CIptvTestEvent.h"
       
    21 #include "VCXTestLog.h"
       
    22 
       
    23 EXPORT_C CIptvTestEvent::~CIptvTestEvent()
       
    24     {
       
    25     }
       
    26 
       
    27 EXPORT_C TBool CIptvTestEvent::HasTimeouted(TTime& aTimeNow)
       
    28     {
       
    29 	if(!iActive)
       
    30 		{
       
    31 		return EFalse;
       
    32 		}
       
    33 	TTimeIntervalSeconds secondsAlive;
       
    34 	aTimeNow.SecondsFrom(iActivationTime, secondsAlive);
       
    35 
       
    36 	VCXLOGLO3("CIptvTestEvent:: '%S' seconds to timeout: %d", &iName, iTimeoutSeconds - secondsAlive.Int() );
       
    37 
       
    38 	if(secondsAlive.Int() >= iTimeoutSeconds)
       
    39 		{
       
    40 		return ETrue;
       
    41 		}
       
    42 	return EFalse;
       
    43     }
       
    44 
       
    45 EXPORT_C CIptvTestEvent::CIptvTestEvent( const TDesC& aName, TInt aTimeoutSeconds)
       
    46     {
       
    47 	iName = _L("Noname Event");
       
    48 	iName = aName;
       
    49 	iTimeoutSeconds = aTimeoutSeconds;
       
    50 	iActive = EFalse;
       
    51     }
       
    52 
       
    53 void CIptvTestEvent::ConstructL()
       
    54     {
       
    55     }
       
    56 
       
    57 EXPORT_C void CIptvTestEvent::GetName(TDes& aName)
       
    58 	{
       
    59 	aName = iName;
       
    60 	}
       
    61 
       
    62 
       
    63 EXPORT_C void CIptvTestEvent::Activate()
       
    64 	{
       
    65 	iActive = ETrue;
       
    66 	iActivationTime.UniversalTime();
       
    67 	VCXLOGLO2("ACTIVATED %S", &iName);
       
    68 	}
       
    69 
       
    70 EXPORT_C void CIptvTestEvent::Deactivate()
       
    71 	{
       
    72 	iActive = EFalse;
       
    73 	VCXLOGLO2("DEACTIVATED %S", &iName);
       
    74 	}
       
    75 
       
    76 
       
    77 // End of File