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: Timer service |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSPTIMER_H |
|
20 #define CSPTIMER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class MCSPTimerObserver; |
|
25 |
|
26 /** |
|
27 * Timer service. |
|
28 * |
|
29 * @lib PhoneEngine.lib |
|
30 * @since S60 v3.1 |
|
31 */ |
|
32 NONSHARABLE_CLASS( CSPTimer ) : protected CTimer |
|
33 { |
|
34 public: |
|
35 |
|
36 static CSPTimer* NewL(); |
|
37 |
|
38 static CSPTimer* NewLC(); |
|
39 |
|
40 virtual ~CSPTimer(); |
|
41 |
|
42 /** |
|
43 * Request for notify after aTimeout. |
|
44 * After timeout has passed observer is called. Panics |
|
45 * if there is notify already ongoing ie IsNotifyOngoing |
|
46 * returns ETrue. |
|
47 * |
|
48 * |
|
49 * @param aTimeout Time out in microseconds. |
|
50 * @param aTimerObserver Observer for notify. |
|
51 */ |
|
52 virtual void NotifyAfter( TInt aTimeout, |
|
53 MCSPTimerObserver& aTimerObserver ); |
|
54 |
|
55 /** |
|
56 * Cancels the outstanding notify request. After |
|
57 * this call notify is no longer ongoing ie IsNotifyOngoing |
|
58 * return EFalse. |
|
59 * |
|
60 * |
|
61 */ |
|
62 virtual void CancelNotify(); |
|
63 |
|
64 /** |
|
65 * Determines if there is notify ongoing. |
|
66 * |
|
67 * |
|
68 * @return ETrue - notify is ongoing, EFalse - notify is not ongoing. |
|
69 */ |
|
70 virtual TBool IsNotifyOngoing(); |
|
71 |
|
72 protected: |
|
73 |
|
74 // from base class CActive |
|
75 |
|
76 /** |
|
77 * From CActive |
|
78 * Called when timer timeout is up. |
|
79 * |
|
80 * |
|
81 */ |
|
82 void RunL(); |
|
83 |
|
84 CSPTimer(); |
|
85 |
|
86 void ConstructL(); |
|
87 |
|
88 protected: // data |
|
89 |
|
90 /** |
|
91 * Observer for notify service. |
|
92 * Not own. |
|
93 */ |
|
94 MCSPTimerObserver* iObserver; |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // CSPTIMER_H |
|