|
1 /* |
|
2 * Copyright (c) 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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "delaytimer.h" |
|
20 #include "tmsutility.h" |
|
21 |
|
22 using namespace TMS; |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // TMSCallDelayTimer::NewL |
|
26 // Two-phased constructor. |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 TMSCallDelayTimer* TMSCallDelayTimer::NewL() |
|
30 { |
|
31 TRACE_PRN_FN_ENT; |
|
32 TMSCallDelayTimer* self = new (ELeave) TMSCallDelayTimer; |
|
33 CleanupStack::PushL(self); |
|
34 self->ConstructL(); |
|
35 CleanupStack::Pop(self); |
|
36 TRACE_PRN_FN_EXT; |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // TMSCallDelayTimer::TMSCallDelayTimer() |
|
42 // C++ constructor. |
|
43 // (other items were commented in a header). |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 TMSCallDelayTimer::TMSCallDelayTimer() : |
|
47 CActive(CActive::EPriorityStandard) |
|
48 { |
|
49 TRACE_PRN_FN_ENT; |
|
50 CActiveScheduler::Add(this); |
|
51 TRACE_PRN_FN_EXT; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // TMSCallDelayTimer::ConstructL |
|
56 // Symbian 2nd phase constructor can leave. |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 void TMSCallDelayTimer::ConstructL() |
|
60 { |
|
61 TRACE_PRN_FN_ENT; |
|
62 User::LeaveIfError(iShutDownTimer.CreateLocal()); |
|
63 TRACE_PRN_FN_EXT; |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // TMSCallDelayTimer::~TMSCallDelayTimer |
|
68 // Destructor |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 TMSCallDelayTimer::~TMSCallDelayTimer() |
|
72 { |
|
73 TRACE_PRN_FN_ENT; |
|
74 Cancel(); |
|
75 iShutDownTimer.Close(); |
|
76 TRACE_PRN_FN_EXT; |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // TMSCallDelayTimer::SetDelay |
|
81 // Request a timeout after aDelay |
|
82 // (other items were commented in a header). |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 void TMSCallDelayTimer::SetDelay(TTimeIntervalMicroSeconds32 aDelay) |
|
86 { |
|
87 TRACE_PRN_FN_ENT; |
|
88 if (!IsActive()) |
|
89 { |
|
90 SetActive(); |
|
91 iShutDownTimer.After(iStatus, aDelay); |
|
92 } |
|
93 TRACE_PRN_FN_EXT; |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // TMSCallDelayTimer::RunL |
|
98 // Called by Active object framework when timer times out. |
|
99 // (other items were commented in a header). |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 void TMSCallDelayTimer::RunL() |
|
103 { |
|
104 TRACE_PRN_FN_ENT; |
|
105 CActiveScheduler::Stop(); |
|
106 TRACE_PRN_FN_EXT; |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // TMSCallDelayTimer::DoCancel |
|
111 // Called by the Active object framework when user cancels active object. |
|
112 // (other items were commented in a header). |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 void TMSCallDelayTimer::DoCancel() |
|
116 { |
|
117 TRACE_PRN_FN_ENT; |
|
118 iShutDownTimer.Cancel(); |
|
119 TRACE_PRN_FN_EXT; |
|
120 } |
|
121 |
|
122 // End of File |