18
|
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 |
* Private Qt wrapper
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <qdebug.h>
|
|
19 |
|
|
20 |
#include "smfclient_p.h"
|
|
21 |
|
|
22 |
SmfClientPrivate::SmfClientPrivate(SmfClient* client):m_client(client)
|
|
23 |
{
|
|
24 |
qDebug()<<"Inside SmfClientPrivate::SmfClientPrivate()";
|
|
25 |
|
|
26 |
#ifdef Q_OS_SYMBIAN
|
|
27 |
//private impl for symbian
|
|
28 |
m_SmfClientPrivate = CSmfClientSymbian::NewL(this);
|
|
29 |
#else
|
|
30 |
m_SmfClientPrivate = new SmfClientQt(this);
|
|
31 |
#endif
|
|
32 |
}
|
|
33 |
|
|
34 |
|
|
35 |
QList<SmfProvider>* SmfClientPrivate::GetServices(const QString serviceName)
|
|
36 |
{
|
|
37 |
qDebug()<<"Inside SmfClientPrivate::GetServices()";
|
|
38 |
m_baseProvider = NULL;
|
|
39 |
|
|
40 |
QString intfName(serviceName);
|
|
41 |
m_providerSerialized.clear();
|
|
42 |
|
|
43 |
//Getting the serialized list of SmfProvider synchronously
|
|
44 |
//TODO:- Max size for SmfProviderList 1000
|
|
45 |
qDebug()<<"Before m_SmfClientPrivate->sendRequest";
|
|
46 |
QByteArray notused;
|
|
47 |
m_providerSerialized = m_SmfClientPrivate->sendSyncRequest(intfName,SmfGetService,1000, notused);
|
|
48 |
|
|
49 |
if(m_baseProvider)
|
|
50 |
{
|
|
51 |
delete m_baseProvider;
|
|
52 |
m_baseProvider = NULL;
|
|
53 |
}
|
|
54 |
m_baseProvider = new QList<SmfProvider>;
|
|
55 |
|
|
56 |
//De-serialize it into QList<SmfProvider>
|
|
57 |
QDataStream reader(&m_providerSerialized,QIODevice::ReadOnly);
|
|
58 |
reader>>*(m_baseProvider);
|
|
59 |
return m_baseProvider;
|
|
60 |
}
|
|
61 |
|
|
62 |
//This api is not reqd as result will be synchronous
|
|
63 |
void SmfClientPrivate::resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error)
|
|
64 |
{
|
|
65 |
Q_UNUSED(result)
|
|
66 |
Q_UNUSED(opcode)
|
|
67 |
Q_UNUSED(error)
|
|
68 |
}
|