|
1 // Copyright (c) 2005-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 // Name : CSIPCRServerCloseTimer.cpp |
|
15 // Part of : SIP Client Resolver |
|
16 // Version : 1.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 #include "CSIPCRServerCloseTimer.h" |
|
23 |
|
24 const TUint KMicroSecondsInMilliSecond = 1000; |
|
25 |
|
26 |
|
27 // ---------------------------------------------------------------------------- |
|
28 // CSIPCRServerCloseTimer::NewL |
|
29 // ---------------------------------------------------------------------------- |
|
30 // |
|
31 CSIPCRServerCloseTimer* CSIPCRServerCloseTimer::NewL() |
|
32 { |
|
33 CSIPCRServerCloseTimer* self = CSIPCRServerCloseTimer::NewLC (); |
|
34 CleanupStack::Pop (self); |
|
35 return self; |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // CSIPCRServerCloseTimer::NewLC |
|
40 // ---------------------------------------------------------------------------- |
|
41 // |
|
42 CSIPCRServerCloseTimer* CSIPCRServerCloseTimer::NewLC () |
|
43 { |
|
44 CSIPCRServerCloseTimer* self = new(ELeave)CSIPCRServerCloseTimer; |
|
45 CleanupStack::PushL (self); |
|
46 self->ConstructL (); |
|
47 return self; |
|
48 } |
|
49 |
|
50 // ---------------------------------------------------------------------------- |
|
51 // CSIPCRServerCloseTimer::ConstructL |
|
52 // ---------------------------------------------------------------------------- |
|
53 // |
|
54 void CSIPCRServerCloseTimer::ConstructL () |
|
55 { |
|
56 User::LeaveIfError (iTimer.CreateLocal()); |
|
57 } |
|
58 |
|
59 |
|
60 // ---------------------------------------------------------------------------- |
|
61 // CSIPCRServerCloseTimer::ConstructL |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
|
64 CSIPCRServerCloseTimer::CSIPCRServerCloseTimer () |
|
65 : CActive(EPriorityStandard) |
|
66 { |
|
67 CActiveScheduler::Add(this); |
|
68 } |
|
69 |
|
70 |
|
71 // ---------------------------------------------------------------------------- |
|
72 // CSIPCRServerCloseTimer::~CSIPCRServerCloseTimer |
|
73 // ---------------------------------------------------------------------------- |
|
74 // |
|
75 CSIPCRServerCloseTimer::~CSIPCRServerCloseTimer () |
|
76 { |
|
77 CActive::Cancel(); |
|
78 iTimer.Close(); |
|
79 } |
|
80 |
|
81 // ---------------------------------------------------------------------------- |
|
82 // CSIPCRServerCloseTimer::StopActiveSchedulerAfter |
|
83 // ---------------------------------------------------------------------------- |
|
84 // |
|
85 void CSIPCRServerCloseTimer::StopActiveSchedulerAfter (TUint aMilliSeconds) |
|
86 { |
|
87 TTimeIntervalMicroSeconds32 time(KMicroSecondsInMilliSecond*aMilliSeconds); |
|
88 if (!IsActive()) |
|
89 { |
|
90 iTimer.After(iStatus,time); |
|
91 SetActive (); |
|
92 } |
|
93 } |
|
94 |
|
95 // ---------------------------------------------------------------------------- |
|
96 // CSIPCRServerCloseTimer::RunL |
|
97 // ---------------------------------------------------------------------------- |
|
98 // |
|
99 void CSIPCRServerCloseTimer::RunL () |
|
100 { |
|
101 CActiveScheduler::Stop(); |
|
102 } |
|
103 |
|
104 // ---------------------------------------------------------------------------- |
|
105 // CSIPCRServerCloseTimer::DoCancel |
|
106 // ---------------------------------------------------------------------------- |
|
107 // |
|
108 void CSIPCRServerCloseTimer::DoCancel () |
|
109 { |
|
110 iTimer.Cancel(); |
|
111 } |
|
112 |
|
113 // End of File |
|
114 |