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 #else |
|
25 m_SmfClientPrivate = new SmfClientQt(this); |
|
26 #endif |
|
27 |
|
28 } |
|
29 QList<SmfProvider>* SmfClientPrivate::GetServices(const QString serviceName) |
|
30 { |
|
31 m_client->writeLog("SmfClientPrivate::GetServices"); |
|
32 m_baseProvider = NULL; |
|
33 |
|
34 QString intfName(serviceName); |
|
35 |
|
36 m_providerSerialized.clear(); |
|
37 m_client->writeLog("Before m_SmfClientPrivate->sendRequest"); |
|
38 //Getting the serialized list of SmfProvider synchronously |
|
39 //TODO:- Max size for SmfProviderList 1000 |
|
40 m_providerSerialized = m_SmfClientPrivate->sendRequest(intfName,SmfGetService,1000); |
|
41 if(m_baseProvider) |
|
42 { |
|
43 delete m_baseProvider; |
|
44 m_baseProvider = NULL; |
|
45 } |
|
46 m_baseProvider = new QList<SmfProvider>; |
|
47 //De-serialize it into QList <SmfProvider> |
|
48 QDataStream reader(&m_providerSerialized,QIODevice::ReadOnly); |
|
49 reader>>*(m_baseProvider); |
|
50 return m_baseProvider; |
|
51 } |
|
52 //This api is not reqd as result will be synchronous |
|
53 void SmfClientPrivate::resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error) |
|
54 { |
|
55 |
|
56 } |
|