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 |
* Description:
|
|
16 |
* Private Qt wrapper for SmfContactFetcher
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include <qdebug.h>
|
|
21 |
|
|
22 |
#include "smfcontactfetcher.h"
|
|
23 |
#include "smfcontactfetcher_p.h"
|
|
24 |
#ifdef Q_OS_SYMBIAN
|
|
25 |
#include "smfclientsymbian.h"
|
|
26 |
#else
|
|
27 |
#include "smfclientqt.h"
|
|
28 |
#endif
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Constructor
|
|
32 |
* @param contactFetcher The SmfContactFetcher instance
|
|
33 |
*/
|
|
34 |
SmfContactFetcherPrivate::SmfContactFetcherPrivate ( SmfContactFetcher* contactFetcher )
|
|
35 |
: m_contactFetcher(contactFetcher)
|
|
36 |
{
|
|
37 |
#ifdef Q_OS_SYMBIAN
|
|
38 |
//private impl for symbian
|
|
39 |
m_SmfClientPrivate = CSmfClientSymbian::NewL(this);
|
|
40 |
#endif
|
|
41 |
}
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Destructor
|
|
45 |
*/
|
|
46 |
SmfContactFetcherPrivate::~SmfContactFetcherPrivate()
|
|
47 |
{
|
|
48 |
if(m_SmfClientPrivate)
|
|
49 |
{
|
|
50 |
delete m_SmfClientPrivate;
|
|
51 |
m_SmfClientPrivate = NULL;
|
|
52 |
}
|
|
53 |
}
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Get the friend listing asynchronously. The friendsListAvailable() signal
|
|
57 |
* is emitted with SmfContactList once data is arrived. When the list is big,
|
|
58 |
* user can specify the page number and per page item data. If not supplied
|
|
59 |
* by the user default values are used.
|
|
60 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
61 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
62 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
63 |
*/
|
25
|
64 |
SmfError SmfContactFetcherPrivate::friends(int pageNum,int perPage)
|
18
|
65 |
{
|
25
|
66 |
SmfError err = SmfNoError;
|
18
|
67 |
//We need to pass Opcode and SmfProvider serialized into bytearray
|
|
68 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
69 |
|
|
70 |
//serialize start
|
|
71 |
m_dataSerialized.clear();
|
|
72 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
73 |
write<<*(m_baseProvider);
|
|
74 |
|
25
|
75 |
QByteArray dataToPlugins;
|
|
76 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
|
77 |
m_argFlag = 1;
|
|
78 |
streamToPlugin<<m_argFlag;
|
|
79 |
streamToPlugin<<pageNum;
|
|
80 |
streamToPlugin<<m_argFlag;
|
|
81 |
streamToPlugin<<perPage;
|
|
82 |
|
|
83 |
write<<dataToPlugins;
|
|
84 |
|
18
|
85 |
QString intfName(contactFetcherInterface);
|
|
86 |
int maxAllocation = MaxSmfContactSize*perPage;
|
|
87 |
|
|
88 |
//call private impl's send method
|
|
89 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
90 |
SmfContactGetFriends, maxAllocation);
|
25
|
91 |
return err;
|
18
|
92 |
}
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Get the list of followers asynchronously. The followersListAvailable() signal
|
|
96 |
* is emitted with SmfContactList once data is arrived. Please note that some
|
|
97 |
* service may not support followers/fans - FALSE is returned if not supported.
|
|
98 |
* When the list is big user can specify the page number and per page item data.
|
|
99 |
* If not supplied by the user default values are used.
|
|
100 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
101 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
102 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
103 |
*/
|
25
|
104 |
SmfError SmfContactFetcherPrivate::followers(int pageNum,int perPage)
|
18
|
105 |
{
|
25
|
106 |
SmfError err = SmfNoError;
|
18
|
107 |
//We need to pass Opcode and SmfProvider serialized into bytearray
|
|
108 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
109 |
|
|
110 |
//serialize start
|
|
111 |
m_dataSerialized.clear();
|
|
112 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
113 |
write<<*m_baseProvider;
|
25
|
114 |
|
|
115 |
QByteArray dataToPlugins;
|
|
116 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
117 |
m_argFlag = 1;
|
25
|
118 |
streamToPlugin<<m_argFlag;
|
|
119 |
streamToPlugin<<pageNum;
|
|
120 |
streamToPlugin<<m_argFlag;
|
|
121 |
streamToPlugin<<perPage;
|
|
122 |
|
|
123 |
write<<dataToPlugins;
|
18
|
124 |
|
|
125 |
QString intfName(contactFetcherInterface);
|
|
126 |
int maxAllocation = MaxSmfContactSize*perPage;
|
|
127 |
|
|
128 |
//call private impl's send method
|
|
129 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
130 |
SmfContactGetFollowers, maxAllocation);
|
25
|
131 |
return err;
|
18
|
132 |
}
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Searches for a contact The searchContactFinished() signal
|
|
136 |
* is emitted with SmfContactList once data is arrived.
|
|
137 |
* When the list is big user can specify the page number and per page item data.
|
|
138 |
* If not supplied by the user default values are used.
|
|
139 |
* @param contact The contact to be searched. The serach criteria must be
|
|
140 |
* set as one of its fields.
|
|
141 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
142 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
143 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
144 |
*/
|
25
|
145 |
SmfError SmfContactFetcherPrivate::search(SmfContact* contact,int pageNum,int perPage)
|
18
|
146 |
{
|
25
|
147 |
SmfError err = SmfNoError;
|
18
|
148 |
//We need to pass Opcode and SmfProvider+SmfContact serialized into bytearray
|
|
149 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
150 |
m_dataSerialized.clear();
|
|
151 |
//serialize start
|
|
152 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
153 |
write<<*m_baseProvider;
|
25
|
154 |
|
|
155 |
QByteArray dataToPlugins;
|
|
156 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
157 |
if(contact)
|
|
158 |
{
|
|
159 |
m_argFlag = 1;
|
25
|
160 |
streamToPlugin<<m_argFlag;
|
|
161 |
streamToPlugin<<*contact;
|
18
|
162 |
}
|
|
163 |
else
|
|
164 |
{
|
|
165 |
m_argFlag = 0;
|
25
|
166 |
streamToPlugin<<m_argFlag;
|
18
|
167 |
}
|
|
168 |
m_argFlag = 1;
|
25
|
169 |
streamToPlugin<<m_argFlag;
|
|
170 |
streamToPlugin<<pageNum;
|
|
171 |
streamToPlugin<<m_argFlag;
|
|
172 |
streamToPlugin<<pageNum;
|
|
173 |
|
|
174 |
write<<dataToPlugins;
|
18
|
175 |
|
|
176 |
QString intfName(contactFetcherInterface);
|
|
177 |
int maxAllocation = MaxSmfContactSize*perPage;
|
|
178 |
|
|
179 |
//call private impl's send method
|
|
180 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
181 |
SmfContactSearch, maxAllocation);
|
25
|
182 |
return err;
|
18
|
183 |
}
|
|
184 |
|
|
185 |
/**
|
|
186 |
* Searches for a contacts (friends) who are near the user. The signal
|
|
187 |
* searchNearFinished() is emitted with SmfContactList once data is arrived.
|
|
188 |
* Proximity defines accuracy level. When the list is big user can specify
|
|
189 |
* the page number and per page item data. If not supplied by the user
|
|
190 |
* default values are used.
|
|
191 |
* @param location The location information
|
|
192 |
* @param proximity The search boundary criteria
|
|
193 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
194 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
195 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
196 |
*/
|
25
|
197 |
SmfError SmfContactFetcherPrivate::searchNear(SmfLocation* location,
|
18
|
198 |
SmfLocationSearchBoundary proximity,
|
|
199 |
int pageNum,int perPage)
|
|
200 |
{
|
25
|
201 |
SmfError err = SmfNoError;
|
18
|
202 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
203 |
m_dataSerialized.clear();
|
|
204 |
|
|
205 |
//serialize start
|
|
206 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
207 |
write<<*m_baseProvider;
|
25
|
208 |
|
|
209 |
QByteArray dataToPlugins;
|
|
210 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
211 |
if(location)
|
|
212 |
{
|
|
213 |
m_argFlag = 1;
|
25
|
214 |
streamToPlugin<<m_argFlag;
|
|
215 |
streamToPlugin<<*location;
|
18
|
216 |
}
|
|
217 |
else
|
|
218 |
{
|
|
219 |
m_argFlag = 0;
|
25
|
220 |
streamToPlugin<<m_argFlag;
|
18
|
221 |
}
|
25
|
222 |
m_argFlag = 1;
|
|
223 |
streamToPlugin<<m_argFlag;
|
|
224 |
streamToPlugin<<proximity;
|
|
225 |
streamToPlugin<<m_argFlag;
|
|
226 |
streamToPlugin<<pageNum;
|
|
227 |
streamToPlugin<<m_argFlag;
|
|
228 |
streamToPlugin<<perPage;
|
|
229 |
|
|
230 |
write<<dataToPlugins;
|
18
|
231 |
|
|
232 |
QString intfName(contactFetcherInterface);
|
|
233 |
int maxAllocation = MaxSmfContactSize*perPage;
|
|
234 |
|
|
235 |
//call private impl's send method
|
|
236 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
237 |
SmfContactSearchNear, maxAllocation);
|
25
|
238 |
return err;
|
18
|
239 |
}
|
|
240 |
|
|
241 |
/**
|
|
242 |
* Get the list of groups. The groupListAvailable() signal is emitted with
|
|
243 |
* SmfGroupList once data is arrived. False might be returned if this service
|
|
244 |
* doesn't support any mode of grouping (very rare). When the list is big,
|
|
245 |
* user can specify the page number and per page item data. If not supplied
|
|
246 |
* by the user default values are used.
|
|
247 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
248 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
249 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
250 |
*/
|
25
|
251 |
SmfError SmfContactFetcherPrivate::groups(int pageNum,int perPage)
|
18
|
252 |
{
|
25
|
253 |
SmfError err = SmfNoError;
|
18
|
254 |
//We need to pass Opcode and SmfProvider serialized into bytearray
|
|
255 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
256 |
m_dataSerialized.clear();
|
|
257 |
|
|
258 |
//serialize start
|
|
259 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
260 |
write<<*m_baseProvider;
|
25
|
261 |
|
|
262 |
QByteArray dataToPlugins;
|
|
263 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
264 |
m_argFlag = 1;
|
25
|
265 |
streamToPlugin<<m_argFlag;
|
|
266 |
streamToPlugin<<pageNum;
|
|
267 |
streamToPlugin<<m_argFlag;
|
|
268 |
streamToPlugin<<perPage;
|
|
269 |
|
|
270 |
write<<dataToPlugins;
|
|
271 |
|
18
|
272 |
QString intfName(contactFetcherInterface);
|
|
273 |
int maxAllocation = MaxSmfGroupSize*perPage;
|
|
274 |
|
|
275 |
//call private impl's send method
|
|
276 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
277 |
SmfContactGetGroups, maxAllocation);
|
25
|
278 |
return err;
|
18
|
279 |
}
|
|
280 |
|
|
281 |
/**
|
|
282 |
* Searches for Smf Contacts in an Smf group. The signal searchInGroupFinished()
|
|
283 |
* is emitted with SmfContactList once data is arrived. When the list is big user
|
|
284 |
* can specify the page number and per page item data. If not supplied by the
|
|
285 |
* user default values are used.
|
|
286 |
* @param group The group to be searched in
|
25
|
287 |
* @contact The contact to be searched, default (NULL) is the self contact.
|
18
|
288 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
289 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
25
|
290 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
291 |
*/
|
25
|
292 |
SmfError SmfContactFetcherPrivate::searchInGroup(SmfGroup group, SmfContact *contact,
|
|
293 |
int pageNum,int perPage)
|
18
|
294 |
{
|
25
|
295 |
SmfError err = SmfNoError;
|
18
|
296 |
//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray
|
|
297 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
298 |
|
|
299 |
//serialize start
|
|
300 |
m_dataSerialized.clear();
|
|
301 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
302 |
write<<*m_baseProvider;
|
25
|
303 |
|
|
304 |
QByteArray dataToPlugins;
|
|
305 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
306 |
m_argFlag = 1;
|
25
|
307 |
streamToPlugin<<m_argFlag;
|
|
308 |
streamToPlugin<<group;
|
|
309 |
if(contact)
|
|
310 |
{
|
|
311 |
streamToPlugin<<m_argFlag;
|
|
312 |
streamToPlugin<<*contact;
|
|
313 |
}
|
|
314 |
else
|
|
315 |
{
|
|
316 |
m_argFlag = 0;
|
|
317 |
streamToPlugin<<m_argFlag;
|
|
318 |
}
|
|
319 |
m_argFlag = 1;
|
|
320 |
streamToPlugin<<m_argFlag;
|
|
321 |
streamToPlugin<<pageNum;
|
|
322 |
streamToPlugin<<m_argFlag;
|
|
323 |
streamToPlugin<<perPage;
|
18
|
324 |
|
25
|
325 |
write<<dataToPlugins;
|
|
326 |
|
18
|
327 |
QString intfName(contactFetcherInterface);
|
|
328 |
int maxAllocation = MaxSmfContactSize*perPage;
|
|
329 |
|
|
330 |
//call private impl's send method
|
|
331 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
332 |
SmfContactSearchInGroup, maxAllocation);
|
25
|
333 |
return err;
|
18
|
334 |
}
|
|
335 |
|
|
336 |
/**
|
|
337 |
* Request for a custom operation. The signal customDataAvailable() is emitted
|
|
338 |
* when the result is available.
|
|
339 |
* @param operationId OperationId
|
|
340 |
* @param customData Custom data to be sent
|
25
|
341 |
* @return SmfError. SmfNoError if success, else appropriate error code
|
18
|
342 |
* Note:-Interpretation of operationId and customData is upto the concerned
|
|
343 |
* plugin and client application. service provider should provide some
|
|
344 |
* serializing-deserializing utilities for these custom data
|
|
345 |
*/
|
25
|
346 |
SmfError SmfContactFetcherPrivate::customRequest ( const int& operationId, QByteArray* customData )
|
18
|
347 |
{
|
25
|
348 |
SmfError err = SmfNoError;
|
18
|
349 |
//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray
|
|
350 |
SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
|
|
351 |
|
|
352 |
//serialize start
|
|
353 |
m_dataSerialized.clear();
|
|
354 |
QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
|
|
355 |
write<<*m_baseProvider;
|
25
|
356 |
|
|
357 |
QByteArray dataToPlugins;
|
|
358 |
QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
|
18
|
359 |
m_argFlag = 1;
|
25
|
360 |
streamToPlugin<<m_argFlag;
|
|
361 |
streamToPlugin<<operationId;
|
18
|
362 |
if(customData)
|
|
363 |
{
|
25
|
364 |
streamToPlugin<<m_argFlag;
|
|
365 |
streamToPlugin<<*customData;
|
18
|
366 |
}
|
|
367 |
else
|
|
368 |
{
|
|
369 |
m_argFlag = 0;
|
25
|
370 |
streamToPlugin<<m_argFlag;
|
18
|
371 |
}
|
|
372 |
|
25
|
373 |
write<<dataToPlugins;
|
|
374 |
|
18
|
375 |
QString intfName(contactFetcherInterface);
|
|
376 |
//ToDo:- How much size to allocate for custom data? keeping MaxSmfContactSize for now
|
|
377 |
int maxAllocation = MaxSmfContactSize;
|
|
378 |
|
|
379 |
//call private impl's send method
|
|
380 |
m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
|
|
381 |
SmfContactCustomRequest, maxAllocation);
|
25
|
382 |
return err;
|
|
383 |
}
|
|
384 |
|
|
385 |
SmfError SmfContactFetcherPrivate::cancelRequest()
|
|
386 |
{
|
|
387 |
qDebug()<<"Inside SmfContactFetcherPrivate::cancelRequest()";
|
|
388 |
QByteArray notused;
|
|
389 |
QByteArray retData = m_SmfClientPrivate->sendSyncRequest(notused,SmfCancelRequest,1000, notused);
|
|
390 |
|
|
391 |
//De-serialize it into SmfError
|
|
392 |
QDataStream reader(&retData,QIODevice::ReadOnly);
|
|
393 |
int val;
|
|
394 |
reader>>val;
|
|
395 |
SmfError error = (SmfError) val;
|
|
396 |
return error;
|
18
|
397 |
}
|
|
398 |
|
|
399 |
/**
|
|
400 |
* To notify availibility of asynchronous requests.
|
|
401 |
* @param result Requested result, before using must check error param.
|
|
402 |
* @param opcode Requested opcode, for which the result has arrived.
|
|
403 |
* @param error Error
|
|
404 |
*/
|
|
405 |
void SmfContactFetcherPrivate::resultsAvailable(QByteArray result,
|
|
406 |
SmfRequestTypeID opcode,SmfError error)
|
|
407 |
{
|
|
408 |
qDebug()<<"SmfContactFetcherPrivate::resultsAvailable";
|
|
409 |
|
|
410 |
QDataStream reader(&result,QIODevice::ReadOnly);
|
|
411 |
|
|
412 |
//Now de-serialize it based on opcode
|
|
413 |
switch(opcode)
|
|
414 |
{
|
|
415 |
case SmfContactGetFriends:
|
|
416 |
{
|
|
417 |
SmfContactList* m_contactList = new SmfContactList;
|
|
418 |
reader>>*m_contactList;
|
|
419 |
qDebug()<<"m_contactList.count = "<<m_contactList->count();
|
|
420 |
|
|
421 |
//TODO:-After consulting with PM owner decide page serialization
|
|
422 |
SmfResultPage page;
|
|
423 |
|
|
424 |
emit m_contactFetcher->friendsListAvailable(m_contactList,error,page);
|
|
425 |
}
|
|
426 |
break;
|
|
427 |
|
|
428 |
case SmfContactGetFollowers:
|
|
429 |
{
|
|
430 |
SmfContactList* m_contactList = new SmfContactList;
|
|
431 |
reader>>*(m_contactList);
|
|
432 |
qDebug()<<"m_contactList.count = "<<m_contactList->count();
|
|
433 |
|
|
434 |
//TODO:-After consulting with PM owner decide page serialization
|
|
435 |
SmfResultPage page;
|
|
436 |
|
|
437 |
emit m_contactFetcher->followersListAvailable(m_contactList,error,page);
|
|
438 |
}
|
|
439 |
break;
|
|
440 |
|
|
441 |
case SmfContactSearch:
|
|
442 |
{
|
|
443 |
SmfContactList* m_contactList = new SmfContactList;
|
|
444 |
reader>>*(m_contactList);
|
|
445 |
qDebug()<<"m_contactList.count = "<<m_contactList->count();
|
|
446 |
|
|
447 |
/** @TODO:-After consulting with PM owner decide page serialization */
|
|
448 |
SmfResultPage page;
|
|
449 |
|
|
450 |
emit m_contactFetcher->searchContactFinished(m_contactList,error,page);
|
|
451 |
}
|
|
452 |
break;
|
|
453 |
|
|
454 |
case SmfContactSearchNear:
|
|
455 |
{
|
|
456 |
SmfContactList* m_contactList = new SmfContactList;
|
|
457 |
reader>>*(m_contactList);
|
|
458 |
qDebug()<<"m_contactList.count = "<<m_contactList->count();
|
|
459 |
|
|
460 |
/** @TODO:-After consulting with PM owner decide page serialization*/
|
|
461 |
SmfResultPage page;
|
|
462 |
|
|
463 |
emit m_contactFetcher->searchNearFinished(m_contactList,error,page);
|
|
464 |
}
|
|
465 |
break;
|
|
466 |
|
|
467 |
case SmfContactGetGroups:
|
|
468 |
{
|
|
469 |
qDebug()<<"Before reader>>m_grpList";
|
|
470 |
SmfGroupList *m_grpList = new SmfGroupList;
|
|
471 |
reader>>*(m_grpList);
|
|
472 |
|
|
473 |
/** @TODO:-After consulting with PM owner decide page serialization */
|
|
474 |
SmfResultPage page;
|
|
475 |
|
|
476 |
qDebug()<<"m_grpList.count = "<<m_grpList->count();
|
|
477 |
emit m_contactFetcher->groupListAvailable(m_grpList,error,page);
|
|
478 |
}
|
|
479 |
break;
|
|
480 |
|
|
481 |
case SmfContactSearchInGroup:
|
|
482 |
{
|
|
483 |
SmfContactList* m_contactList = new SmfContactList;
|
|
484 |
reader>>*(m_contactList);
|
|
485 |
|
|
486 |
//TODO:-After consulting with PM owner decide page serialization
|
|
487 |
SmfResultPage page;
|
|
488 |
|
|
489 |
qDebug()<<"m_contactList.count = "<<m_contactList->count();
|
|
490 |
|
|
491 |
emit m_contactFetcher->searchInGroupFinished(m_contactList,error,page);
|
|
492 |
}
|
|
493 |
break;
|
|
494 |
|
|
495 |
case SmfContactCustomRequest:
|
|
496 |
{
|
|
497 |
int operationId;
|
|
498 |
QByteArray *data = new QByteArray;
|
|
499 |
reader>>operationId;
|
|
500 |
reader>>*data;
|
|
501 |
|
|
502 |
qDebug()<<"operationId = "<<operationId;
|
|
503 |
qDebug()<<"data size = "<<data->size();
|
|
504 |
emit m_contactFetcher->customDataAvailable(operationId, data);
|
|
505 |
}
|
|
506 |
break;
|
|
507 |
|
|
508 |
default:
|
|
509 |
qDebug()<<"default - Contact Private Unknown opcode";
|
|
510 |
User::Panic(_L("Contact Private Unknown opcode = "),opcode);
|
|
511 |
}
|
|
512 |
}
|
|
513 |
|
|
514 |
QDataStream &operator<<( QDataStream &aDataStream, const SmfError &err )
|
|
515 |
{
|
|
516 |
quint32 errInt = (quint32)err;
|
|
517 |
aDataStream<<errInt;
|
|
518 |
return aDataStream;
|
|
519 |
}
|
|
520 |
|
|
521 |
|
|
522 |
QDataStream &operator>>( QDataStream &aDataStream, SmfError &err )
|
|
523 |
{
|
|
524 |
quint32 errInt;
|
|
525 |
aDataStream>>errInt;
|
|
526 |
err = (SmfError)errInt;
|
|
527 |
return aDataStream;
|
|
528 |
}
|