smf/smfservermodule/smfclient/smfpostprovider_p.cpp
changeset 25 a180113055cb
parent 18 013a02bf2bb0
equal deleted inserted replaced
24:1cee9f1b95e0 25:a180113055cb
   164  * Gets the posts asynchronously. The signal postsAvailable()with SmfPostList is emitted
   164  * Gets the posts asynchronously. The signal postsAvailable()with SmfPostList is emitted
   165  * once the post lists are available
   165  * once the post lists are available
   166  * @param user user's contact in this SP, omit for self contact
   166  * @param user user's contact in this SP, omit for self contact
   167  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   167  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   168  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE 
   168  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE 
       
   169  * @return SmfError. SmfNoError if success, else appropriate error code
   169  * @see postsAvailable()
   170  * @see postsAvailable()
   170  */
   171  */
   171 void SmfPostProviderPrivate::posts(SmfContact* user ,int pageNum,int perPage)
   172 SmfError SmfPostProviderPrivate::posts(SmfContact* user ,int pageNum,int perPage)
   172 	{
   173 	{
       
   174 	SmfError err = SmfNoError;
   173 	//We need to pass Opcode and SmfProvider+SmfContact (when user is not NULL) serialized into bytearray 
   175 	//We need to pass Opcode and SmfProvider+SmfContact (when user is not NULL) serialized into bytearray 
   174 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   176 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   175 	
   177 	
   176 	//serialize start
   178 	//serialize start
   177 	m_serializedDataToServer.clear();
   179 	m_serializedDataToServer.clear();
   178 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   180 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   179 	write<<*m_baseProvider;
   181 	write<<*m_baseProvider;
       
   182 	
       
   183 	QByteArray dataToPlugins;
       
   184 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   185 
   180 	m_argFlag = 1;
   186 	m_argFlag = 1;
   181 	if(user)
   187 	if(user)
   182 		{
   188 		{
   183 		write<<m_argFlag;
   189 		streamToPlugin<<m_argFlag;
   184 		write<<*user;
   190 		streamToPlugin<<*user;
   185 		}
   191 		}
   186 	else
   192 	else
   187 		{
   193 		{
   188 		m_argFlag = 0;
   194 		m_argFlag = 0;
   189 		write<<m_argFlag;
   195 		streamToPlugin<<m_argFlag;
   190 		}
   196 		}
   191 	m_argFlag = 1;
   197 	m_argFlag = 1;
   192 	write<<m_argFlag;
   198 	streamToPlugin<<m_argFlag;
   193 	write<<pageNum;
   199 	streamToPlugin<<pageNum;
   194 	write<<m_argFlag;
   200 	streamToPlugin<<m_argFlag;
   195 	write<<perPage;
   201 	streamToPlugin<<perPage;
   196 	
   202 	
       
   203 	write<<dataToPlugins;
       
   204 
   197 	QString intfName(postProviderInterface);
   205 	QString intfName(postProviderInterface);
   198 	int maxAllocation = MaxSmfPostSize*perPage;
   206 	int maxAllocation = MaxSmfPostSize*perPage;
   199 	
   207 	
   200 	//call private impl's send method
   208 	//call private impl's send method
   201 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   209 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   202 			SmfContactRetrievePosts, maxAllocation);
   210 			SmfContactRetrievePosts, maxAllocation);
       
   211 	
       
   212 	return err;
   203 	}
   213 	}
   204 	
   214 	
   205 /**
   215 /**
   206  * Updates a post to own area, the success of the post can be checked with signal
   216  * Updates a post to own area, the success of the post can be checked with signal
   207  * updatePostFinished() signal
   217  * updatePostFinished() signal
   208  * @param postData data to be posted
   218  * @param postData data to be posted
   209  * @param location location data
   219  * @param location location data
   210  */
   220  * @return SmfError. SmfNoError if success, else appropriate error code
   211 void SmfPostProviderPrivate::post(SmfPost& postData,SmfLocation& location) 
   221  */
   212 	{
   222 SmfError SmfPostProviderPrivate::post(SmfPost& postData,SmfLocation& location) 
   213 	m_serializedDataToServer.clear();
   223 	{
   214 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   224 	SmfError err = SmfNoError;
   215 	
   225 	m_serializedDataToServer.clear();
   216 	//serialize start
   226 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   217 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   227 	
   218 	
   228 	//serialize start
   219 	//SmfProvider
   229 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   220 	write<<*m_baseProvider;
   230 	
   221 	m_argFlag = 1;
   231 	//SmfProvider
   222 	write<<m_argFlag;
   232 	write<<*m_baseProvider;
   223 	write<<postData;
   233 	
   224 	write<<m_argFlag;
   234 	QByteArray dataToPlugins;
   225 	write<<location;
   235 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   236 
       
   237 	m_argFlag = 1;
       
   238 	streamToPlugin<<m_argFlag;
       
   239 	streamToPlugin<<postData;
       
   240 	streamToPlugin<<m_argFlag;
       
   241 	streamToPlugin<<location;
       
   242 	
       
   243 	write<<dataToPlugins;
   226 	
   244 	
   227 	QString intfName(postProviderInterface);
   245 	QString intfName(postProviderInterface);
   228 	
   246 	
   229 	//we are not mentioning the max size, as we'll receive only bool
   247 	//we are not mentioning the max size, as we'll receive only bool
   230 	//call private impl's send method
   248 	//call private impl's send method
   231 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   249 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   232 			SmfContactPost, 10);
   250 			SmfContactPost, 10);
       
   251 	return err;
   233 	}
   252 	}
   234 
   253 
   235 /**
   254 /**
   236  * Updates the last post to own area with new data, the success of the post can be checked with signal
   255  * Updates the last post to own area with new data, the success of the post can be checked with signal
   237  * updatePostFinished() signal
   256  * updatePostFinished() signal
   238  * @param postData edited/new data to be posted
   257  * @param postData edited/new data to be posted
   239  * @param location location data
   258  * @param location location data
   240  */
   259  * @return SmfError. SmfNoError if success, else appropriate error code
   241 void SmfPostProviderPrivate::updatePost(SmfPost& postData)
   260  */
   242 	{
   261 SmfError SmfPostProviderPrivate::updatePost(SmfPost& postData)
   243 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   262 	{
   244 	
   263 	SmfError err = SmfNoError;
   245 	//serialize start
   264 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   246 	m_serializedDataToServer.clear();
   265 	
   247 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   266 	//serialize start
   248 	//SmfProvider
   267 	m_serializedDataToServer.clear();
   249 	write<<*m_baseProvider;
   268 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   250 	m_argFlag = 1;
   269 	//SmfProvider
   251 	write<<m_argFlag;
   270 	write<<*m_baseProvider;
   252 	write<<postData;
   271 	
       
   272 	QByteArray dataToPlugins;
       
   273 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   274 
       
   275 	m_argFlag = 1;
       
   276 	streamToPlugin<<m_argFlag;
       
   277 	streamToPlugin<<postData;
       
   278 	
       
   279 	write<<dataToPlugins;
   253 	
   280 	
   254 	QString intfName(postProviderInterface);
   281 	QString intfName(postProviderInterface);
   255 	//we are not mentioning the max size, as we'll receive only bool
   282 	//we are not mentioning the max size, as we'll receive only bool
   256 	//call private impl's send method
   283 	//call private impl's send method
   257 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   284 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   258 			SmfContactUpdatePost, 10);
   285 			SmfContactUpdatePost, 10);
       
   286 	return err;
   259 	}
   287 	}
   260 
   288 
   261 /**
   289 /**
   262  * Updates a post to a particular Smf contact. the success of the post can be checked with signal
   290  * Updates a post to a particular Smf contact. the success of the post can be checked with signal
   263  * updatePostFinished() signal.
   291  * updatePostFinished() signal.
   264  * @param postData data to be posted
   292  * @param postData data to be posted
   265  * @param contact contact to which the post is to be directed
   293  * @param contact contact to which the post is to be directed
   266  * @param location location data
   294  * @param location location data
   267  */
   295  * @return SmfError. SmfNoError if success, else appropriate error code
   268 void SmfPostProviderPrivate::postDirected(SmfPost& postData,SmfContact& contact,SmfLocation* location)
   296  */
   269 	{
   297 SmfError SmfPostProviderPrivate::postDirected(SmfPost& postData,SmfContact& contact,SmfLocation* location)
   270 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   298 	{
   271 	
   299 	SmfError err = SmfNoError;
   272 	//serialize start
   300 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   273 	m_serializedDataToServer.clear();
   301 	
   274 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   302 	//serialize start
   275 	
   303 	m_serializedDataToServer.clear();
   276 	//SmfProvider
   304 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   277 	write<<*m_baseProvider;
   305 	
   278 	m_argFlag = 1;
   306 	//SmfProvider
   279 	write<<m_argFlag;
   307 	write<<*m_baseProvider;
   280 	write<<postData;
   308 	
   281 	write<<m_argFlag;
   309 	QByteArray dataToPlugins;
   282 	write<<contact;
   310 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   311 
       
   312 	m_argFlag = 1;
       
   313 	streamToPlugin<<m_argFlag;
       
   314 	streamToPlugin<<postData;
       
   315 	streamToPlugin<<m_argFlag;
       
   316 	streamToPlugin<<contact;
   283 	if(location)
   317 	if(location)
   284 		{
   318 		{
   285 		write<<m_argFlag;
   319 		streamToPlugin<<m_argFlag;
   286 		write<<*location;
   320 		streamToPlugin<<*location;
   287 		}
   321 		}
   288 	else
   322 	else
   289 		{
   323 		{
   290 		m_argFlag = 0;
   324 		m_argFlag = 0;
   291 		write<<m_argFlag;
   325 		streamToPlugin<<m_argFlag;
   292 		}
   326 		}
       
   327 	
       
   328 	write<<dataToPlugins;
   293 	
   329 	
   294 	QString intfName(postProviderInterface);
   330 	QString intfName(postProviderInterface);
   295 	//we are not mentioning the max size, as we'll receive only bool
   331 	//we are not mentioning the max size, as we'll receive only bool
   296 	//call private impl's send method
   332 	//call private impl's send method
   297 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   333 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   298 			SmfContactPostDirected, 10);
   334 			SmfContactPostDirected, 10);
       
   335 	return err;
   299 	}
   336 	}
   300 
   337 
   301 /**
   338 /**
   302  * Method to post a comment on a post.
   339  * Method to post a comment on a post.
   303  * @param aTarget Post on which comment has to be posted
   340  * @param aTarget Post on which comment has to be posted
   304  * @param aComment comment to be posted
   341  * @param aComment comment to be posted
   305  * @param aLocation location data
   342  * @param aLocation location data
   306  */
   343  * @return SmfError. SmfNoError if success, else appropriate error code
   307 void SmfPostProviderPrivate::commentOnAPost( SmfPost &aTarget, SmfPost &aComment, 
   344  */
       
   345 SmfError SmfPostProviderPrivate::commentOnAPost( SmfPost &aTarget, SmfPost &aComment, 
   308 		SmfLocation *aLocation)
   346 		SmfLocation *aLocation)
   309 	{
   347 	{
   310 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   348 	SmfError err = SmfNoError;
   311 	
   349 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   312 	//serialize start
   350 	
   313 	m_serializedDataToServer.clear();
   351 	//serialize start
   314 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   352 	m_serializedDataToServer.clear();
   315 	
   353 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   316 	//SmfProvider
   354 	
   317 	write<<*m_baseProvider;
   355 	//SmfProvider
   318 	m_argFlag = 1;
   356 	write<<*m_baseProvider;
   319 	write<<m_argFlag;
   357 	
   320 	write<<aTarget;
   358 	QByteArray dataToPlugins;
   321 	write<<m_argFlag;
   359 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   322 	write<<aComment;
   360 
   323 	
   361 	m_argFlag = 1;
       
   362 	streamToPlugin<<m_argFlag;
       
   363 	streamToPlugin<<aTarget;
       
   364 	streamToPlugin<<m_argFlag;
       
   365 	streamToPlugin<<aComment;
   324 	if(aLocation)
   366 	if(aLocation)
   325 		{
   367 		{
   326 		write<<m_argFlag;
   368 		streamToPlugin<<m_argFlag;
   327 		write<<*aLocation;
   369 		streamToPlugin<<*aLocation;
   328 		}
   370 		}
   329 	else
   371 	else
   330 		{
   372 		{
   331 		m_argFlag = 0;
   373 		m_argFlag = 0;
   332 		write<<m_argFlag;
   374 		streamToPlugin<<m_argFlag;
   333 		}
   375 		}
       
   376 	
       
   377 	write<<dataToPlugins;
   334 	
   378 	
   335 	QString intfName(postProviderInterface);
   379 	QString intfName(postProviderInterface);
   336 	//we are not mentioning the max size, as we'll receive only bool
   380 	//we are not mentioning the max size, as we'll receive only bool
   337 	//call private impl's send method
   381 	//call private impl's send method
   338 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   382 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   339 			SmfContactCommentOnAPost, 10);
   383 			SmfContactCommentOnAPost, 10);
       
   384 	return err;
   340 	}
   385 	}
   341 
   386 
   342 /**
   387 /**
   343  * Posts appearance info of the user.e.g. appear offline, busy, do-not-disturb
   388  * Posts appearance info of the user.e.g. appear offline, busy, do-not-disturb
   344  * @param appearence user appearance
   389  * @param appearence user appearance
   345  * @see SmfPresenceInfo
   390  * @see SmfPresenceInfo
   346  * @return False on Failure/Not supported 
   391  * @return SmfError. SmfNoError if success, else appropriate error code
   347  */
   392  */
   348 bool SmfPostProviderPrivate::postAppearence(SmfAppearenceInfo appearence,
   393 SmfError SmfPostProviderPrivate::postAppearence(SmfAppearenceInfo appearence,
   349 		const QString &status)
   394 		const QString &status)
   350 	{
   395 	{
       
   396 	SmfError err = SmfNoError;
   351 	//TODO:-How to return "supported" value? should it be synchronous?
   397 	//TODO:-How to return "supported" value? should it be synchronous?
   352 	//Currently doing it asynchronously with the assumption of always supported
   398 	//Currently doing it asynchronously with the assumption of always supported
   353 	//TODO:- implement some signal completion API
   399 	//TODO:- implement some signal completion API
   354 	m_serializedDataToServer.clear();
   400 	m_serializedDataToServer.clear();
   355 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   401 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   356 	
   402 	
   357 	//serialize start
   403 	//serialize start
   358 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   404 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   359 	write<<*m_baseProvider;
   405 	write<<*m_baseProvider;
   360 	m_argFlag = 1;
   406 	
   361 	write<<m_argFlag;
   407 	QByteArray dataToPlugins;
   362 	write<<appearence;
   408 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   363 	write<<m_argFlag;
   409 
   364 	write<<status;
   410 	m_argFlag = 1;
       
   411 	streamToPlugin<<m_argFlag;
       
   412 	streamToPlugin<<appearence;
       
   413 	streamToPlugin<<m_argFlag;
       
   414 	streamToPlugin<<status;
       
   415 	
       
   416 	write<<dataToPlugins;
   365 		
   417 		
   366 	QString intfName(postProviderInterface);
   418 	QString intfName(postProviderInterface);
   367 	//we are not mentioning the max size, as we'll receive only bool
   419 	//we are not mentioning the max size, as we'll receive only bool
   368 	//call private impl's send method
   420 	//call private impl's send method
   369 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   421 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   370 			SmfContactPostAppearence, 10);
   422 			SmfContactPostAppearence, 10);
   371 	
   423 	return err;
   372 	return true;
       
   373 	}
   424 	}
   374 
   425 
   375 /**
   426 /**
   376  * Share a contact's post to user's friends and followers (e.g. retweet in twitter, share on facebook)
   427  * Share a contact's post to user's friends and followers (e.g. retweet in twitter, share on facebook)
   377  * emits updatePostFinished() signal when done.
   428  * emits updatePostFinished() signal when done.
   378  * @param postData data to be posted
   429  * @param postData data to be posted
   379  * @param contact contact to which the post belonged
   430  * @param contact contact to which the post belonged
   380  * @param bool whether user changed items within the post
   431  * @param bool whether user changed items within the post
   381  */
   432  * @return SmfError. SmfNoError if success, else appropriate error code
   382 void SmfPostProviderPrivate::sharePost(SmfPost& postData,SmfContact& contact,bool edited)
   433  */
   383 	{
   434 SmfError SmfPostProviderPrivate::sharePost(SmfPost& postData,SmfContact& contact,bool edited)
   384 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   435 	{
   385 	
   436 	SmfError err = SmfNoError;
   386 	//serialize start
   437 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   387 	m_serializedDataToServer.clear();
   438 	
   388 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   439 	//serialize start
   389 	write<<*m_baseProvider;
   440 	m_serializedDataToServer.clear();
   390 	m_argFlag = 1;
   441 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   391 	write<<m_argFlag;
   442 	write<<*m_baseProvider;
   392 	write<<postData;
   443 	
   393 	write<<m_argFlag;
   444 	QByteArray dataToPlugins;
   394 	write<<contact;
   445 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   395 	write<<m_argFlag;
   446 
   396 	write<<edited;
   447 	m_argFlag = 1;
       
   448 	streamToPlugin<<m_argFlag;
       
   449 	streamToPlugin<<postData;
       
   450 	streamToPlugin<<m_argFlag;
       
   451 	streamToPlugin<<contact;
       
   452 	streamToPlugin<<m_argFlag;
       
   453 	streamToPlugin<<edited;
       
   454 	
       
   455 	write<<dataToPlugins;
   397 	
   456 	
   398 	QString intfName(postProviderInterface);
   457 	QString intfName(postProviderInterface);
   399 	//we are not mentioning the max size, as we'll receive only bool
   458 	//we are not mentioning the max size, as we'll receive only bool
   400 	//call private impl's send method
   459 	//call private impl's send method
   401 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   460 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   402 			SmfContactSharePost, 10);
   461 			SmfContactSharePost, 10);
       
   462 	return err;
   403 	}
   463 	}
   404 
   464 
   405 /**
   465 /**
   406  * Request for a custom operation. The signal customDataAvailable() is emitted 
   466  * Request for a custom operation. The signal customDataAvailable() is emitted 
   407  * when the result is available.
   467  * when the result is available.
   408  * @param operationId OperationId
   468  * @param operationId OperationId
   409  * @param customData Custom data to be sent
   469  * @param customData Custom data to be sent
       
   470  * @return SmfError. SmfNoError if success, else appropriate error code
   410  * Note:-Interpretation of operationId and customData is upto the concerned
   471  * Note:-Interpretation of operationId and customData is upto the concerned
   411  * plugin and client application. service provider should provide some
   472  * plugin and client application. service provider should provide some
   412  * serializing-deserializing utilities for these custom data
   473  * serializing-deserializing utilities for these custom data
   413  */
   474  */
   414 void SmfPostProviderPrivate::customRequest ( const int& operationId, QByteArray* customData )
   475 SmfError SmfPostProviderPrivate::customRequest ( const int& operationId, QByteArray* customData )
   415 	{
   476 	{
   416 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   477 	SmfError err = SmfNoError;
   417 	
   478 	SmfProvider* m_baseProvider = m_postProvider->getProvider();
   418 	//serialize start
   479 	
   419 	m_serializedDataToServer.clear();
   480 	//serialize start
   420 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   481 	m_serializedDataToServer.clear();
   421 	write<<*m_baseProvider;
   482 	QDataStream write(&m_serializedDataToServer,QIODevice::WriteOnly);
   422 	m_argFlag = 1;
   483 	write<<*m_baseProvider;
   423 	write<<m_argFlag;
   484 	
   424 	write<<operationId;
   485 	QByteArray dataToPlugins;
       
   486 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   487 	m_argFlag = 1;
       
   488 	streamToPlugin<<m_argFlag;
       
   489 	streamToPlugin<<operationId;
   425 	if(customData)
   490 	if(customData)
   426 		{
   491 		{
   427 		write<<m_argFlag;
   492 		streamToPlugin<<m_argFlag;
   428 		write<<*customData;
   493 		streamToPlugin<<*customData;
   429 		}
   494 		}
   430 	else
   495 	else
   431 		{
   496 		{
   432 		m_argFlag = 0;
   497 		m_argFlag = 0;
   433 		write<<m_argFlag;
   498 		streamToPlugin<<m_argFlag;
   434 		}
   499 		}
       
   500 	
       
   501 	write<<dataToPlugins;
   435 	
   502 	
   436 	QString intfName(postProviderInterface);
   503 	QString intfName(postProviderInterface);
   437 	//ToDo:- How much size to allocate for custo data? keeping MaxSmfPostSize for now
   504 	//ToDo:- How much size to allocate for custo data? keeping MaxSmfPostSize for now
   438 	int maxAllocation = MaxSmfPostSize;
   505 	int maxAllocation = MaxSmfPostSize;
   439 	
   506 	
   440 	//call private impl's send method
   507 	//call private impl's send method
   441 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   508 	m_SmfClientPrivate->sendRequest(m_serializedDataToServer, intfName,
   442 			SmfContactPostCustomRequest, maxAllocation);
   509 			SmfContactPostCustomRequest, maxAllocation);
       
   510 	return err;
       
   511 	}
       
   512 
       
   513 SmfError SmfPostProviderPrivate::cancelRequest()
       
   514 	{
       
   515 	qDebug()<<"Inside SmfPostProviderPrivate::cancelRequest()";
       
   516 	QByteArray notused;
       
   517 	QByteArray retData = m_SmfClientPrivate->sendSyncRequest(notused,SmfCancelRequest,1000, notused);
       
   518 	
       
   519 	//De-serialize it into SmfError
       
   520 	QDataStream reader(&retData,QIODevice::ReadOnly);
       
   521 	int val;
       
   522 	reader>>val;
       
   523 	SmfError error = (SmfError) val;
       
   524 	return error;
   443 	}
   525 	}
   444 
   526 
   445 /**
   527 /**
   446 * From smfobserver
   528 * From smfobserver
   447 */
   529 */