First public contribution.
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
25 #ifndef __CAFAPARECOGNIZER_H__
26 #define __CAFAPARECOGNIZER_H__
32 const TUid KUidCafApaRecognizer = {0x101ff761};
34 class CMimeTypeMapping;
35 class RFileReadStream;
38 This is the apparc recognizer for files handled by the Content Access Framework.
39 It recognizes protected content and returns a mime type to apparc based upon a
42 @li A file containing one or more content object(s) that needs to be be passed
43 through the CAF supplier API before it can be used will be recognized as it's
44 native file mime type (eg. application/vnd.oma.drm.message).
46 @li A file containing more than one content object will be recognized as
47 <b>application/x-caf</b> regardless of what type of file it is. If the file
48 is recognized the method used to store the content objects inside the file
49 is irrelevant. CAF abstracts the process of navigating and reading from those
52 @li A file containing a single content object will be recognized as a mangled
53 version of that content object's mime type regardless of the type of file holding
54 that content object. The prefix "x-caf-" will be added to the content objects mime
55 type to distinguish it from normal content files with that mime type. For instance
56 a protected file containing an image/jpeg will be recognized as x-caf-image/jpeg
62 class CApaCafRecognizer : public CApaDataRecognizerType
65 static CApaCafRecognizer* NewL();
66 virtual ~CApaCafRecognizer();
68 // From CApaDataRecognizerType
69 virtual TUint PreferredBufSize();
70 virtual TDataType SupportedDataTypeL(TInt aIndex) const;
71 virtual void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
77 // Build a list of content types
78 void SetupContentTypesL();
79 TInt ReadLine(RFileReadStream& aFile, TDes8& aBuffer);
80 RPointerArray <CMimeTypeMapping> iContentTypes;
82 ContentAccess::CAgentResolver* iResolver;