appfw/apparchitecture/tef/TMimeRec1/recmime_1.CPP
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     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 "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 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code 
       
    20 */
       
    21 #include <ecom/implementationproxy.h>
       
    22 
       
    23 #include "appfwk_test_utils.h"
       
    24 #include "recmime_1.h"
       
    25 
       
    26 //
       
    27 
       
    28 const TInt KMaxBufferLength=1024; // maximum amount of buffer space we will ever use
       
    29 
       
    30 //
       
    31 
       
    32 /*
       
    33 DLL entry point
       
    34 */
       
    35 GLDEF_C TInt E32Dll()
       
    36 	{
       
    37 	return KErrNone;
       
    38 	}
       
    39 
       
    40 /*
       
    41 Private constructor
       
    42 */
       
    43 CTestMimeRecognizer::CTestMimeRecognizer()
       
    44 	:CApaDataRecognizerType(KUidMmrRecognizer_1, CApaDataRecognizerType::EHigh)
       
    45 	{
       
    46 	iCountDataTypes = KNumMimeTypes_1;
       
    47 	}
       
    48 	
       
    49 /*
       
    50 Ecom factory function
       
    51 */
       
    52 CApaDataRecognizerType* CTestMimeRecognizer::CreateRecognizerL()
       
    53 	{
       
    54 	return new (ELeave) CTestMimeRecognizer();
       
    55 	}
       
    56 	
       
    57 TUint CTestMimeRecognizer::PreferredBufSize()
       
    58 	{
       
    59 	return KMaxBufferLength;
       
    60 	}
       
    61 
       
    62 TDataType CTestMimeRecognizer::SupportedDataTypeL(TInt /*aIndex*/) const
       
    63 	{
       
    64 	return TDataType(KMimeMmrType);
       
    65 	}
       
    66 
       
    67 void CTestMimeRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& /*aBuffer*/)
       
    68 	{
       
    69     // If an error stops CTestMimeRecognizer being removed as part of test cleanup, 
       
    70     // returning ENotRecognized will avoid the possibility of impacting other test code.
       
    71 	if (aName == KLitDocPath)
       
    72 		{
       
    73 		iDataType = TDataType(KMimeMmrType);
       
    74 		iConfidence = EPossible;
       
    75 		}
       
    76 	else
       
    77 		{
       
    78 		iDataType=TDataType();
       
    79 		iConfidence=ENotRecognized;
       
    80 		}	
       
    81 	}
       
    82 
       
    83 const TImplementationProxy ImplementationTable[] = 
       
    84     {
       
    85 	IMPLEMENTATION_PROXY_ENTRY(KUidMmrRecognizerValue_1, CTestMimeRecognizer::CreateRecognizerL)
       
    86 	};
       
    87 
       
    88 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    89     {
       
    90     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    91     return ImplementationTable;
       
    92     }