|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CCONNECTIONTIMER_H__ |
|
17 #define __CCONNECTIONTIMER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 class MConnectionTimerCallback; |
|
22 |
|
23 /** The class CConnectionTimer is used by the Wsp Protocol Handler to ensure |
|
24 that a WSP session establishment times-out. |
|
25 */ |
|
26 //##ModelId=3C4C41AE014F |
|
27 class CConnectionTimer : public CTimer |
|
28 { |
|
29 public: // Methods |
|
30 |
|
31 /** @fn NewL(MConnectionTimerCallback& aCallback) |
|
32 Intended Usage : Static factory constructor. |
|
33 @since 7.0 |
|
34 @param aCallback A reference to the callback object that handles |
|
35 the timer complete event. |
|
36 @return A pointer to a fully initialised object. |
|
37 */ |
|
38 //##ModelId=3C4C41AE018D |
|
39 static CConnectionTimer* NewL(MConnectionTimerCallback& aCallback); |
|
40 |
|
41 /** @fn ~CConnectionTimer() |
|
42 Intended Usage : Standard destructor. |
|
43 @since 7.0 |
|
44 */ |
|
45 //##ModelId=3C4C41AE018C |
|
46 ~CConnectionTimer(); |
|
47 |
|
48 /** @fn Start(TInt aDelayTime) |
|
49 Intended Usage : Starts the timer. |
|
50 @since 7.0 |
|
51 @param aDelayTime The time delay, in microseconds, by when the |
|
52 timer should complete. |
|
53 @post The object is active. |
|
54 */ |
|
55 //##ModelId=3C4C41AE0184 |
|
56 void Start(TInt aDelayTime); |
|
57 |
|
58 private: // Methods from CActive |
|
59 |
|
60 /** @fn RunL() |
|
61 Intended Usage : Called by active schedule when the timer is complete. |
|
62 @since 7.0 |
|
63 @todo add leaves |
|
64 @pre The timer has completed. |
|
65 @post The connection time-out has been handled. |
|
66 */ |
|
67 //##ModelId=3C4C41AE0183 |
|
68 virtual void RunL(); |
|
69 |
|
70 /** @fn RunError(TInt aError) |
|
71 Intended Usage : Error handling function for when RunL() leaves. Defers |
|
72 action to callback object. |
|
73 @since 7.0 |
|
74 @param aError The error with which RunL() left. |
|
75 @return An error code. If the input error value could be handled, |
|
76 then KErrNone is returned, otherwise the input error code |
|
77 is returned. This will cause a panic. |
|
78 */ |
|
79 //##ModelId=3C4C41AE0181 |
|
80 virtual TInt RunError(TInt aError); |
|
81 |
|
82 private: // Methods |
|
83 |
|
84 /** @fn CConnectionTimer(MConnectionTimerCallback& aCallback) |
|
85 Intended Usage : First phase constructor. |
|
86 @since 7.0 |
|
87 @param aCallback A reference to the callback object that handles |
|
88 the timer complete event. |
|
89 */ |
|
90 //##ModelId=3C4C41AE0178 |
|
91 CConnectionTimer(MConnectionTimerCallback& aCallback); |
|
92 |
|
93 /** @fn ContructL() |
|
94 Intended Usage : Second phase constructor. Does any necessary allocations. |
|
95 @since 7.0 |
|
96 @pre First phase construction has been done. |
|
97 @post The object is fully initialised. |
|
98 */ |
|
99 //##ModelId=3C4C41AE0177 |
|
100 void ConstructL(); |
|
101 |
|
102 private: // Attributes |
|
103 |
|
104 /** A reference to the callback object. |
|
105 */ |
|
106 //##ModelId=3C4C41AE016F |
|
107 MConnectionTimerCallback& iCallback; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // __CCONNECTIONTIMER_H__ |