|
1 /* |
|
2 * Copyright (c) 2002-2004 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 Request. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "CPhSrvCallRequest.h" |
|
22 #include "PhSrvUtils.h" |
|
23 |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CPhSrvNotificationManager::CPhSrvCallRequest |
|
30 // |
|
31 // C++ constructor |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CPhSrvCallRequest::CPhSrvCallRequest( |
|
35 const RMessage2& aMessage, |
|
36 CPhCltExtPhoneDialData& aArguments, |
|
37 TInt aSubSessionHandle ) |
|
38 : iPendingRequestPointer( aMessage ), |
|
39 iSubSessionHandle( aSubSessionHandle ) |
|
40 { |
|
41 iCallArguments = &aArguments; |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CPhSrvNotificationManager::CPhSrvCallRequest |
|
46 // |
|
47 // C++ constructor |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CPhSrvCallRequest::CPhSrvCallRequest() |
|
51 { |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CPhSrvNotificationManager::NewLC |
|
56 // |
|
57 // Static Symbian OS two-phase constructor. Return an instance |
|
58 // and leave it on the cleanup stack. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CPhSrvCallRequest* CPhSrvCallRequest::NewLC( |
|
62 const RMessage2& aMessage, |
|
63 CPhCltExtPhoneDialData& aArguments, |
|
64 TInt aSubSessionHandle ) |
|
65 { |
|
66 CPhSrvCallRequest* self = new( ELeave ) CPhSrvCallRequest( |
|
67 aMessage, |
|
68 aArguments, |
|
69 aSubSessionHandle ); |
|
70 CleanupStack::PushL( self ); |
|
71 |
|
72 return self; |
|
73 } |
|
74 |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CPhSrvNotificationManager::NewL |
|
78 // |
|
79 // Static Symbian OS two-phase constructor. |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 CPhSrvCallRequest* CPhSrvCallRequest::NewL() |
|
83 { |
|
84 CPhSrvCallRequest* self = new( ELeave ) CPhSrvCallRequest(); |
|
85 |
|
86 return self; |
|
87 } |
|
88 |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CPhSrvNotificationManager::InformOfCallAttemptResult |
|
92 // |
|
93 // Complete a client request which will indicate the result |
|
94 // of attempting to dial a number. |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 void CPhSrvCallRequest::InformOfCallAttemptResult( |
|
98 TPhCltPhoneResults aResultOfAttemptingCall ) |
|
99 { |
|
100 // Complete the client's pending request, indicating |
|
101 // the result of the attempt. |
|
102 iPendingRequestPointer.Complete( aResultOfAttemptingCall ); |
|
103 } |
|
104 |
|
105 |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CPhSrvNotificationManager::Cancel |
|
109 // |
|
110 // Complete the client's request with KErrCancel |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 void CPhSrvCallRequest::Cancel() |
|
114 { |
|
115 iPendingRequestPointer.Complete( KErrCancel ); |
|
116 } |
|
117 |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CPhSrvNotificationManager::SubSessionHandle |
|
121 // |
|
122 // Return the handle of the subsession that initiated the |
|
123 // original dial request. |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 TInt CPhSrvCallRequest::SubSessionHandle() const |
|
127 { |
|
128 return iSubSessionHandle; |
|
129 } |
|
130 |
|
131 |
|
132 // ----------------------------------------------------------------------------- |
|
133 // CPhSrvNotificationManager::CallArguments |
|
134 // |
|
135 // Returns the call arguments |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 CPhCltExtPhoneDialData& CPhSrvCallRequest::CallArguments() const |
|
139 { |
|
140 return *iCallArguments; |
|
141 |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CPhSrvNotificationManager::UpdateEmercgencyCall |
|
146 // |
|
147 // Set new parameter to emergency object. |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 void CPhSrvCallRequest::UpdateEmercgencyCall( |
|
151 const RMessage2& aMessage, |
|
152 CPhCltExtPhoneDialData& aArguments, |
|
153 TInt aSubSessionHandle) |
|
154 { |
|
155 |
|
156 __ASSERT_ALWAYS( aArguments.TelephoneNumber() == KPhSrvUsedEmergencyCallNumber, |
|
157 PhoneServerUtils::Panic( |
|
158 EPhoneServerPanicEmergencyCallRequestFailure ) ); |
|
159 |
|
160 iPendingRequestPointer = aMessage; |
|
161 iCallArguments = &aArguments; |
|
162 iSubSessionHandle = aSubSessionHandle; |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CPhSrvNotificationManager::ClearEmergencyCall |
|
167 // |
|
168 // Emtpies Emergency call data |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 void CPhSrvCallRequest::ClearEmergencyCall() |
|
172 { |
|
173 if ( iSubSessionHandle == 0 ) |
|
174 { |
|
175 return; |
|
176 } |
|
177 __ASSERT_ALWAYS( |
|
178 iCallArguments->TelephoneNumber() == KPhSrvUsedEmergencyCallNumber, |
|
179 PhoneServerUtils::Panic( |
|
180 EPhoneServerPanicEmergencyCallRequestFailure ) ); |
|
181 iSubSessionHandle = 0; |
|
182 } |
|
183 |
|
184 |
|
185 // End of File |