|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Implements CSPConferenceCall for CS Call Plug-in |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CSPCONFERENCECALL_H |
|
21 #define CSPCONFERENCECALL_H |
|
22 |
|
23 #include <mccpconferencecall.h> |
|
24 #include <mccpconferencecallobserver.h> |
|
25 #include <mccpcallobserver.h> |
|
26 #include <mccpcscall.h> |
|
27 #include <etel.h> |
|
28 #include <etelmm.h> |
|
29 |
|
30 #include "mcspconferencestatusobserver.h" |
|
31 #include "cspconsts.h" |
|
32 #include "cspetelconferencecallrequester.h" // For the requester and TConferenceRequestType |
|
33 |
|
34 |
|
35 class MCCPForwardProvider; |
|
36 class MCCPTransferProvider; |
|
37 class MCCPObserver; |
|
38 class MCSPCallInformation; |
|
39 class CSPConferenceCallObserver; |
|
40 class RMobileConferenceCall; |
|
41 class CSPEtelConferenceStatusMonitor; |
|
42 class CSPEtelConferenceEventMonitor; |
|
43 class CSPEtelConferenceCapsMonitor; |
|
44 |
|
45 |
|
46 /** |
|
47 * Call class for CS Call Plug-in. Implements the API defined by CCP in classes |
|
48 * MCCPCall and MCCPCSCall |
|
49 * |
|
50 * @lib csplugin.dll |
|
51 */ |
|
52 class CSPConferenceCall : public CBase, |
|
53 public MCCPConferenceCall, |
|
54 public MCSPConferenceStatusObserver |
|
55 { |
|
56 |
|
57 public: |
|
58 /* |
|
59 * Creates a new CSPConferenceCall object. |
|
60 * @param aPhone reference to phone object |
|
61 * @return pointer to created call object |
|
62 * @param aServiceId the service id |
|
63 */ |
|
64 static CSPConferenceCall* NewL( |
|
65 RMobilePhone& aPhone, |
|
66 MCSPCallInformation& aCallInfo, |
|
67 TUint32 aServiceId ); |
|
68 |
|
69 /* |
|
70 * C++ default destructor |
|
71 */ |
|
72 virtual ~CSPConferenceCall( ); |
|
73 |
|
74 /** |
|
75 * Getter for observer |
|
76 * @return observer for CS calls. |
|
77 */ |
|
78 MCCPCallObserver* Observer() const; |
|
79 |
|
80 /** |
|
81 * Notifies call specific event to observers. |
|
82 * @param aEvent conference event that was occurred |
|
83 * @param aCallName the name of the related call object |
|
84 */ |
|
85 void NotifyEvent( |
|
86 MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent, |
|
87 TName& aCallName ); |
|
88 |
|
89 /** |
|
90 * Notifies non-'call specific' event to observers. |
|
91 * @param aEvent conference event that was occurred, |
|
92 */ |
|
93 void NotifyEvent( |
|
94 MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent ); |
|
95 |
|
96 /** |
|
97 * Notifies about conference call request related errors. |
|
98 */ |
|
99 void NotifyConferenceError( TCCPConferenceCallError aErr ); |
|
100 |
|
101 /** |
|
102 * Handles caps change. |
|
103 * @param aNewCaps new caps |
|
104 */ |
|
105 void ConferenceCapsChanged( TUint32 aNewCaps ); |
|
106 |
|
107 // from base class MCSPConferenceStatusObserver |
|
108 |
|
109 /** |
|
110 * From MCSPConferenceStatusObserver. |
|
111 * Notifies event to observers. |
|
112 * @param aStatus new status of the conference call |
|
113 */ |
|
114 void NotifyStateChange( |
|
115 MCSPConferenceStatusObserver::TCSPConferenceState aStatus ); |
|
116 |
|
117 // from base class MCCPConferenceCall |
|
118 |
|
119 /** |
|
120 * From MCCPConferenceCall. |
|
121 * Adds new call to conference call. |
|
122 * @param aCall Call to be added to conference |
|
123 * @return Leaves in case of an error. |
|
124 * KErrArgument, KErrNoMemory |
|
125 */ |
|
126 void AddCallL( MCCPCall* aCall ); |
|
127 |
|
128 /** |
|
129 * From MCCPConferenceCall. |
|
130 * Removes call from conference call. |
|
131 * @param aCall Call to be removed from conference |
|
132 * @return In error case leaves. |
|
133 * KErrArgument, KErrNotFound |
|
134 */ |
|
135 void RemoveCallL( MCCPCall* aCall ); |
|
136 |
|
137 /** |
|
138 * From MCCPConferenceCall. |
|
139 * Returns number of calls in conference call. |
|
140 * @param aCallCount Number of calls in conference. |
|
141 * @return KErrNone if succesfull, otherwise system wide error code. |
|
142 */ |
|
143 TInt CallCount( ) const; |
|
144 |
|
145 /** |
|
146 * From MCCPConferenceCall. |
|
147 * Switch to a private call with one call from conference call. |
|
148 * @param aCall Call to be removed from conference |
|
149 * @return In error case leaves. |
|
150 * KErrArgument, KErrNotFound |
|
151 */ |
|
152 void GoOneToOneL( MCCPCall& aCall ); |
|
153 |
|
154 /** |
|
155 * Adds current calls (1 hold + connected ) |
|
156 * to part of conference |
|
157 * @leave In case of an error system wide error code |
|
158 */ |
|
159 void CurrentCallsToConferenceL(); |
|
160 |
|
161 /** |
|
162 * From MCCPConferenceCall |
|
163 * Returns serviceId |
|
164 * @since S60 3.2 |
|
165 * @return TUint32 ServiceId |
|
166 */ |
|
167 TUint32 ServiceId() const; |
|
168 |
|
169 /** |
|
170 * From MCCPConferencCall |
|
171 * Ends an ongoing call. |
|
172 * @since S60 3.2 |
|
173 */ |
|
174 TInt HangUp(); |
|
175 |
|
176 /** |
|
177 * From MCCPConferenceCall |
|
178 * Puts the specified call on hold. |
|
179 * @since S60 3.2 |
|
180 */ |
|
181 TInt Hold(); |
|
182 |
|
183 /** |
|
184 * From MCCPConferenceCall |
|
185 * Resumes the call. |
|
186 * @since S60 3.2 |
|
187 */ |
|
188 TInt Resume(); |
|
189 |
|
190 /** |
|
191 * From MCCPConferenceCall |
|
192 * Swaps a connected call to its opposite state either active or on hold |
|
193 * @since S60 3.2 |
|
194 */ |
|
195 TInt Swap(); |
|
196 |
|
197 /** |
|
198 * Adds a new observer for the conference call object. |
|
199 * @since S60 3.2 |
|
200 * @param aObserver the conference observer to be added |
|
201 */ |
|
202 void AddObserverL( const MCCPConferenceCallObserver& aObserver ); |
|
203 |
|
204 /** |
|
205 * Removes an observer. |
|
206 * @since S60 3.2 |
|
207 * @param aObserver the observer to be removed |
|
208 * @return system wide error code |
|
209 */ |
|
210 TInt RemoveObserver( const MCCPConferenceCallObserver& aObserver ); |
|
211 |
|
212 /** |
|
213 * Get conference participants. |
|
214 * @since S60 5.0 |
|
215 * @param aCallArray array where participating calls are stored |
|
216 * @return system wide error code |
|
217 */ |
|
218 TInt GetCallArray( RPointerArray<MCCPCall>& aCallArray ); |
|
219 |
|
220 private: |
|
221 |
|
222 /* |
|
223 * C++ default constructor |
|
224 * @param aPhone handle to the ETel Phone |
|
225 * @param aCallInfo call information |
|
226 * @param aServiceId service id |
|
227 */ |
|
228 CSPConferenceCall( RMobilePhone& aPhone, |
|
229 MCSPCallInformation& aCallInfo, |
|
230 TUint32 aServiceId ); |
|
231 |
|
232 /* |
|
233 * Constructing 2nd phase. |
|
234 * @since S60 3.2 |
|
235 * @param aObserver the CCP call observer, |
|
236 */ |
|
237 void ConstructL( ); |
|
238 |
|
239 /** |
|
240 * Get conference state from ETel. |
|
241 * @since S60 5.0 |
|
242 * @param aState param for storing conference call state |
|
243 * @return system wide error code |
|
244 */ |
|
245 TInt GetConferenceCallState( |
|
246 MCCPConferenceCallObserver::TCCPConferenceCallState& aState ); |
|
247 |
|
248 private: |
|
249 |
|
250 /** |
|
251 * Call status monitor. |
|
252 * Own. |
|
253 */ |
|
254 CSPEtelConferenceStatusMonitor* iCallStatusMonitor; |
|
255 |
|
256 /** |
|
257 * Call event monitor. |
|
258 * Own. |
|
259 */ |
|
260 CSPEtelConferenceEventMonitor* iCallEventMonitor; |
|
261 |
|
262 /** |
|
263 * Call caps monitor. |
|
264 * Own. |
|
265 */ |
|
266 CSPEtelConferenceCapsMonitor* iCallCapsMonitor; |
|
267 |
|
268 /** |
|
269 * ETel call object |
|
270 */ |
|
271 RMobileConferenceCall iCall; |
|
272 |
|
273 /** |
|
274 * ETel phone |
|
275 */ |
|
276 RMobilePhone& iPhone; |
|
277 |
|
278 /** |
|
279 * Conference call state. |
|
280 */ |
|
281 MCCPConferenceCallObserver::TCCPConferenceCallState iCallState; |
|
282 |
|
283 /** |
|
284 * Makes the asynchronic requests for various purposes. |
|
285 */ |
|
286 CSPEtelConferenceCallRequester* iRequester; |
|
287 |
|
288 /** |
|
289 * Observer array for conference states, events and errors. |
|
290 */ |
|
291 RPointerArray<MCCPConferenceCallObserver> iObservers; |
|
292 |
|
293 /** |
|
294 * Call count for adding call. |
|
295 */ |
|
296 TInt iCallCountForAddCall; |
|
297 |
|
298 /** |
|
299 * Call Information for resolving call pointers from |
|
300 * the call names. |
|
301 */ |
|
302 MCSPCallInformation& iCallInfo; |
|
303 |
|
304 /** |
|
305 * Service ID |
|
306 */ |
|
307 TUint32 iServiceId; |
|
308 |
|
309 /** |
|
310 * Call name of a last call added to this conference.. |
|
311 */ |
|
312 TName iAddedCallName; |
|
313 |
|
314 }; |
|
315 |
|
316 #endif // CSPCONFERENCECALL_H |