smf/smfservermodule/smfclient/smfcontactfetcher_p.cpp
changeset 25 a180113055cb
parent 18 013a02bf2bb0
equal deleted inserted replaced
24:1cee9f1b95e0 25:a180113055cb
    57  * is emitted with SmfContactList once data is arrived. When the list is big,
    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 
    58  * user can specify the page number and per page item data. If not supplied 
    59  * by the user default values are used. 
    59  * by the user default values are used. 
    60  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    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
    61  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    62  * @return true if success, else false
    62  * @return SmfError. SmfNoError if success, else appropriate error code
    63  */
    63  */
    64 bool SmfContactFetcherPrivate::friends(int pageNum,int perPage)
    64 SmfError SmfContactFetcherPrivate::friends(int pageNum,int perPage)
    65 	{
    65 	{
       
    66 	SmfError err = SmfNoError;
    66 	//We need to pass Opcode and SmfProvider serialized into bytearray 
    67 	//We need to pass Opcode and SmfProvider serialized into bytearray 
    67 	m_argFlag = 1;
       
    68 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
    68 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
    69 	
    69 	
    70 	//serialize start
    70 	//serialize start
    71 	m_dataSerialized.clear();
    71 	m_dataSerialized.clear();
    72 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
    72 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
    73 	write<<*(m_baseProvider);
    73 	write<<*(m_baseProvider);
    74 	write<<m_argFlag;
    74 	
    75 	write<<pageNum;
    75 	QByteArray dataToPlugins;
    76 	write<<m_argFlag;
    76 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
    77 	write<<perPage;
    77 	m_argFlag = 1;
    78 	
    78 	streamToPlugin<<m_argFlag;
       
    79 	streamToPlugin<<pageNum;
       
    80 	streamToPlugin<<m_argFlag;
       
    81 	streamToPlugin<<perPage;
       
    82 	
       
    83 	write<<dataToPlugins;
       
    84 
    79 	QString intfName(contactFetcherInterface);
    85 	QString intfName(contactFetcherInterface);
    80 	int maxAllocation = MaxSmfContactSize*perPage;
    86 	int maxAllocation = MaxSmfContactSize*perPage;
    81 	
    87 	
    82 	//call private impl's send method
    88 	//call private impl's send method
    83 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName, 
    89 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName, 
    84 			SmfContactGetFriends, maxAllocation);
    90 			SmfContactGetFriends, maxAllocation);
    85 	
    91 	return err;
    86 	return true;
       
    87 	}
    92 	}
    88 
    93 
    89 /**
    94 /**
    90  * Get the list of followers asynchronously. The followersListAvailable() signal
    95  * Get the list of followers asynchronously. The followersListAvailable() signal
    91  * is emitted with SmfContactList once data is arrived. Please note that some
    96  * is emitted with SmfContactList once data is arrived. Please note that some
    92  * service may not support followers/fans - FALSE is returned if not supported.
    97  * service may not support followers/fans - FALSE is returned if not supported.
    93  * When the list is big user can specify the page number and per page item data.
    98  * When the list is big user can specify the page number and per page item data.
    94  * If not supplied by the user default values are used.
    99  * If not supplied by the user default values are used.
    95  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   100  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    96  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   101  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    97  * @return true if success, else false
   102  * @return SmfError. SmfNoError if success, else appropriate error code
    98  */
   103  */
    99 bool SmfContactFetcherPrivate::followers(int pageNum,int perPage)
   104 SmfError SmfContactFetcherPrivate::followers(int pageNum,int perPage)
   100 	{
   105 	{
       
   106 	SmfError err = SmfNoError;
   101 	//We need to pass Opcode and SmfProvider serialized into bytearray 
   107 	//We need to pass Opcode and SmfProvider serialized into bytearray 
   102 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   108 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   103 	
   109 	
   104 	//serialize start
   110 	//serialize start
   105 	m_dataSerialized.clear();
   111 	m_dataSerialized.clear();
   106 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   112 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   107 	write<<*m_baseProvider;
   113 	write<<*m_baseProvider;
   108 	m_argFlag = 1;
   114 	
   109 	write<<m_argFlag;
   115 	QByteArray dataToPlugins;
   110 	write<<pageNum;
   116 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   111 	write<<m_argFlag;
   117 	m_argFlag = 1;
   112 	write<<perPage;
   118 	streamToPlugin<<m_argFlag;
       
   119 	streamToPlugin<<pageNum;
       
   120 	streamToPlugin<<m_argFlag;
       
   121 	streamToPlugin<<perPage;
       
   122 	
       
   123 	write<<dataToPlugins;
   113 		
   124 		
   114 	QString intfName(contactFetcherInterface);
   125 	QString intfName(contactFetcherInterface);
   115 	int maxAllocation = MaxSmfContactSize*perPage;
   126 	int maxAllocation = MaxSmfContactSize*perPage;
   116 	
   127 	
   117 	//call private impl's send method
   128 	//call private impl's send method
   118 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   129 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   119 			SmfContactGetFollowers, maxAllocation);
   130 			SmfContactGetFollowers, maxAllocation);
   120 	
   131 	return err;
   121 	return true;
       
   122 	}
   132 	}
   123   
   133   
   124 /**
   134 /**
   125  * Searches for a contact The searchContactFinished() signal
   135  * Searches for a contact The searchContactFinished() signal
   126  * is emitted with SmfContactList once data is arrived.
   136  * is emitted with SmfContactList once data is arrived.
   128  * If not supplied by the user default values are used.
   138  * If not supplied by the user default values are used.
   129  * @param contact The contact to be searched. The serach criteria must be 
   139  * @param contact The contact to be searched. The serach criteria must be 
   130  * set as one of its fields.
   140  * set as one of its fields.
   131  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   141  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   132  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   142  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   133  */
   143  * @return SmfError. SmfNoError if success, else appropriate error code
   134 void  SmfContactFetcherPrivate::search(SmfContact* contact,int pageNum,int perPage) 
   144  */
   135 	{
   145 SmfError SmfContactFetcherPrivate::search(SmfContact* contact,int pageNum,int perPage) 
       
   146 	{
       
   147 	SmfError err = SmfNoError;
   136 	//We need to pass Opcode and SmfProvider+SmfContact serialized into bytearray 
   148 	//We need to pass Opcode and SmfProvider+SmfContact serialized into bytearray 
   137 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   149 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   138 	m_dataSerialized.clear();
   150 	m_dataSerialized.clear();
   139 	//serialize start
   151 	//serialize start
   140 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   152 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   141 	write<<*m_baseProvider;
   153 	write<<*m_baseProvider;
       
   154 	
       
   155 	QByteArray dataToPlugins;
       
   156 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   142 	if(contact)
   157 	if(contact)
   143 		{
   158 		{
   144 		m_argFlag = 1;
   159 		m_argFlag = 1;
   145 		write<<m_argFlag;
   160 		streamToPlugin<<m_argFlag;
   146 		write<<*contact;
   161 		streamToPlugin<<*contact;
   147 		}
   162 		}
   148 	else
   163 	else
   149 		{
   164 		{
   150 		m_argFlag = 0;
   165 		m_argFlag = 0;
   151 		write<<m_argFlag;
   166 		streamToPlugin<<m_argFlag;
   152 		}
   167 		}
   153 	m_argFlag = 1;
   168 	m_argFlag = 1;
   154 	write<<m_argFlag;
   169 	streamToPlugin<<m_argFlag;
   155 	write<<pageNum;
   170 	streamToPlugin<<pageNum;
   156 	write<<m_argFlag;
   171 	streamToPlugin<<m_argFlag;
   157 	write<<pageNum;
   172 	streamToPlugin<<pageNum;
       
   173 	
       
   174 	write<<dataToPlugins;
   158 	
   175 	
   159 	QString intfName(contactFetcherInterface);
   176 	QString intfName(contactFetcherInterface);
   160 	int maxAllocation = MaxSmfContactSize*perPage;
   177 	int maxAllocation = MaxSmfContactSize*perPage;
   161 	
   178 	
   162 	//call private impl's send method
   179 	//call private impl's send method
   163 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   180 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   164 			SmfContactSearch, maxAllocation);
   181 			SmfContactSearch, maxAllocation);
       
   182 	return err;
   165 	}
   183 	}
   166 
   184 
   167 /**
   185 /**
   168  * Searches for a contacts (friends) who are near the user. The signal 
   186  * Searches for a contacts (friends) who are near the user. The signal 
   169  * searchNearFinished() is emitted with SmfContactList once data is arrived.
   187  * searchNearFinished() is emitted with SmfContactList once data is arrived.
   172  * default values are used.
   190  * default values are used.
   173  * @param location The location information
   191  * @param location The location information
   174  * @param proximity The search boundary criteria
   192  * @param proximity The search boundary criteria
   175  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   193  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   176  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   194  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   177  */
   195  * @return SmfError. SmfNoError if success, else appropriate error code
   178 bool  SmfContactFetcherPrivate::searchNear(SmfLocation* location,
   196  */
       
   197 SmfError SmfContactFetcherPrivate::searchNear(SmfLocation* location,
   179 		SmfLocationSearchBoundary proximity,
   198 		SmfLocationSearchBoundary proximity,
   180 		int pageNum,int perPage) 
   199 		int pageNum,int perPage) 
   181 	{
   200 	{
       
   201 	SmfError err = SmfNoError;
   182 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   202 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   183 	m_dataSerialized.clear();
   203 	m_dataSerialized.clear();
   184 	
   204 	
   185 	//serialize start
   205 	//serialize start
   186 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   206 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   187 	write<<*m_baseProvider;
   207 	write<<*m_baseProvider;
       
   208 	
       
   209 	QByteArray dataToPlugins;
       
   210 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   188 	if(location)
   211 	if(location)
   189 		{
   212 		{
   190 		m_argFlag = 1;
   213 		m_argFlag = 1;
   191 		write<<m_argFlag;
   214 		streamToPlugin<<m_argFlag;
   192 		write<<*location;
   215 		streamToPlugin<<*location;
   193 		}
   216 		}
   194 	else
   217 	else
   195 		{
   218 		{
   196 		m_argFlag = 0;
   219 		m_argFlag = 0;
   197 		write<<m_argFlag;
   220 		streamToPlugin<<m_argFlag;
   198 		}
   221 		}
   199 	write<<m_argFlag;
   222 	m_argFlag = 1;
   200 	write<<proximity;
   223 	streamToPlugin<<m_argFlag;
   201 	write<<m_argFlag;
   224 	streamToPlugin<<proximity;
   202 	write<<pageNum;
   225 	streamToPlugin<<m_argFlag;
   203 	write<<m_argFlag;
   226 	streamToPlugin<<pageNum;
   204 	write<<perPage;
   227 	streamToPlugin<<m_argFlag;
       
   228 	streamToPlugin<<perPage;
       
   229 	
       
   230 	write<<dataToPlugins;
   205 	
   231 	
   206 	QString intfName(contactFetcherInterface);
   232 	QString intfName(contactFetcherInterface);
   207 	int maxAllocation = MaxSmfContactSize*perPage;
   233 	int maxAllocation = MaxSmfContactSize*perPage;
   208 	
   234 	
   209 	//call private impl's send method
   235 	//call private impl's send method
   210 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   236 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   211 			SmfContactSearchNear, maxAllocation);
   237 			SmfContactSearchNear, maxAllocation);
   212 	
   238 	return err;
   213 	return true;
       
   214 	}
   239 	}
   215 
   240 
   216 /**
   241 /**
   217  * Get the list of groups. The groupListAvailable() signal is emitted with 
   242  * Get the list of groups. The groupListAvailable() signal is emitted with 
   218  * SmfGroupList once data is arrived. False might be returned if this service 
   243  * SmfGroupList once data is arrived. False might be returned if this service 
   219  * doesn't support any mode of grouping (very rare). When the list is big, 
   244  * doesn't support any mode of grouping (very rare). When the list is big, 
   220  * user can specify the page number and per page item data. If not supplied 
   245  * user can specify the page number and per page item data. If not supplied 
   221  * by the user default values are used.
   246  * by the user default values are used.
   222  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   247  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   223  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   248  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   224  */
   249  * @return SmfError. SmfNoError if success, else appropriate error code
   225 bool SmfContactFetcherPrivate::groups(int pageNum,int perPage) 
   250  */
   226 	{
   251 SmfError SmfContactFetcherPrivate::groups(int pageNum,int perPage) 
       
   252 	{
       
   253 	SmfError err = SmfNoError;
   227 	//We need to pass Opcode and SmfProvider serialized into bytearray 
   254 	//We need to pass Opcode and SmfProvider serialized into bytearray 
   228 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   255 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   229 	m_dataSerialized.clear();
   256 	m_dataSerialized.clear();
   230 	
   257 	
   231 	//serialize start
   258 	//serialize start
   232 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   259 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   233 	write<<*m_baseProvider;
   260 	write<<*m_baseProvider;
   234 	m_argFlag = 1;
   261 	
   235 	write<<m_argFlag;
   262 	QByteArray dataToPlugins;
   236 	write<<pageNum;
   263 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   237 	write<<m_argFlag;
   264 	m_argFlag = 1;
   238 	write<<perPage;
   265 	streamToPlugin<<m_argFlag;
   239 		
   266 	streamToPlugin<<pageNum;
       
   267 	streamToPlugin<<m_argFlag;
       
   268 	streamToPlugin<<perPage;
       
   269 	
       
   270 	write<<dataToPlugins;
       
   271 			
   240 	QString intfName(contactFetcherInterface);
   272 	QString intfName(contactFetcherInterface);
   241 	int maxAllocation = MaxSmfGroupSize*perPage;
   273 	int maxAllocation = MaxSmfGroupSize*perPage;
   242 	
   274 	
   243 	//call private impl's send method
   275 	//call private impl's send method
   244 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   276 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   245 			SmfContactGetGroups, maxAllocation);
   277 			SmfContactGetGroups, maxAllocation);
   246 	
   278 	return err;
   247 	return true;
       
   248 	}
   279 	}
   249 
   280 
   250 /**
   281 /**
   251  * Searches for Smf Contacts in an Smf group. The signal searchInGroupFinished() 
   282  * Searches for Smf Contacts in an Smf group. The signal searchInGroupFinished() 
   252  * is emitted with SmfContactList once data is arrived. When the list is big user 
   283  * is emitted with SmfContactList once data is arrived. When the list is big user 
   253  * can specify the page number and per page item data. If not supplied by the 
   284  * can specify the page number and per page item data. If not supplied by the 
   254  * user default values are used.
   285  * user default values are used.
   255  * @param group The group to be searched in
   286  * @param group The group to be searched in
       
   287  * @contact The contact to be searched, default (NULL) is the self contact.
   256  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   288  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   257  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   289  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   258  * @return true if success, else false
   290  * @return SmfError. SmfNoError if success, else appropriate error code
   259  */
   291  */
   260 bool  SmfContactFetcherPrivate::searchInGroup(SmfGroup group,int pageNum,int perPage) 
   292 SmfError SmfContactFetcherPrivate::searchInGroup(SmfGroup group, SmfContact *contact,
   261 	{
   293 		int pageNum,int perPage) 
       
   294 	{
       
   295 	SmfError err = SmfNoError;
   262 	//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray 
   296 	//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray 
   263 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   297 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   264 	
   298 	
   265 	//serialize start
   299 	//serialize start
   266 	m_dataSerialized.clear();
   300 	m_dataSerialized.clear();
   267 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   301 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   268 	write<<*m_baseProvider;
   302 	write<<*m_baseProvider;
   269 	m_argFlag = 1;
   303 	
   270 	write<<m_argFlag;
   304 	QByteArray dataToPlugins;
   271 	write<<group;
   305 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
   272 	write<<m_argFlag;
   306 	m_argFlag = 1;
   273 	write<<pageNum;
   307 	streamToPlugin<<m_argFlag;
   274 	write<<m_argFlag;
   308 	streamToPlugin<<group;
   275 	write<<perPage;
   309 	if(contact)
   276 	
   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;
       
   324 	
       
   325 	write<<dataToPlugins;
       
   326 		
   277 	QString intfName(contactFetcherInterface);
   327 	QString intfName(contactFetcherInterface);
   278 	int maxAllocation = MaxSmfContactSize*perPage;
   328 	int maxAllocation = MaxSmfContactSize*perPage;
   279 	
   329 	
   280 	//call private impl's send method
   330 	//call private impl's send method
   281 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   331 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   282 			SmfContactSearchInGroup, maxAllocation);
   332 			SmfContactSearchInGroup, maxAllocation);
   283 	
   333 	return err;
   284 	return true;
       
   285 	}
   334 	}
   286 
   335 
   287 /**
   336 /**
   288  * Request for a custom operation. The signal customDataAvailable() is emitted 
   337  * Request for a custom operation. The signal customDataAvailable() is emitted 
   289  * when the result is available.
   338  * when the result is available.
   290  * @param operationId OperationId
   339  * @param operationId OperationId
   291  * @param customData Custom data to be sent
   340  * @param customData Custom data to be sent
       
   341  * @return SmfError. SmfNoError if success, else appropriate error code
   292  * Note:-Interpretation of operationId and customData is upto the concerned
   342  * Note:-Interpretation of operationId and customData is upto the concerned
   293  * plugin and client application. service provider should provide some
   343  * plugin and client application. service provider should provide some
   294  * serializing-deserializing utilities for these custom data
   344  * serializing-deserializing utilities for these custom data
   295  */
   345  */
   296 void SmfContactFetcherPrivate::customRequest ( const int& operationId, QByteArray* customData )
   346 SmfError SmfContactFetcherPrivate::customRequest ( const int& operationId, QByteArray* customData )
   297 	{
   347 	{
       
   348 	SmfError err = SmfNoError;
   298 	//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray 
   349 	//We need to pass Opcode and SmfProvider+SmfGroup serialized into bytearray 
   299 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   350 	SmfProvider* m_baseProvider = m_contactFetcher->getProvider();
   300 	
   351 	
   301 	//serialize start
   352 	//serialize start
   302 	m_dataSerialized.clear();
   353 	m_dataSerialized.clear();
   303 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   354 	QDataStream write(&m_dataSerialized,QIODevice::WriteOnly);
   304 	write<<*m_baseProvider;
   355 	write<<*m_baseProvider;
   305 	m_argFlag = 1;
   356 	
   306 	write<<m_argFlag;
   357 	QByteArray dataToPlugins;
   307 	write<<operationId;
   358 	QDataStream streamToPlugin(&dataToPlugins, QIODevice::WriteOnly);
       
   359 	m_argFlag = 1;
       
   360 	streamToPlugin<<m_argFlag;
       
   361 	streamToPlugin<<operationId;
   308 	if(customData)
   362 	if(customData)
   309 		{
   363 		{
   310 		write<<m_argFlag;
   364 		streamToPlugin<<m_argFlag;
   311 		write<<*customData;
   365 		streamToPlugin<<*customData;
   312 		}
   366 		}
   313 	else
   367 	else
   314 		{
   368 		{
   315 		m_argFlag = 0;
   369 		m_argFlag = 0;
   316 		write<<m_argFlag;
   370 		streamToPlugin<<m_argFlag;
   317 		}
   371 		}
       
   372 	
       
   373 	write<<dataToPlugins;
   318 	
   374 	
   319 	QString intfName(contactFetcherInterface);
   375 	QString intfName(contactFetcherInterface);
   320 //ToDo:- How much size to allocate for custom data? keeping MaxSmfContactSize for now
   376 //ToDo:- How much size to allocate for custom data? keeping MaxSmfContactSize for now
   321 	int maxAllocation = MaxSmfContactSize;
   377 	int maxAllocation = MaxSmfContactSize;
   322 	
   378 	
   323 	//call private impl's send method
   379 	//call private impl's send method
   324 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   380 	m_SmfClientPrivate->sendRequest(m_dataSerialized, intfName,
   325 			SmfContactCustomRequest, maxAllocation);
   381 			SmfContactCustomRequest, maxAllocation);
       
   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;
   326 	}
   397 	}
   327 
   398 
   328 /**
   399 /**
   329  * To notify availibility of asynchronous requests.
   400  * To notify availibility of asynchronous requests.
   330  * @param result Requested result, before using must check error param.
   401  * @param result Requested result, before using must check error param.