btobexprofiles/obexsendservices/obexhighway/src/btsendserviceinterface.cpp
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2010 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 #include "btsendserviceinterface.h"
       
    20 #include "btsendserviceprovider.h"
       
    21 
       
    22 BTSendServiceInterface::BTSendServiceInterface(QObject* parent)
       
    23 : XQServiceProvider("obexhighway.com.nokia.symbian.IFileShare",parent)
       
    24     {
       
    25     publishAll();
       
    26     }
       
    27 
       
    28   
       
    29 void BTSendServiceInterface::send(QVariant data)
       
    30     {
       
    31     QList<QVariant> arguments;
       
    32     
       
    33     if(data.type()==QVariant::String)
       
    34         {
       
    35         arguments.append(data);
       
    36         }
       
    37     else
       
    38         {
       
    39         arguments.append(data.toList());
       
    40         }
       
    41     CBtSendServiceProvider *btSendServiceProvider = NULL;
       
    42     TRAPD(err,btSendServiceProvider = CBtSendServiceProvider::NewL());
       
    43     //todo need to decide what needs to be return to the service client if error occurs also how to do it
       
    44     if(err)
       
    45         return;
       
    46     btSendServiceProvider->send(arguments);
       
    47     delete btSendServiceProvider;
       
    48     }