|
1 /* |
|
2 * Copyright (c) 2001-2009 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 #ifndef __CT_LBS_CLIENT_EVENT_TIMER_H__ |
|
21 #define __CT_LBS_CLIENT_EVENT_TIMER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <test/testexecutelogger.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MCT_LbsRequestObserver; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * This class is used to time the notification dialog |
|
36 * |
|
37 */ |
|
38 class CT_LbsClientEventTimer : public CActive |
|
39 { |
|
40 private: // Constructors |
|
41 |
|
42 /** |
|
43 * C++ default constructor. |
|
44 */ |
|
45 CT_LbsClientEventTimer(); |
|
46 |
|
47 /** |
|
48 * By default EPOC constructor is private. |
|
49 */ |
|
50 void ConstructL(CTestExecuteLogger& aLogger); |
|
51 |
|
52 // By default, prohibit copy constructor |
|
53 CT_LbsClientEventTimer( const CT_LbsClientEventTimer& ); |
|
54 // Prohibit assigment operator |
|
55 CT_LbsClientEventTimer& operator= ( const CT_LbsClientEventTimer& ); |
|
56 // Logger interface used for constructing result strings to be fed for the logger instance |
|
57 inline CTestExecuteLogger& Logger() {return iLogger;}; |
|
58 |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CT_LbsClientEventTimer* NewL(CTestExecuteLogger& aLogger); |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 */ |
|
69 static CT_LbsClientEventTimer* NewLC(CTestExecuteLogger& aLogger); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 ~CT_LbsClientEventTimer(); |
|
75 |
|
76 public: // New functions |
|
77 |
|
78 /** |
|
79 * Start the timer |
|
80 */ |
|
81 void Start(TInt aTimeout); |
|
82 |
|
83 TInt CompletionCode() const; |
|
84 |
|
85 void ResetCompletionCode(); |
|
86 |
|
87 /** |
|
88 * Set who is observing timeouts |
|
89 * @param aObserver the observing object |
|
90 */ |
|
91 void SetObserver( |
|
92 /* IN */ MCT_LbsRequestObserver* aObserver |
|
93 ); |
|
94 |
|
95 protected: // Functions from base classes |
|
96 |
|
97 /** |
|
98 * From CActive |
|
99 */ |
|
100 void RunL(); |
|
101 |
|
102 /** |
|
103 * From CActive |
|
104 */ |
|
105 TInt RunError(TInt aError); |
|
106 |
|
107 /** |
|
108 * From CActive |
|
109 */ |
|
110 void DoCancel(); |
|
111 |
|
112 protected: // New functions |
|
113 |
|
114 void RequestComplete(); |
|
115 |
|
116 private: // Data |
|
117 RTimer iTimer; |
|
118 MCT_LbsRequestObserver* iObserver; |
|
119 TInt iCompletionCode; |
|
120 |
|
121 CTestExecuteLogger iLogger; |
|
122 }; |
|
123 |
|
124 #endif // __CT_LBS_CLIENT_EVENT_TIMER_H__ |
|
125 |
|
126 // End of File |