Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "RecMmfUtilBody.h"
22 * constructor for MMF Recognizer utility class
24 CMmfRecognizerUtil::CMmfRecognizerUtil()
28 CMmfRecognizerUtil::~CMmfRecognizerUtil()
33 void CMmfRecognizerUtil::ConstructL()
35 iBody = CMmfRecognizerUtil::CBody::NewL();
41 * Determine whether the supplied data header on its own is recognized,
42 * or the data header plus the file suffix together are recognized,
43 * and if so return the associated MIME type.
46 * The name of the file
48 * A descriptor containing the header
50 * A user-supplied descriptor in which the MIME type is returned
51 * @leave KErrUnderflow
52 * Not enough data in descriptor to identify whether it is supported
54 * @leave This method may also leave with one of the system-wide error codes.
55 * @return EMatchNone if a match was not found.
56 * EMatchData if a data match was found.
57 * EMatchName if a data and file suffix match was found.
58 * @post If recognized, the caller's descriptor is filled with the MIME types
60 EXPORT_C CMmfRecognizerUtil::TMatchLevel CMmfRecognizerUtil::GetMimeTypeL(const TDesC& aFileName, const TDesC8& aImageData, TDes8& aMimeType)
62 return iBody->GetMimeTypeL(aFileName, aImageData, aMimeType);
68 * Static factory constructor. Uses two phase
69 * construction and leaves nothing on the cleanup stack
72 * @return A pointer to the newly created CMmfRecognizerUtil object
75 EXPORT_C CMmfRecognizerUtil* CMmfRecognizerUtil::NewL()
77 CMmfRecognizerUtil* self=new (ELeave) CMmfRecognizerUtil();
78 CleanupStack::PushL(self);
80 CleanupStack::Pop(self);
87 * Get all the mime types supported by MMF
89 * A caller-supplied array of descriptors.
90 * @leave This method may leave with one of the system-wide error codes.
91 * @post The caller's array is filled with the supported MIME types
93 EXPORT_C void CMmfRecognizerUtil::GetMimeTypesL(CDesC8Array* aMimeTypes)
95 CMmfRecognizerUtil::CBody::GetMimeTypesL(aMimeTypes);