215 if ( iMetadata || iListener ) |
216 if ( iMetadata || iListener ) |
216 { |
217 { |
217 TRACE_FUNC_EXIT |
218 TRACE_FUNC_EXIT |
218 User::Leave( KErrGeneral ); |
219 User::Leave( KErrGeneral ); |
219 } |
220 } |
220 REComSession& ecomSession = REComSession::OpenL(); |
221 iEComSession = &REComSession::OpenL(); |
221 CleanupClosePushL( ecomSession ); |
|
222 TPckgBuf<TUid> ifUidPckgBuf; |
222 TPckgBuf<TUid> ifUidPckgBuf; |
223 TInt retTemp = ReadStructFromMessage( ifUidPckgBuf, |
223 TInt retTemp = ReadStructFromMessage( ifUidPckgBuf, |
224 EATExtConnectParamUid, |
224 EATExtConnectParamUid, |
225 aMessage ); |
225 aMessage ); |
226 if ( retTemp != KErrNone ) |
226 if ( retTemp != KErrNone ) |
237 { |
237 { |
238 TRACE_FUNC_EXIT |
238 TRACE_FUNC_EXIT |
239 User::Leave( retTemp ); |
239 User::Leave( retTemp ); |
240 } |
240 } |
241 // Create listener |
241 // Create listener |
242 CATExtListen* listener = CATExtListen::NewLC( ecomSession, this ); |
242 CATExtListen* listener = CATExtListen::NewLC( *iEComSession, this ); |
243 listener->AddInterfaceUid( ifUidPckgBuf() ); |
243 listener->AddInterfaceUid( ifUidPckgBuf() ); |
244 // Create metadata. Pass iListener to add the UIDs |
244 // Create metadata. Pass iListener to add the UIDs |
245 CATExtMetadata* metadata = CATExtMetadata::NewLC( ecomSession, |
245 CATExtMetadata* metadata = CATExtMetadata::NewLC( *iEComSession, |
246 listener, |
246 listener, |
247 *this ); |
247 *this ); |
248 metadata->CreateImplementationMetadataL( ifUidPckgBuf(), connectionName ); |
248 metadata->CreateImplementationMetadataL( ifUidPckgBuf(), connectionName ); |
249 listener->IssueRequest(); |
249 listener->IssueRequest(); |
250 CleanupStack::Pop( metadata ); |
250 CleanupStack::Pop( metadata ); |
251 CleanupStack::Pop( listener ); |
251 CleanupStack::Pop( listener ); |
252 CleanupStack::PopAndDestroy( &connectionName ); |
252 CleanupStack::PopAndDestroy( &connectionName ); |
253 CleanupStack::Pop( &ecomSession ); |
|
254 iEComSession = ecomSession; |
|
255 iListener = listener; |
253 iListener = listener; |
256 iMetadata = metadata; |
254 iMetadata = metadata; |
257 TRACE_FUNC_EXIT |
255 TRACE_FUNC_EXIT |
258 } |
256 } |
259 |
257 |
320 TRACE_FUNC_EXIT |
318 TRACE_FUNC_EXIT |
321 return retTemp; |
319 return retTemp; |
322 } |
320 } |
323 // Third, check a case where there is support but reply is not |
321 // Third, check a case where there is support but reply is not |
324 // expected. In this case "" must be returned to complete processing. |
322 // expected. In this case "" must be returned to complete processing. |
|
323 // Note: The EFalse setting is used only for normal mode. |
325 if ( !complInfo.iReplyExpected ) |
324 if ( !complInfo.iReplyExpected ) |
326 { |
325 { |
327 // Return "" |
326 // Return "" |
328 TRACE_INFO(( _L8("Command handled with support but no reply: return \"\"") )); |
327 TRACE_INFO(( _L8("Command handled with support but no reply: return \"\"") )); |
329 iMetadata->CompleteCommandMessage( NULL, |
328 iMetadata->CompleteCommandMessage( NULL, |
332 EReplyTypeOther, // reply type from plugin |
331 EReplyTypeOther, // reply type from plugin |
333 EFalse ); // no multipart |
332 EFalse ); // no multipart |
334 TRACE_FUNC_EXIT |
333 TRACE_FUNC_EXIT |
335 return retTemp; |
334 return retTemp; |
336 } |
335 } |
337 // The rest are for known command with reply. This case is handled in |
336 // The rest are for known command with reply or data in editor mode. |
338 // HandleCommand(). |
337 // This case is handled in HandleCommand(). |
339 TRACE_INFO(( _L8("Command handled: wait for asynchronous reply or do nothing") )); |
338 TRACE_INFO(( _L8("Command handled: wait for asynchronous reply or do nothing") )); |
340 TRACE_FUNC_EXIT |
339 TRACE_FUNC_EXIT |
341 return KErrNone; |
340 return KErrNone; |
342 } |
341 } |
343 |
342 |