ContentAccess::CSupplier Class Reference
class ContentAccess::CSupplier : public CBase |
Used to import files using a content access agent. In the case of some DRM agents the import will be a transformation from an unprotected content type to a protected content type.
It creates CImportFile objects to import files into a Content Access Agent. CSupplier uses it's CAgentResolver to determine which agent should receive the file based upon the mime type of the file.
Clients can check if a mime type is supported by by calling the CSupplier::IsImportSupported() function.
The CSupplier does not dynamically update it's list of agents so applications should not use a long term persistent instance of CSupplier.
Constructor & Destructor Documentation
Member Functions Documentation
ConstructL()
void | ConstructL | ( | ) | [private] |
ImportFileL(const TDesC8 &, const CMetaDataArray &, const TDesC &)
Creates a new CImportFile object and allow the agent to generate the output files
-
leave
- KErrCANoAgent No agent supports the mime type supplied in aMimeType
Parameters
const TDesC8 & aMimeType | This should be one of the mime types supported by CAF, IsImportSupported() can be used to check this. |
const CMetaDataArray & aImportMetaData | Any additional information that may be useful for the agent performing the import. Ideally this will include the mime headers for the file about to be passed into CAF. |
const TDesC & aSuggestedFileName | Suggested filename for the CAF agent to use when creating the output files, Details of the output files produced can be obtained using CImportFile::OutputFileL(). |
ImportFileL(const TDesC8 &, const CMetaDataArray &)
Creates a new CImportFile object where the caller must provide file handles to store output files.
This allows a server to store the output files within its own private directory. The CAF agent will write to the private directory using the file handle provided by the server.
If the agent requires a new output file it will return KErrCANewFileHandleRequired from CImportFile::Write() or CImportFile::WriteComplete() The application performing the supply should provide the agent with a new file handle using CImportFile::ContinueWithNewOutputFile();
-
leave
- KErrCANoAgent No agent supports the mime type supplied in aMimeType
Parameters
const TDesC8 & aMimeType | This should be one of the mime types supported a CAF agent, IsImportSupported() can be used to check this. |
const CMetaDataArray & aImportMetaData | Any additional information that may be useful for the agent performing the import. Ideally this will include the mime headers for the file about to be passed into CAF. |
ImportFileL(CCafMimeHeader &, const TDesC &)
Parameters
CCafMimeHeader & aMimeHeader | Mime headers associated with the file to import |
const TDesC & aSuggestedFileName | The application supplied name for any output file created by the agent |
IsImportSupported(const TDesC8 &)
IMPORT_C TBool | IsImportSupported | ( | const TDesC8 & | aMimeType | ) | |
Determines whether one of the CAF agents wants to import a file with the given mimetype
If this function returns ETrue the application should use the CSupplier to create a ContentAccess::CImportFile session and import the file into CAF.
Parameters
const TDesC8 & aMimeType | The mime type of the file determined by an Apparc recognition or transmission header information. |
PrepareHTTPRequestHeaders(RStringPool &, RHTTPHeaders &)
IMPORT_C void | PrepareHTTPRequestHeaders | ( | RStringPool & | aStringPool, |
| RHTTPHeaders & | aRequestHeaders |
| ) | const |
Get HTTP download headers from the agents
Some DRM schemes require specific headers to be present in the HTTP request header. This function allows a client to retrieve these headers from the agents so any download request will satisfy the criteria required by the HTTP server.
Parameters
RStringPool & aStringPool | The string pool used by the HTTP session |
RHTTPHeaders & aRequestHeaders | The agents will add any required fields to the headers |
SetOutputDirectoryL(const TDesC &)
IMPORT_C void | SetOutputDirectoryL | ( | const TDesC & | aOutputDirectory | ) | |
Sets the output directory for any files generated by the CAF.
Parameters
const TDesC & aOutputDirectory | The preferred location to store any output files |
Member Data Documentation
CAgentResolver * iAgentResolver
HBufC * iOutputDirectory
HBufC * | iOutputDirectory | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.