exampleapps/alfexcalendar/inc/alfexcalendarengineeventtimer.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __ALFEXCALENDARENGINEEVENTTIMER_H__
       
    22 #define __ALFEXCALENDARENGINEEVENTTIMER_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 
       
    27 
       
    28 
       
    29 /**
       
    30 * MAlfExCalendarEngineEventTimer is a pure virtual class that 
       
    31 * defines callback function which is called when timer event
       
    32 * occurs.
       
    33 */
       
    34 class MAlfExCalendarEngineEventTimerObserver
       
    35     {
       
    36 public:
       
    37     /**
       
    38      * Called when timer event triggered in 
       
    39      * CAlfExCalendarEngineEventTimer
       
    40      */	
       
    41     virtual void HandleTimerEventL() = 0;
       
    42     };
       
    43 
       
    44 
       
    45 
       
    46 
       
    47 /**
       
    48 * CAlfExCalendarEngine is a class that gives data to be displayed in 
       
    49 * alfexcalendar example application.
       
    50 */
       
    51 class CAlfExCalendarEngineEventTimer : public CActive
       
    52 	{
       
    53 public:
       
    54     /* Constructors and destructor. */
       
    55 
       
    56     /**
       
    57      * Constructor
       
    58      */	
       
    59     static CAlfExCalendarEngineEventTimer* NewL(MAlfExCalendarEngineEventTimerObserver& aObserver);
       
    60     
       
    61     /**
       
    62      * Constructor
       
    63      */
       
    64     static CAlfExCalendarEngineEventTimer* NewLC(MAlfExCalendarEngineEventTimerObserver& aObserver);
       
    65     
       
    66     /**
       
    67      * Destructor.
       
    68      */
       
    69     virtual ~CAlfExCalendarEngineEventTimer();
       
    70 
       
    71 public:
       
    72 	
       
    73 	
       
    74     /* Methods. */
       
    75 
       
    76     /** @beginAPI */
       
    77     /**
       
    78      * Starts timer. 
       
    79      * Cancels previous timer if still active. 
       
    80      *
       
    81      * @param aDelay: delay.
       
    82      */
       
    83     void StartTimer( TTimeIntervalMicroSeconds32 aDelay);
       
    84 
       
    85     /** @endAPI */
       
    86 
       
    87 private:
       
    88     /* Constructors. */
       
    89 
       
    90     /**
       
    91      * C++ constructor
       
    92      */
       
    93     CAlfExCalendarEngineEventTimer(MAlfExCalendarEngineEventTimerObserver& aObserver);
       
    94 	
       
    95     /**
       
    96      * Second-phase constructor. 
       
    97      */
       
    98     void ConstructL();
       
    99 
       
   100 
       
   101 protected:
       
   102     /**
       
   103      * From CActive
       
   104      */
       
   105     virtual void DoCancel();
       
   106 
       
   107     /**
       
   108      * From CActive
       
   109      */
       
   110     virtual void RunL();
       
   111 	
       
   112     /**
       
   113      * From CActive.
       
   114      * This is called if RunL function leaves. 
       
   115      * Here we can just ignore all the errors and return KErrNone
       
   116      */
       
   117     virtual TInt RunError(TInt aError);
       
   118 private:
       
   119     /** 
       
   120      * timer object.
       
   121      */
       
   122     RTimer		iTimer;
       
   123     
       
   124     /**
       
   125      * Observer object
       
   126      */
       
   127     MAlfExCalendarEngineEventTimerObserver& iObserver;
       
   128 	};
       
   129 
       
   130 #endif // __ALFEXCALENDARENGINEEVENTTIMER_H__