dvrengine/CommonRecordingEngine/inc/CCRTimer.h
branchRCL_3
changeset 22 826cea16efd9
parent 21 798ee5f1972c
child 23 13a33d82ad98
equal deleted inserted replaced
21:798ee5f1972c 22:826cea16efd9
     1 /*
       
     2 * Copyright (c) 2007 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:    Wrapper for CTimer*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCRTIMER_H
       
    21 #define CCRTIMER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 // None
       
    28 
       
    29 // MACROS
       
    30 // None
       
    31 
       
    32 // DATA TYPES
       
    33 // None
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class MCRTimerObserver;
       
    37 
       
    38 /**
       
    39 *  CCRTimer
       
    40 *
       
    41 *  This class will notify an object after a specified timeout.
       
    42 *  @lib CommonRecordingEngine.lib
       
    43 *  @since Series 60 3.0
       
    44 */
       
    45 class CCRTimer : public CTimer
       
    46     {
       
    47 
       
    48 public: // Constructors and destructors
       
    49 
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     * Creates a CCRTimer object using two phase construction,
       
    53     * and returns a pointer to the created object.
       
    54     * @since Series 60 3.0
       
    55     * @param aPriority Priority to use for this timer.
       
    56     * @param aTimeOutNotify Object to notify of timeout event.
       
    57     * @return A pointer to the created instance of CCRTimer.
       
    58     */
       
    59     IMPORT_C static CCRTimer* NewL( const TInt aPriority,
       
    60                                     MCRTimerObserver& aTimerObserver );
       
    61 
       
    62     /**
       
    63     * Two-phased constructor.
       
    64     * Creates a CCRTimer object using two phase construction,
       
    65     * and returns a pointer to the created object.
       
    66     * @since Series 60 3.0
       
    67     * @param aPriority Priority to use for this timer.
       
    68     * @param aTimerObserver Object to notify of timeout event.
       
    69     * @return A pointer to the created instance of CCRTimer.
       
    70     */
       
    71     IMPORT_C static CCRTimer* NewLC( const TInt aPriority,
       
    72                                      MCRTimerObserver& aTimerObserver );
       
    73 
       
    74     /**
       
    75     * Destructor.
       
    76     * Destroys the object and release all memory objects.
       
    77     */
       
    78     virtual IMPORT_C ~CCRTimer();
       
    79 
       
    80 protected: // Functions from base classes
       
    81 
       
    82     /**
       
    83     * From CActive.
       
    84     * Called when operation completes.
       
    85     * @since Series 60 3.0
       
    86     * @param none.
       
    87     * @return none.
       
    88     */
       
    89     IMPORT_C void RunL();
       
    90 
       
    91 private: // Constructors and destructors
       
    92 
       
    93     /**
       
    94     * C++ default constructor.
       
    95     * Performs the first phase of two phase construction.
       
    96     * @since Series 60 3.0
       
    97     * @param aPriority Priority to use for this timer.
       
    98     * @param aTimeOutNotify An observer to notify.
       
    99     * @return none.
       
   100     */
       
   101     IMPORT_C CCRTimer( const TInt aPriority,
       
   102                        MCRTimerObserver& aTimerObserver );
       
   103 
       
   104     /**
       
   105     * ConstructL.
       
   106     * 2nd phase constructor.
       
   107     */
       
   108     IMPORT_C void ConstructL();
       
   109 
       
   110 private: // Data
       
   111     
       
   112     /**
       
   113     * iNotify, the observer for this objects events.
       
   114     */
       
   115     MCRTimerObserver& iObserver;
       
   116     
       
   117     };
       
   118 
       
   119 #endif // CCRTIMER_H
       
   120 
       
   121 //  End of File