phoneengine/phoneservices/src/dialservice.cpp
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     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:  dial service
       
    15 *
       
    16 */
       
    17 
       
    18 #include <QDebug>
       
    19 #include <xqserviceutil.h>
       
    20 #include <e32base.h>
       
    21 #include "dialservice.h"
       
    22 
       
    23 DialService::DialService(MPECallControlIF &call, MPECallSettersIF &parameters, QObject* parent) : 
       
    24     XQServiceProvider(QLatin1String("com.nokia.services.telephony"), parent), m_call (call), m_parameters (parameters)
       
    25 {
       
    26     publishAll();
       
    27 }
       
    28 
       
    29 DialService::~DialService()
       
    30 {
       
    31 }
       
    32 
       
    33 int DialService::dial(const QString& number)
       
    34 {
       
    35     qDebug () << "DialService::dial number:" << number;
       
    36     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(number.utf16 ()));
       
    37     m_parameters.SetPhoneNumber (numberPtr);
       
    38     m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
       
    39     return m_call.HandleDialServiceCall ();
       
    40 }
       
    41 
       
    42 int DialService::dial(const QString& number, int contactId)
       
    43 {
       
    44     qDebug () << "DialService::dial number:" << number;
       
    45     qDebug () << "DialService::dial contactId:" << contactId;
       
    46     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(number.utf16 ()));
       
    47     m_parameters.SetPhoneNumber (numberPtr);
       
    48     m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
       
    49     m_parameters.SetContactId2 (contactId);
       
    50     return m_call.HandleDialServiceCall (); 
       
    51 }
       
    52 
       
    53 void DialService::dialVideo(const QString& number)
       
    54 {
       
    55     qDebug () << "DialService::dialVideo number:" << number;
       
    56     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(number.utf16 ()));
       
    57     m_parameters.SetPhoneNumber (numberPtr);
       
    58     m_parameters.SetCallTypeCommand (EPECallTypeVideo);
       
    59     m_call.HandleDialServiceCall ();
       
    60 }
       
    61 
       
    62 void DialService::dialVideo(const QString& number, int contactId)
       
    63 {
       
    64     qDebug () << "DialService::dialVideo number:" << number;
       
    65     qDebug () << "DialService::dialVideo contactId:" << contactId;
       
    66     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(number.utf16 ()));
       
    67     m_parameters.SetPhoneNumber (numberPtr);
       
    68     m_parameters.SetCallTypeCommand (EPECallTypeVideo);
       
    69     m_parameters.SetContactId2 (contactId);
       
    70     m_call.HandleDialServiceCall ();    
       
    71 }
       
    72 
       
    73 void DialService::dialVoip(const QString& address)
       
    74 {
       
    75     qDebug () << "DialService::dialVoip number:" << address;
       
    76     TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(address.utf16 ()));
       
    77     m_parameters.SetPhoneNumber(numberPtr);
       
    78     m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
       
    79     m_call.HandleDialServiceCall();    
       
    80 }
       
    81 
       
    82 void DialService::dialVoip(const QString& address, int contactId)
       
    83 {
       
    84     qDebug () << "DialService::dialVoip number:" << address;
       
    85     qDebug () << "DialService::dialVoip contactId:" << contactId;
       
    86     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
       
    87     m_parameters.SetPhoneNumber(numberPtr);
       
    88     m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
       
    89     m_parameters.SetContactId2(contactId);
       
    90     m_call.HandleDialServiceCall();    
       
    91 }
       
    92 
       
    93 void DialService::dialVoipService(const QString& address, int serviceId)
       
    94 {
       
    95     qDebug () << "DialService::dialVoipService number:" << address;
       
    96     qDebug () << "DialService::dialVoipService serviceId:" << serviceId;
       
    97     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
       
    98     m_parameters.SetPhoneNumber(numberPtr);
       
    99     m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
       
   100     m_parameters.SetServiceIdCommand(serviceId);
       
   101     m_call.HandleDialServiceCall();    
       
   102 }
       
   103 
       
   104 void DialService::dialVoipService(
       
   105         const QString& address, int serviceId, int contactId)
       
   106 {
       
   107     qDebug () << "DialService::dialVoipService number:" << address;
       
   108     qDebug () << "DialService::dialVoipService serviceId:" << serviceId;
       
   109     qDebug () << "DialService::dialVoipService contactId:" << contactId;
       
   110     TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
       
   111     m_parameters.SetPhoneNumber(numberPtr);
       
   112     m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
       
   113     m_parameters.SetServiceIdCommand(serviceId);
       
   114     m_parameters.SetContactId2(contactId);
       
   115     m_call.HandleDialServiceCall();    
       
   116 }