|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Call Notify |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // Include Files |
|
21 #include <CPhCltEmergencyCall.h> // for TPhCltEmergencyNumber |
|
22 #include <CPhCltCallNotify.h> |
|
23 #include <cphcltdialdata.h> |
|
24 #include <mphcltdialrequestobserver.h> |
|
25 |
|
26 #include "RPhCltServer.h" |
|
27 #include "CPhCltExtPhoneDialData.h" |
|
28 #include "RPhCltCallNotify.h" |
|
29 #include "cphcltdialrequestmonitor.h" |
|
30 #include "cphcltdialemergencyrequestmonitor.h" |
|
31 #include "cphcltcomhandrequestmonitor.h" |
|
32 |
|
33 // ============================= LOCAL FUNCTIONS =============================== |
|
34 |
|
35 |
|
36 |
|
37 // ============================ MEMBER FUNCTIONS =============================== |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CPhCltCallNotify::CPhCltCallNotify |
|
41 // C++ constructor can NOT contain any code, that |
|
42 // might leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 CPhCltCallNotify::CPhCltCallNotify() |
|
46 { |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CPhCltCallNotify::NewL |
|
51 // Two-phased constructor. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 EXPORT_C CPhCltCallNotify* CPhCltCallNotify::NewL() |
|
55 { |
|
56 CPhCltCallNotify* self = new ( ELeave ) CPhCltCallNotify; |
|
57 CleanupStack::PushL( self ); |
|
58 self->ConstructL(); |
|
59 CleanupStack::Pop( self ); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // Destructor |
|
64 EXPORT_C CPhCltCallNotify::~CPhCltCallNotify() |
|
65 { |
|
66 delete iComHandMonitor; |
|
67 delete iDialMonitor; |
|
68 delete iDialEmergencyMonitor; |
|
69 delete iCallNotify; |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CPhCltCallNotify::Open |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 EXPORT_C TInt CPhCltCallNotify::Open( RPhCltServer& aServer ) |
|
77 { |
|
78 TInt retVal = iCallNotify->Open( aServer ); |
|
79 return retVal; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CPhCltCallNotify::Close |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 EXPORT_C void CPhCltCallNotify::Close() |
|
87 { |
|
88 iCallNotify->Close(); |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // CPhCltCallNotify::NotifyCallAttempt |
|
93 // |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C void CPhCltCallNotify::NotifyDialRequest( |
|
97 MPhCltDialRequestObserver* aObserver ) |
|
98 { |
|
99 iDialMonitor->NotifyDialRequest( aObserver ); |
|
100 } |
|
101 |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CPhCltCallNotify::CancelNotifyCallAttempt |
|
105 // |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 EXPORT_C void CPhCltCallNotify::CancelNotifyDialRequest() |
|
109 { |
|
110 iDialMonitor->Cancel(); |
|
111 } |
|
112 |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // CPhCltCallNotify::RespondClient |
|
116 // |
|
117 // ----------------------------------------------------------------------------- |
|
118 // |
|
119 EXPORT_C TInt CPhCltCallNotify::RespondClient( const TInt aResultCode ) |
|
120 { |
|
121 return iDialMonitor->RespondClient( aResultCode ); |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CPhCltCallNotify::NotifyEmergencyCall() |
|
126 // |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 EXPORT_C void CPhCltCallNotify::NotifyEmergencyCall( |
|
130 MPhCltDialEmergencyRequestObserver* aObserver, |
|
131 TDesC& aEmergencyNumber ) |
|
132 { |
|
133 iDialEmergencyMonitor->NotifyEmergencyCall( aObserver, aEmergencyNumber ); |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // CPhCltCallNotify::CancelNotifyEmergencyCall() |
|
138 // |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 EXPORT_C void CPhCltCallNotify::CancelNotifyEmergencyCall() const |
|
142 { |
|
143 iDialEmergencyMonitor->Cancel(); |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // CPhCltCallNotify::RespondEmergencyToClient() |
|
148 // |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C TInt CPhCltCallNotify::RespondEmergencyToClient( |
|
152 const TInt aResultCode ) |
|
153 { |
|
154 return iDialEmergencyMonitor->RespondEmergencyToClient( aResultCode ); |
|
155 } |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CPhCltCallNotify::NotifyComHandCommand |
|
159 // |
|
160 // ----------------------------------------------------------------------------- |
|
161 // |
|
162 EXPORT_C void CPhCltCallNotify::NotifyComHandCommand( |
|
163 MPhCltComHandRequestObserver* aObserver, TDes8& aCommandArgs ) |
|
164 { |
|
165 iComHandMonitor->NotifyComHandCommand( aObserver, aCommandArgs ); |
|
166 } |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CPhCltCallNotify::CancelNotifyComHandCommand |
|
170 // |
|
171 // ----------------------------------------------------------------------------- |
|
172 // |
|
173 EXPORT_C void CPhCltCallNotify::CancelNotifyComHandCommand() const |
|
174 { |
|
175 iComHandMonitor->Cancel(); |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CPhCltCallNotify::RespondComHandClient |
|
180 // |
|
181 // ----------------------------------------------------------------------------- |
|
182 // |
|
183 EXPORT_C TInt CPhCltCallNotify::RespondComHandClient( |
|
184 const TInt aResultCode ) |
|
185 { |
|
186 return iComHandMonitor->RespondComHandClient( aResultCode ); |
|
187 } |
|
188 |
|
189 |
|
190 void CPhCltCallNotify::ConstructL() |
|
191 { |
|
192 iCallNotify = new (ELeave) RPhCltCallNotify(); |
|
193 iDialMonitor = CPhCltDialRequestMonitor::NewL(*iCallNotify); |
|
194 iComHandMonitor = CPhCltComHandRequestMonitor::NewL(*iCallNotify); |
|
195 iDialEmergencyMonitor = CPhCltDialEmergencyRequestMonitor::NewL(*iCallNotify); |
|
196 } |
|
197 |
|
198 // End of File |