|
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: DTMF API to be used through Qt Highway. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QDebug> |
|
19 #include <xqserviceutil.h> |
|
20 #include <e32base.h> |
|
21 #include "dtmfservice.h" |
|
22 |
|
23 DTMFService::DTMFService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : |
|
24 XQServiceProvider(QLatin1String("com.nokia.services.telephony.dtmf"), parent), m_call (call), m_parameters (parameters) |
|
25 { |
|
26 publishAll(); |
|
27 } |
|
28 |
|
29 DTMFService::~DTMFService() |
|
30 { |
|
31 } |
|
32 |
|
33 void DTMFService::executeKeySequence(const QString& keySequence) |
|
34 { |
|
35 qDebug () << "DTMFService::executeKeySequence keySequence:" << keySequence; |
|
36 TPtrC16 keySequencePtr (reinterpret_cast<const TUint16*>(keySequence.utf16 ())); |
|
37 m_parameters.SetPhoneNumber (keySequencePtr); |
|
38 } |
|
39 |
|
40 void DTMFService::playDTMFTone(const QChar& keyToPlay) |
|
41 { |
|
42 qDebug () << "DTMFService::playDTMFTone keyToPlay:" << keyToPlay; |
|
43 m_parameters.SetKeyCode(keyToPlay.unicode()); |
|
44 TRAP_IGNORE( m_call.HandlePlayDTMFL() ); |
|
45 } |
|
46 |
|
47 void DTMFService::stopDTMFPlay() |
|
48 { |
|
49 qDebug () << "DTMFService::stopDTMFPlay"; |
|
50 m_call.HandleEndDTMF(); |
|
51 } |