homescreensrv_plat/context_utility_api/tsrc/src/wait.h
branchRCL_3
changeset 14 15e4dd19031c
parent 12 502e5d91ad42
child 15 a0713522ab97
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
     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 "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:  CWait class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_WAIT_H
       
    21 #define C_WAIT_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 /**
       
    26 *  Timed active scheduler wait.
       
    27 *  This class wraps inside a timer and scheduler wait.
       
    28 *  Wait will be automatically stopped after specified time.
       
    29 */
       
    30 NONSHARABLE_CLASS( CWait ): public CTimer
       
    31     {
       
    32     public:  // Constructors and destructor
       
    33 
       
    34         // Two-phased constructor.
       
    35         static CWait* NewL();
       
    36         static CWait* NewLC();
       
    37                
       
    38         // Destructor.
       
    39         virtual ~CWait();
       
    40         
       
    41     public: // New methods
       
    42     
       
    43         /**
       
    44         * Starts waiting in the scheduler.
       
    45         * Wait will be automatically stopped after aInterval amount
       
    46         * of time has passed.
       
    47         * 
       
    48         * @param aInterval Interval after wait will be stopped.
       
    49         * @return None
       
    50         */
       
    51         void Start( const TTimeIntervalMicroSeconds32& aInterval );
       
    52 
       
    53         /**
       
    54         * Stops scheduler wait.
       
    55         * 
       
    56         * @param None
       
    57         * @return None
       
    58         */
       
    59         void Stop();
       
    60         
       
    61     private: // From base classes
       
    62     
       
    63         // @see CActive
       
    64         void RunL();
       
    65         
       
    66         // @see CActive
       
    67         void DoCancel();
       
    68         
       
    69     private:
       
    70     
       
    71         CWait();
       
    72         void ConstructL();
       
    73 
       
    74     private: // Data
       
    75     
       
    76         // Own: Active scheduler wait
       
    77         CActiveSchedulerWait* iWait;
       
    78     };
       
    79 
       
    80 #endif