genericservices/mimerecognitionfw/rec/RECAPP.CPP
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <apmrec.h>
       
    17 #include <apmstd.h>
       
    18 #include "RECAPP.H"
       
    19 #include <ecom/implementationproxy.h> 
       
    20 
       
    21 //
       
    22 // This is a very odd recognizer - it doesn't know how many things it recognizes
       
    23 // It assumes there are none.
       
    24 //
       
    25 
       
    26 const TInt KMimeAppRecognizerValue=0x1000415F;
       
    27 const TUid KUidMimeAppRecognizer={KMimeAppRecognizerValue};
       
    28 const TInt KAppNumMimeTypes=0;
       
    29 
       
    30 CApaAppRecognizer::CApaAppRecognizer()
       
    31 	:CApaDataRecognizerType(KUidMimeAppRecognizer,CApaDataRecognizerType::EHigh)
       
    32 	// All these mime types have reasonable recognition
       
    33 	{
       
    34 	iCountDataTypes=KAppNumMimeTypes;
       
    35 	}
       
    36 
       
    37 TUint CApaAppRecognizer::PreferredBufSize()
       
    38 	{
       
    39 	return 16;
       
    40 	}
       
    41 
       
    42 TDataType CApaAppRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
       
    43 	{
       
    44 	return TDataType();
       
    45 	}
       
    46 
       
    47 void CApaAppRecognizer::DoRecognizeL(const TDesC& /*aName*/, const TDesC8& aBuffer)
       
    48 	{
       
    49 	if (aBuffer.Length()>=16)
       
    50 		{
       
    51 		const TUidType uids(TCheckedUid(aBuffer.Left(16)).UidType());
       
    52 #if defined(_UNICODE)
       
    53 		if (uids[1].iUid==0x10003a12)
       
    54 #else
       
    55 		if (uids[1].iUid==0x1000006d)
       
    56 #endif
       
    57  			{
       
    58 	 		iDataType=TDataType(uids[2]);
       
    59 	 		iConfidence=ECertain;
       
    60 	 		}
       
    61 		}
       
    62 	}
       
    63 
       
    64 CApaDataRecognizerType* CApaAppRecognizer::CreateRecognizerL()
       
    65 	{
       
    66 	return new (ELeave) CApaAppRecognizer();
       
    67 	}
       
    68 
       
    69 const TImplementationProxy ImplementationTable[] = 
       
    70     {
       
    71 	IMPLEMENTATION_PROXY_ENTRY(0x101F7D9F,CApaAppRecognizer::CreateRecognizerL)
       
    72 	};
       
    73 
       
    74 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    75     {
       
    76     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    77     return ImplementationTable;
       
    78     }
       
    79 
       
    80 
       
    81 
       
    82 
       
    83 GLDEF_C TInt E32Dll(
       
    84 					)
       
    85 //
       
    86 // DLL entry point
       
    87 //
       
    88 	{
       
    89 	return KErrNone;
       
    90 	}