smf/smfservermodule/smfclient/client/smfclient_p.cpp
changeset 7 be09cf1f39dd
child 13 b5d63d5fc252
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
       
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "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  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  */
       
    15 
       
    16 #include "smfclient_p.h"
       
    17 
       
    18 SmfClientPrivate::SmfClientPrivate(SmfClient* client):m_client(client)
       
    19 	{
       
    20 	m_client->writeLog("SmfClientPrivate::SmfClientPrivate");
       
    21 	//private impl for symbian
       
    22 	#ifdef Q_OS_SYMBIAN
       
    23 	m_SmfClientPrivate = CSmfClientSymbian::NewL(this);
       
    24 	#endif
       
    25 
       
    26 	}
       
    27 QList<SmfProvider>* SmfClientPrivate::GetServices(const QString serviceName)
       
    28 	{
       
    29 	m_client->writeLog("SmfClientPrivate::GetServices");
       
    30 	m_baseProvider = NULL;
       
    31 	  
       
    32 	QString intfName(serviceName);
       
    33   
       
    34 	m_providerSerialized.clear();
       
    35 	m_client->writeLog("Before m_SmfClientPrivate->sendRequest");
       
    36 	//Getting the serialized list of SmfProvider synchronously
       
    37 	m_providerSerialized = m_SmfClientPrivate->sendRequest(intfName,SmfGetService);;
       
    38 	if(m_baseProvider)
       
    39 		{
       
    40 		delete m_baseProvider;
       
    41 		m_baseProvider = NULL;
       
    42 		}
       
    43 	m_baseProvider = new QList<SmfProvider>;
       
    44 	//De-serialize it into QList <SmfProvider>
       
    45 	QDataStream reader(&m_providerSerialized,QIODevice::ReadOnly);
       
    46 	reader>>*(m_baseProvider);
       
    47 	return m_baseProvider;
       
    48 	}
       
    49 //This api is not reqd as result will be synchronous
       
    50 void SmfClientPrivate::resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error)
       
    51 	{
       
    52 
       
    53 	}