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.
26 #ifndef __AGENTINFO_H__
27 #define __AGENTINFO_H__
31 class CImplementationInformation;
33 #include <caf/agent.h>
35 namespace ContentAccess
41 Holds information about a Content Access Agent implementation.
43 The metadata is supplied in the agents resource file so the information can be
44 obtained without the need to construct the agent.
46 The AgentFactoryL() function is used by other CAF classes to access the
47 agent's CAgentFactory implementation.
52 class CAgentInfo : public CBase
56 Constructs a new CAgentInfo object from an ECOM CImplementationInfo.
58 @param aImplInfo An ECOM Implementation from REComSession::ListImplementationsL().
59 @return A new instance of a CAgentInfo object.
61 static CAgentInfo* NewLC(const CImplementationInformation& aImplInfo);
63 virtual ~CAgentInfo();
66 Determines whether this agent recognizes the supplier MIME type.
68 @param aSupplierMime The supplier MIME type to check.
69 @return ETrue, if the MIME type is a supported supplier MIME type.
71 TBool IsSupportedSupplier(const TDesC8& aSupplierMime) const;
74 Determines whether this agent recognizes the consumer MIME type.
76 @note Scheduled to be removed from the CAF API
77 recognizer uses MIME types based upon the content type, not the mime type
78 of the file itself. There will be no Consumer MIME types, only modified
81 @param aConsumerMime The consumer mime type to check.
82 @return ETrue, if the MIME type is a supported consumer MIME type.
84 TBool IsSupportedConsumer(const TDesC8& aConsumerMime) const;
87 * Exposes the array of supplier MIME types supported by this agent.
89 * @return The array of supplier MIME types.
91 const RPointerArray<HBufC8>& SupplierMimeTypes() const;
94 Exposes the array of consumer MIME types supported by this agent.
96 @note Scheduled to be removed from the CAF API
97 recognizer uses MIME types based upon the content type, not the
98 mime type of the file itself. There will be no Consumer mime types,
99 only modified content types.
101 @return A reference to the array of consumer mime types.
103 const RPointerArray<HBufC8>& ConsumerMimeTypes() const;
106 * Gets the preferred buffer size for this agent to recognize
107 * DRM files with the ContentAccess::CAgentResolver::DoRecognize() function.
109 * @return The preferred buffer size.
111 TInt PreferredBufferSize() const;
113 /** The private server directory managed by this agent
115 This function returns the directory under C:\\private\\ used by this
116 agent. This is specified in the agents resource file in the opaque_data
119 If the agent does not use a private directory the return value will be
122 @return The directory name
124 const TDesC& PrivateDirectoryName() const;
128 @return A reference to this agent
133 Accessor for agent factory.
135 Allows the factory to be constructed once and used many times.
136 DOES NOT transfer ownership of the CAgentFactory to the caller.
138 @return The CAgentFactory for this particular agent
140 CAgentFactory& AgentFactoryL();
143 Accessor to the agent manager.
145 The agent manager is stateless and this method allows it to be
146 constructed once and used several times. DOES NOT transfer ownership
147 of the CAgentManager to the caller.
149 @return The CAgentManager for this particular agent
151 CAgentManager& AgentManagerL();
156 void ConstructL(const CImplementationInformation& aImplInfo);
158 // Helper function to parse MIME types of the form:
159 // <mime1>,<mime2>,<mime3>
160 void ParseMimeTypesL(const TDesC8& aBuf, RPointerArray<HBufC8>& aMimeTypes);
162 // Helper to add descriptor to RPointerArray
163 void AddToArrayL(const TDesC8& aElement, RPointerArray<HBufC8>& aArray);
166 TInt iPreferredBufferSize;
167 RPointerArray<HBufC8> iSupplierMimeTypes;
168 RPointerArray<HBufC8> iConsumerMimeTypes;
170 CAgentFactory* iAgentFactory;
171 CAgentManager* iAgentManager;
173 // Holds the agent name and Implementation UID
176 // Agent private directory is a SID
177 TBuf <KMaxSIDLength> iPrivateDirectoryName;