videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/timeoutcontroller.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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:  Simple player for preemption purposes
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: ou1cpsw#2 %
       
    19 
       
    20 
       
    21 
       
    22 #include <e32svr.h>
       
    23 #include <StifParser.h>
       
    24 #include <Stiftestinterface.h>
       
    25 
       
    26 
       
    27 class MTimeoutObserver
       
    28 {
       
    29     public: // New functions
       
    30 
       
    31         virtual void HandleTimeout(TInt error) = 0;
       
    32 };
       
    33 
       
    34 
       
    35 _LIT(KFormatTimeStamp, "%:0%J%:1%T%:2%S%.%*C4%:3%+B");
       
    36 
       
    37 
       
    38 class CSimpleTimeout : public CActive
       
    39 {
       
    40     public:     // Constructors and destructor
       
    41 
       
    42         static CSimpleTimeout* NewL( MTimeoutObserver* aObserver );
       
    43 
       
    44         ~CSimpleTimeout();
       
    45 
       
    46     public:     // New functions
       
    47 
       
    48         void Start( TTimeIntervalMicroSeconds aTimeout );
       
    49 
       
    50         void Stop();
       
    51 
       
    52 
       
    53     public:     // Functions from base classes
       
    54 
       
    55         void RunL();
       
    56 
       
    57         void DoCancel();
       
    58 
       
    59         TInt RunError( TInt aError );
       
    60 
       
    61     private:
       
    62 
       
    63         void ConstructL( MTimeoutObserver* aObserver );
       
    64         CSimpleTimeout();
       
    65 
       
    66 
       
    67     private:    // Data
       
    68         MTimeoutObserver*   iObserver;
       
    69         RTimer              iTimer;
       
    70         TTime               iTestCaseTimeout;
       
    71 };