351 } |
351 } |
352 } |
352 } |
353 return *iDefaultAgent; |
353 return *iDefaultAgent; |
354 } |
354 } |
355 |
355 |
356 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
357 |
|
358 CAgentInfo& CAgentResolver::ResolveFileL(const TDesC8& aHeaderData) |
|
359 { |
|
360 // Go through all the agents and return the one which supports the given WMDRM content. |
|
361 |
|
362 TInt agentsCount(iAgentInfos.Count()); |
|
363 CAgentManager* agentManager = NULL; |
|
364 |
|
365 for (TInt i = 0; i < agentsCount; ++i) |
|
366 { |
|
367 TRAPD(result, agentManager = &iAgentInfos[i]->AgentManagerL()); |
|
368 if(result != KErrNone) |
|
369 { |
|
370 if(KErrNoMemory == result) |
|
371 { |
|
372 User::Leave(result); |
|
373 } |
|
374 else |
|
375 { |
|
376 continue; |
|
377 } |
|
378 } |
|
379 |
|
380 if (agentManager->IsRecognizedL(aHeaderData)) |
|
381 { |
|
382 return *iAgentInfos[i]; |
|
383 } |
|
384 } |
|
385 |
|
386 // will never reach here |
|
387 return *iDefaultAgent; |
|
388 } |
|
389 |
|
390 |
|
391 EXPORT_C TBool CAgentResolver::DoRecognizeL(const TDesC8& aHeader, TDes8& aFileMimeType, TDes8& aContentMimeType) |
|
392 { |
|
393 // Go through all the agents and return the one which supports the given WMDRM content. |
|
394 TInt agentsCount(iAgentInfos.Count()); |
|
395 CAgentManager* agentManager = NULL; |
|
396 for (TInt i = 0; i < agentsCount; ++i) |
|
397 { |
|
398 TRAPD(result, agentManager = &iAgentInfos[i]->AgentManagerL()); |
|
399 if(result != KErrNone) |
|
400 { |
|
401 if(KErrNoMemory == result) |
|
402 { |
|
403 User::Leave(result); |
|
404 } |
|
405 else |
|
406 { |
|
407 continue; |
|
408 } |
|
409 } |
|
410 |
|
411 if (agentManager->RecognizeContentL(aHeader, aFileMimeType, aContentMimeType)) |
|
412 { |
|
413 // force to lower case to ensure that chosen lower case scheme for mime types is maintained |
|
414 aFileMimeType.LowerCase(); |
|
415 aContentMimeType.LowerCase(); |
|
416 return ETrue; |
|
417 } |
|
418 } |
|
419 |
|
420 return EFalse; |
|
421 } |
|
422 |
|
423 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
424 |
|
425 TUid CAgentResolver::ResolveDirectory(const TDesC& aPath, TDes& aActualPath, TBool& aThePrivateDir) const |
356 TUid CAgentResolver::ResolveDirectory(const TDesC& aPath, TDes& aActualPath, TBool& aThePrivateDir) const |
426 { |
357 { |
427 TInt i = 0; |
358 TInt i = 0; |
428 TInt pathLength = 0; |
359 TInt pathLength = 0; |
429 TBuf <KPrivateDirAndDriveLength> pathLowerCase; |
360 TBuf <KPrivateDirAndDriveLength> pathLowerCase; |