|
1 /* |
|
2 * Copyright (c) 2006-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMMDTMFTSY_H |
|
21 #define CMMDTMFTSY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <et_tsy.h> |
|
26 |
|
27 // CONSTANTS |
|
28 const TUint16 KMaxDataBufferSize( 256 ); |
|
29 // FORWARD DECLARATIONS |
|
30 class TDataPackage; |
|
31 class CMmPhoneTsy; |
|
32 class CMmTsyReqHandleStore; |
|
33 class CMmDataPackage; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * DTMF-related functionality of Phone Tsy |
|
38 */ |
|
39 NONSHARABLE_CLASS( CMmDtmfTsy ) : public CBase |
|
40 { |
|
41 public: // types |
|
42 |
|
43 /** |
|
44 * DTMF type (single digit or string) |
|
45 */ |
|
46 enum TDtmfType |
|
47 { |
|
48 EDtmfTypeUnknown, // 0 // unknown DTMF type |
|
49 EDtmfTypeDigit, // the currently processed DTMF is one digit |
|
50 EDtmfTypeString // the currently processed DTMF is a string |
|
51 }; |
|
52 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 * @param aPhoneTsy The Phone Tsy object |
|
58 */ |
|
59 static CMmDtmfTsy* NewL( CMmPhoneTsy* aPhoneTsy ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CMmDtmfTsy(); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Handles DTMF requests |
|
70 * |
|
71 * |
|
72 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
73 * @param const TInt aIpc: request IPC number |
|
74 * @param const TDataPackage& aPackage: packaged request parameters |
|
75 * @return result of the request |
|
76 */ |
|
77 TInt DoExtFuncL( |
|
78 const TTsyReqHandle aTsyReqHandle, |
|
79 const TInt aIpc, |
|
80 const TDataPackage& aPackage ); |
|
81 |
|
82 /** |
|
83 * Cancels DTMF request |
|
84 * |
|
85 * |
|
86 * @param const TInt aIpc: request IPC number |
|
87 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
88 * @return result of the request |
|
89 */ |
|
90 virtual TInt CancelService( |
|
91 const TInt aIpc, |
|
92 const TTsyReqHandle aTsyReqHandle ); |
|
93 |
|
94 /** |
|
95 * Calls the needed complete method due timer expiration |
|
96 * |
|
97 * |
|
98 * @param const TInt aReqHandleType: req handle type. |
|
99 * @param TInt aError: error value |
|
100 * @return None |
|
101 */ |
|
102 void Complete( TInt aReqHandleType, TInt aError ); |
|
103 |
|
104 //DTMF METHODS |
|
105 |
|
106 /** |
|
107 * Get DTMF capabilities |
|
108 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
109 * |
|
110 * |
|
111 * @param TUint32* aCaps: DTMF capabilities |
|
112 * @return Return value to the ETel Server |
|
113 */ |
|
114 TInt GetDTMFCaps( const TTsyReqHandle aTsyReqHandle, TUint32* aCaps ); |
|
115 |
|
116 /** |
|
117 * Request for DTMF caps change notifications |
|
118 * |
|
119 * |
|
120 * @param TUint32* aCaps: DTMF capabilities |
|
121 * @return Return value to the ETel Server |
|
122 */ |
|
123 TInt NotifyDTMFCapsChange( TUint32* aCaps ); |
|
124 |
|
125 /** |
|
126 * Cancels DTMF caps change notifications |
|
127 * |
|
128 * |
|
129 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
130 * @return Return value to the ETel Server |
|
131 */ |
|
132 TInt NotifyDTMFCapsChangeCancel( const TTsyReqHandle aTsyReqHandle ); |
|
133 |
|
134 #ifdef USING_CTSY_DISPATCHER |
|
135 TInt GetConnectedCallId(TInt& aCallId); |
|
136 |
|
137 /** |
|
138 * Complete the Start DTMF Tone request. |
|
139 */ |
|
140 void CompleteStartDTMFTone(TInt aResult); |
|
141 |
|
142 /** |
|
143 * Complete the Stop DTMF Tone request. |
|
144 */ |
|
145 void CompleteStopDTMFTone(TInt aResult); |
|
146 #endif // USING_CTSY_DISPATCHER |
|
147 |
|
148 /** |
|
149 * Sends DTMF string |
|
150 * |
|
151 * |
|
152 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
153 * @param const TDesC* aTones, DTMF string |
|
154 * @return Return value to the ETel Server |
|
155 */ |
|
156 TInt SendDTMFTonesL( const TTsyReqHandle aTsyReqHandle, |
|
157 const TDesC* aTones ); |
|
158 |
|
159 /** |
|
160 * Cancels DTMF string sending |
|
161 * |
|
162 * |
|
163 * @return Return value to the ETel Server |
|
164 */ |
|
165 TInt SendDTMFTonesCancelL(); |
|
166 |
|
167 /** |
|
168 * Starts sending a single DTMF digit |
|
169 * |
|
170 * |
|
171 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
172 * @param TChar* aTone: tone to be played. |
|
173 * @return Return value to the ETel Server |
|
174 */ |
|
175 TInt StartDTMFToneL( const TTsyReqHandle aTsyReqHandle, TChar* aTone ); |
|
176 |
|
177 /** |
|
178 * Stops sending a single DTMF digit |
|
179 * |
|
180 * |
|
181 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
182 * @return Return value to the ETel Server |
|
183 */ |
|
184 TInt StopDTMFToneL( const TTsyReqHandle aTsyReqHandle ); |
|
185 |
|
186 /** |
|
187 * Notifies when the DTMF string sending has stopped |
|
188 * |
|
189 * |
|
190 * @return Return value to the ETel Server |
|
191 */ |
|
192 TInt NotifyStopInDTMFString(); |
|
193 |
|
194 /** |
|
195 * Cancels NotifyStopInDTMFString notifications |
|
196 * |
|
197 * |
|
198 * @param const TTsyReqHandle aTsyReqHandle: TSY request handle |
|
199 * @return Return value to the ETel Server |
|
200 */ |
|
201 TInt NotifyStopInDTMFStringCancel( const TTsyReqHandle aTsyReqHandle ); |
|
202 |
|
203 /** |
|
204 * Called when client wants notification of a DTMF Event. |
|
205 * |
|
206 * |
|
207 * @param aInfo for storing the type of event |
|
208 * @return Return KErrNone |
|
209 */ |
|
210 TInt NotifyDTMFEvent( TInt* aInfo ); |
|
211 |
|
212 /** |
|
213 * Cancels a NotifyDTMFEvent notification. |
|
214 * |
|
215 * @param aTsyReqHandle TSY request handle |
|
216 * @return KErrNone |
|
217 */ |
|
218 TInt NotifyDTMFEventCancel( const TTsyReqHandle aTsyReqHandle ); |
|
219 |
|
220 /** |
|
221 * Continues or cancels sending of stopped DTMF string |
|
222 * |
|
223 * |
|
224 * @param const TTsyReqHandle aTsyReqHandle: request handle |
|
225 * @param TBool aContinue: Boolean value that tells to |
|
226 * continue or cancel |
|
227 * @return: Return value to the Etel Server |
|
228 */ |
|
229 TInt ContinueDTMFStringSendingL( |
|
230 const TTsyReqHandle aTsyReqHandle, |
|
231 TBool aContinue ); |
|
232 |
|
233 /** |
|
234 * Complete DTMF capabilities change notification |
|
235 * |
|
236 * |
|
237 */ |
|
238 void CompleteNotifyDTMFCaps(); |
|
239 |
|
240 /** |
|
241 * Complete sending DTMF tones |
|
242 * |
|
243 * |
|
244 * @param TInt aResult, error code |
|
245 */ |
|
246 virtual void CompleteSendDTMFTones( TInt aResult ); |
|
247 |
|
248 /** |
|
249 * Complete cancel of sending DTMF tones |
|
250 * |
|
251 * |
|
252 * @param TInt aResult, error code |
|
253 */ |
|
254 virtual void CompleteSendDTMFTonesCancel( TInt aResult ); |
|
255 |
|
256 /** |
|
257 * Notifies about stop mark ('w') in DTMF string sent. |
|
258 * |
|
259 * |
|
260 * @param CMmDataPackage* aDataPackage: contains DTMF tones that |
|
261 * have not been sent yet |
|
262 */ |
|
263 virtual void CompleteNotifyStopInDTMFString( |
|
264 CMmDataPackage* aDataPackage ); |
|
265 |
|
266 /** |
|
267 * Called when notice of a DTMF tone has been received. |
|
268 * |
|
269 * |
|
270 * @param aTsyReqHandle TSY request handle |
|
271 */ |
|
272 virtual void CompleteNotifyDTMFEvent( TInt aTsyReqHandle ); |
|
273 |
|
274 /** |
|
275 * Gets the type of the currently processed DTMF |
|
276 * |
|
277 * |
|
278 * @return value of iDtmfType |
|
279 */ |
|
280 virtual TDtmfType GetDtmfType(); |
|
281 |
|
282 private: |
|
283 |
|
284 /** |
|
285 * C++ default constructor. |
|
286 */ |
|
287 CMmDtmfTsy(); |
|
288 |
|
289 /** |
|
290 * By default Symbian 2nd phase constructor is private. |
|
291 */ |
|
292 void ConstructL(); |
|
293 |
|
294 /** |
|
295 * Return the number of active calls |
|
296 */ |
|
297 TInt ActiveCalls() const; |
|
298 |
|
299 private: // member data |
|
300 |
|
301 /** |
|
302 * Pointer to phone Tsy |
|
303 */ |
|
304 CMmPhoneTsy* iMmPhone; |
|
305 |
|
306 /** |
|
307 * Member variable for storing the SendDTMFTonesCancelFlag. |
|
308 */ |
|
309 TBool iSendDTMFTonesCancelFlag; |
|
310 |
|
311 /** |
|
312 * Type of the currently processed dtmf (digit or string) |
|
313 */ |
|
314 TDtmfType iDtmfType; |
|
315 |
|
316 /** |
|
317 * Buffer for storing DTMF string after 'w' mark in the DTMF string |
|
318 */ |
|
319 TBuf<KMaxDataBufferSize> iDTMFStringToContinue; |
|
320 |
|
321 /** |
|
322 * return pointer to DtmfCaps |
|
323 */ |
|
324 TUint32* iRetDtmfCaps; |
|
325 |
|
326 TInt* iDtmfInfo; |
|
327 }; |
|
328 |
|
329 #endif // CMMDTMFTSY_H |
|
330 |
|
331 // End of File |