phoneapp/phoneuiqtviewadapter/src/telephonyservice.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: telephony service
       
    15 *
       
    16 */
       
    17 
       
    18 #include <QDebug>
       
    19 #include <xqserviceutil.h>
       
    20 #include "telephonyservice.h"
       
    21 #include "phoneuiqtviewadapter.h"
       
    22 #include "tphonecmdparaminteger.h"
       
    23     
       
    24 TelephonyService::TelephonyService( PhoneUIQtViewAdapter *viewAdapter, QObject* parent) : 
       
    25     XQServiceProvider(QLatin1String("com.nokia.services.telephony.uistarter"), parent),
       
    26     m_viewAdapter (viewAdapter)
       
    27 {
       
    28     qDebug () << "TelephonyService::TelephonyService";
       
    29     publishAll();
       
    30 }
       
    31 
       
    32 TelephonyService::~TelephonyService()
       
    33 {
       
    34     qDebug () << "TelephonyService::~TelephonyService";
       
    35 }
       
    36 
       
    37 void TelephonyService::start(const int serviceId)
       
    38 {
       
    39     qDebug () << "TelephonyService::start:"  << serviceId;
       
    40     switch (serviceId) {
       
    41         case 0: {
       
    42             TPhoneCmdParamInteger uidParam;
       
    43             uidParam.SetInteger( KUidPhoneApplication.iUid );
       
    44             m_viewAdapter->ExecuteCommandL(EPhoneViewBringAppToForeground, &uidParam);
       
    45             break;
       
    46         }
       
    47         case 1: {
       
    48             m_viewAdapter->ExecuteCommandL( EPhoneViewOpenDialer );
       
    49             
       
    50             /*TODO: remove this as soon as QT Highway brings in call dialer to foreground*/
       
    51             TPhoneCmdParamInteger uidParam;
       
    52             uidParam.SetInteger( KUidPhoneApplication.iUid );
       
    53             m_viewAdapter->ExecuteCommandL(EPhoneViewBringAppToForeground, &uidParam);
       
    54             break;
       
    55         }
       
    56         default: {
       
    57             // do nothing
       
    58             break;
       
    59         }
       
    60     }
       
    61 }