|
1 /* |
|
2 * Copyright (c) 2004-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: CCFDelay class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFDELAY_H |
|
21 #define C_CFDELAY_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <cfcontextobject.h> |
|
25 |
|
26 #include "cfdelayexpired.h" |
|
27 |
|
28 |
|
29 /** |
|
30 * Delays the call to expiration interface. |
|
31 * |
|
32 * @lib - |
|
33 * @since S60 5.0 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CCFDelay ) : public CTimer |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two phased constructors. |
|
41 * |
|
42 * @since S60 5.0 |
|
43 * @param |
|
44 * @return CCFDelay* |
|
45 */ |
|
46 static CCFDelay* NewL( MCFDelayExpired& aDelayer ); |
|
47 static CCFDelay* NewLC( MCFDelayExpired& aDelayer ); |
|
48 |
|
49 // Destructor |
|
50 ~CCFDelay(); |
|
51 |
|
52 public: // New methods |
|
53 |
|
54 /** |
|
55 * Starts the delay. |
|
56 * If there is an ongoing delay it will be automatically cancelled and |
|
57 * new delay is started. |
|
58 * |
|
59 * @since S60 5.0 |
|
60 * @param aDelay defines the delay in microseconds. |
|
61 * @return None. |
|
62 */ |
|
63 void Delay( const TTimeIntervalMicroSeconds32& aDelay ); |
|
64 |
|
65 private: // From base classes |
|
66 |
|
67 // @see CActive |
|
68 void RunL(); |
|
69 |
|
70 // @see CActive |
|
71 TInt RunError( TInt aError ); |
|
72 |
|
73 private: |
|
74 |
|
75 CCFDelay( MCFDelayExpired& aDelayer ); |
|
76 void ConstructL(); |
|
77 |
|
78 private: // Data |
|
79 |
|
80 /** Interface to be called when the delay has expired. */ |
|
81 MCFDelayExpired& iDelayer; |
|
82 |
|
83 /** Stores the required delay. */ |
|
84 TInt iDelay; |
|
85 |
|
86 /** Stores the time when delay was started. */ |
|
87 TTime iDelayStartTime; |
|
88 }; |
|
89 |
|
90 #endif // C_CFDELAY_H |