appfw/apparchitecture/apfile/apfmimecontentpolicy.cpp
changeset 81 676b6116ca93
parent 29 6a787171e1de
equal deleted inserted replaced
78:175a0d824084 81:676b6116ca93
    21 #include <caf/content.h>
    21 #include <caf/content.h>
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include <apgcli.h>    // For RApaLsSession 
    23 #include <apgcli.h>    // For RApaLsSession 
    24 #include <centralrepository.h>
    24 #include <centralrepository.h>
    25 #include <apmstd.h>
    25 #include <apmstd.h>
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "apfmimecontentpolicyTraces.h"
       
    29 #endif
       
    30 
    26 
    31 
    27 
    32 
    28 /* Closed content and extension information is stored in central repository with UID 0x10003A3F.
    33 /* Closed content and extension information is stored in central repository with UID 0x10003A3F.
    29  * Keys of the Closed Content and Extension information repository is divided into two parts.
    34  * Keys of the Closed Content and Extension information repository is divided into two parts.
    30  * Most significant byte is used for identifying the type,i.e. whether it is Mimetype or extension, 
    35  * Most significant byte is used for identifying the type,i.e. whether it is Mimetype or extension, 
   344 @param aMimeType  The mime type to be checked.
   349 @param aMimeType  The mime type to be checked.
   345 @return ETrue if given MIME type is in closed content list else returns EFalse.
   350 @return ETrue if given MIME type is in closed content list else returns EFalse.
   346 */
   351 */
   347 TBool CApfMimeContentPolicyImpl::IsClosedType(const TDesC& aMimeType) const 
   352 TBool CApfMimeContentPolicyImpl::IsClosedType(const TDesC& aMimeType) const 
   348 	{
   353 	{
   349 	TInt dummy = 0;
   354     OstTraceDefExt1( OST_TRACE_CATEGORY_DEBUG, APPARC_TRACE_FLOW, DUP2_CAPFMIMECONTENTPOLICYIMPL_ISCLOSEDTYPE, "CApfMimeContentPolicyImpl::IsClosedType: The MIME type to be checked : aMimeType=%S", aMimeType );
       
   355     
       
   356     TInt dummy = 0;
   350 	 
   357 	 
   351 	// Check if given descriptor is in closed content list.
   358 	// Check if given descriptor is in closed content list.
   352 	// Find() returns 0 if found from array, non-zero if not.
   359 	// Find() returns 0 if found from array, non-zero if not.
   353 	const TBool found = (iCcl->FindIsq(aMimeType, dummy) == 0);
   360 	const TBool found = (iCcl->FindIsq(aMimeType, dummy) == 0);
       
   361 	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, APPARC_TRACE_FLOW, DUP1_CAPFMIMECONTENTPOLICYIMPL_ISCLOSEDTYPE, "CApfMimeContentPolicyImpl::IsClosedType: Is the MIME type in the closed content list : found=%d", found );
   354 	return found;
   362 	return found;
   355 	}
   363 	}
   356 
   364 
   357 /**
   365 /**
   358 Checks the extension of given file against list of closed file extensions.
   366 Checks the extension of given file against list of closed file extensions.
   359 @param aFileExtension File extension to be checked.
   367 @param aFileExtension File extension to be checked.
   360 @return  ETrue  if extension of given file name is in closed extensions list else returns EFalse.
   368 @return  ETrue  if extension of given file name is in closed extensions list else returns EFalse.
   361 */
   369 */
   362 TBool CApfMimeContentPolicyImpl::IsClosedExtension(const TDesC& aFileExtension) const
   370 TBool CApfMimeContentPolicyImpl::IsClosedExtension(const TDesC& aFileExtension) const
   363 	{
   371 	{
       
   372     OstTraceDefExt1( OST_TRACE_CATEGORY_DEBUG, APPARC_TRACE_FLOW, DUP2_CAPFMIMECONTENTPOLICYIMPL_ISCLOSEDEXTENSION, "CApfMimeContentPolicyImpl::IsClosedExtension: File extension to be checked : aFileExtension=%S", aFileExtension );
       
   373     
       
   374     
   364 	TInt dummy = 0;
   375 	TInt dummy = 0;
   365 
   376 
   366 	// Check if given descriptor is in closed content list.
   377 	// Check if given descriptor is in closed content list.
   367 	// Find() returns 0 if found from array, non-zero if not.
   378 	// Find() returns 0 if found from array, non-zero if not.
   368 	const TBool found = (iExtList->FindIsq(aFileExtension, dummy) == 0);
   379 	const TBool found = (iExtList->FindIsq(aFileExtension, dummy) == 0);
       
   380 	
       
   381 	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, APPARC_TRACE_FLOW, DUP1_CAPFMIMECONTENTPOLICYIMPL_ISCLOSEDEXTENSION, "CApfMimeContentPolicyImpl::IsClosedExtension : Is the file extension in the closed extension list : found=%d", found );
   369 	return found;
   382 	return found;
   370 	}
   383 	}
   371 	
   384 	
   372 /**
   385 /**
   373 Checks if given file is Closed or not. This method checks for forward lock and superdistribution statuses 
   386 Checks if given file is Closed or not. This method checks for forward lock and superdistribution statuses