localisation/apparchitecture/tef/TMimeRec1/recmime_1.CPP
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 2007-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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Symbian test code 
       
    22 */
       
    23 #include <ImplementationProxy.h>
       
    24 
       
    25 #include "appfwk_test_utils.h"
       
    26 #include "recmime_1.h"
       
    27 
       
    28 /////////////////////////////////////////////////
       
    29 
       
    30 const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
       
    31 
       
    32 /////////////////////////////////////////////////
       
    33 
       
    34 /*
       
    35 DLL entry point
       
    36 */
       
    37 GLDEF_C TInt E32Dll()
       
    38 	{
       
    39 	return KErrNone;
       
    40 	}
       
    41 
       
    42 /*
       
    43 Private constructor
       
    44 */
       
    45 CTestMimeRecognizer::CTestMimeRecognizer()
       
    46 	:CApaDataRecognizerType(KUidMmrRecognizer_1, CApaDataRecognizerType::EHigh)
       
    47 	{
       
    48 	iCountDataTypes = KNumMimeTypes_1;
       
    49 	}
       
    50 	
       
    51 /*
       
    52 Ecom factory function
       
    53 */
       
    54 CApaDataRecognizerType* CTestMimeRecognizer::CreateRecognizerL()
       
    55 	{
       
    56 	return new (ELeave) CTestMimeRecognizer();
       
    57 	}
       
    58 	
       
    59 TUint CTestMimeRecognizer::PreferredBufSize()
       
    60 	{
       
    61 	return KMaxBufferLength;
       
    62 	}
       
    63 
       
    64 TDataType CTestMimeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
       
    65 	{
       
    66 	return TDataType(KMimeMmrType);
       
    67 	}
       
    68 
       
    69 void CTestMimeRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& /*aBuffer*/)
       
    70 	{
       
    71     // If an error stops CTestMimeRecognizer being removed as part of test cleanup, 
       
    72     // returning ENotRecognized will avoid the possibility of impacting other test code.
       
    73 	if (aName == KLitDocPath)
       
    74 		{
       
    75 		iDataType = TDataType(KMimeMmrType);
       
    76 		iConfidence = EPossible;
       
    77 		}
       
    78 	else
       
    79 		{
       
    80 		iDataType=TDataType();
       
    81 		iConfidence=ENotRecognized;
       
    82 		}	
       
    83 	}
       
    84 
       
    85 const TImplementationProxy ImplementationTable[] = 
       
    86     {
       
    87 	IMPLEMENTATION_PROXY_ENTRY(KUidMmrRecognizerValue_1, CTestMimeRecognizer::CreateRecognizerL)
       
    88 	};
       
    89 
       
    90 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    91     {
       
    92     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    93     return ImplementationTable;
       
    94     }