|
1 /* |
|
2 * Copyright (c) 2007-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: Timer operation class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IPSPLGTIMEROPERATION_H |
|
19 #define IPSPLGTIMEROPERATION_H |
|
20 |
|
21 class MIpsPlgTimerOperationCallBack |
|
22 { |
|
23 public: |
|
24 virtual void HandleTimerFiredL( const TFSMailMsgId& aMailboxId ) = 0; |
|
25 }; |
|
26 |
|
27 /** |
|
28 * Simple Timer Operation. Completes observer when time expires. |
|
29 */ |
|
30 class CIpsPlgTimerOperation : public CActive |
|
31 { |
|
32 public: |
|
33 /** |
|
34 * |
|
35 */ |
|
36 static CIpsPlgTimerOperation* NewL( |
|
37 TFSMailMsgId aMailboxId, |
|
38 MIpsPlgTimerOperationCallBack& aObserver ); |
|
39 |
|
40 /** |
|
41 * |
|
42 */ |
|
43 virtual ~CIpsPlgTimerOperation(); |
|
44 |
|
45 |
|
46 /** |
|
47 * |
|
48 */ |
|
49 void After(TTimeIntervalMicroSeconds32 aInterval); |
|
50 |
|
51 /** |
|
52 * |
|
53 */ |
|
54 void ResetTimerOperation(); |
|
55 |
|
56 /** |
|
57 * |
|
58 */ |
|
59 TFSMailMsgId FSMailboxId() const; |
|
60 |
|
61 protected: |
|
62 |
|
63 |
|
64 CIpsPlgTimerOperation( |
|
65 TFSMailMsgId aMailboxId, |
|
66 MIpsPlgTimerOperationCallBack& aObserver ); |
|
67 |
|
68 /** |
|
69 * |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 /** |
|
74 * From CActive |
|
75 */ |
|
76 virtual void DoCancel(); |
|
77 |
|
78 /** |
|
79 * From CActive |
|
80 */ |
|
81 virtual void RunL(); |
|
82 |
|
83 protected: // Data |
|
84 RTimer iTimer; |
|
85 TFSMailMsgId iMailboxId; |
|
86 MIpsPlgTimerOperationCallBack& iObserver; |
|
87 // true if timer have to reactivated |
|
88 TBool iStateReActivate; |
|
89 }; |
|
90 |
|
91 |
|
92 |
|
93 #endif |