logsui/AppSrc/CLogsTimer.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002, 2003 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:  Utility class for timer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CLOGSTIMER_H
       
    20 #define CLOGSTIMER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MLogsTimer.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 *  Utility class for timer 
       
    30 *
       
    31 * @since 3.1
       
    32 */
       
    33 class CLogsTimer : public CTimer
       
    34     {
       
    35     public:  // Constructors and destructor
       
    36 
       
    37         /**
       
    38         * Two-phased constructor.
       
    39         *
       
    40         * @param aPriority priority of this active object.
       
    41         */
       
    42         static CLogsTimer* NewL( 
       
    43             TInt aPriority = CActive::EPriorityStandard );
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         virtual ~CLogsTimer();
       
    49 
       
    50     public: 
       
    51         
       
    52         /**
       
    53         * The Callback function is called after the interval.
       
    54         * All former request will be canceled first.
       
    55         *
       
    56         * @param anInterval interval.
       
    57         * @param aCallBack callback to be called after 
       
    58         *                  interval.
       
    59         */
       
    60         void After( 
       
    61             TTimeIntervalMicroSeconds32 anInterval,
       
    62             TCallBack aCallBack );
       
    63 
       
    64         /**
       
    65         * Use the mixin class to notify the timer.
       
    66         * All former request will be canceled first.
       
    67         *
       
    68         * @param anInterval interval.
       
    69         * @param aObserver callback to be called after
       
    70         *                  interval.
       
    71         * @param  aPtr pointer to additional parameter object.
       
    72         */
       
    73         void After( 
       
    74             TTimeIntervalMicroSeconds32 anInterval, 
       
    75             MLogsTimer* aObserver,
       
    76             TAny* aPtr );
       
    77 
       
    78     protected:  // Functions from base classes
       
    79         
       
    80         /**
       
    81         * From CActive::RunL()
       
    82         */
       
    83         virtual void RunL();
       
    84 
       
    85     private:
       
    86         
       
    87         /**
       
    88         * C++ constructor.
       
    89         */
       
    90         CLogsTimer( TInt aPriority );
       
    91 
       
    92         /**
       
    93         * By default Symbian OS constructor is private.
       
    94         */
       
    95         void ConstructL();
       
    96 
       
    97     private:    // Data
       
    98 
       
    99         // Timer callback.
       
   100         TCallBack iCallBack;
       
   101 
       
   102         // Timer observer.
       
   103         MLogsTimer* iTimerObserver;
       
   104         TAny* iTimerObserverParam;
       
   105 
       
   106     };
       
   107 
       
   108 #endif      // CLOGSTIMER_H 
       
   109             
       
   110 // End of File