imaging/imagingfws/src/Reciclutil.cpp
changeset 0 5752a19fdefe
equal deleted inserted replaced
-1:000000000000 0:5752a19fdefe
       
     1 // Copyright (c) 2003-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 "RecIclUtilBody.h"
       
    17 
       
    18 /**
       
    19  * @internalComponent
       
    20  *
       
    21  * constructor for ICL Recognizer utility class
       
    22  */
       
    23 CIclRecognizerUtil::CIclRecognizerUtil()
       
    24 	{
       
    25 	}
       
    26 
       
    27 CIclRecognizerUtil::~CIclRecognizerUtil()
       
    28 	{
       
    29 	delete iBody;
       
    30 	}
       
    31 
       
    32 void CIclRecognizerUtil::ConstructL()
       
    33 	{
       
    34 	iBody = CIclRecognizerUtil::CBody::NewL();
       
    35 	}
       
    36 
       
    37 /**
       
    38  * @internalComponent
       
    39  *
       
    40  * Determine whether the supplied data header or file extension is recognized
       
    41  * and if so return the associated MIME type
       
    42  * @param	aImageData
       
    43  *          A descriptor containing the header. Set to KNullDesC8 for match by file extension.
       
    44  * @param	aFileName
       
    45  *			A file name for file extension matching. Set to KNullDesC for match by image data
       
    46  * @param   aMimeType
       
    47  *          A user-supplied descriptor in which the MIME type is returned
       
    48  * @return	ETrue if a match was found.
       
    49  *			EFalse if a match was not found.
       
    50  * @leave	This method may also leave with one of the system-wide error codes.
       
    51  * @post    If recognized, the caller's descriptor is filled with the MIME types
       
    52  */
       
    53 EXPORT_C TBool CIclRecognizerUtil::GetMimeTypeL(const TDesC8& aImageData, const TDesC& aFileName, TDes8& aMimeType)
       
    54 	{
       
    55 	return iBody->GetMimeTypeL(aImageData, aFileName, aMimeType);
       
    56 	}
       
    57 
       
    58 /**
       
    59  * @internalComponent
       
    60  *
       
    61  * Static factory constructor. Uses two phase
       
    62  * construction and leaves nothing on the cleanup stack
       
    63  *
       
    64  * @leave KErrNoMemory
       
    65  * @return A pointer to the newly created CIclRecognizerUtil object
       
    66  *
       
    67  */
       
    68 EXPORT_C CIclRecognizerUtil* CIclRecognizerUtil::NewL()
       
    69 	{
       
    70 	CIclRecognizerUtil* self=new (ELeave) CIclRecognizerUtil();   
       
    71 	CleanupStack::PushL(self);
       
    72 	self->ConstructL();
       
    73 	CleanupStack::Pop(self);
       
    74 	return self;
       
    75 	}
       
    76