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 .
Public Member Functions | |
---|---|
~CSupplier () | |
IMPORT_C CImportFile * | ImportFileL (const TDesC8 &, const CMetaDataArray &, const TDesC &) |
IMPORT_C CImportFile * | ImportFileL (const TDesC8 &, const CMetaDataArray &) |
IMPORT_C CImportFile * | ImportFileL ( CCafMimeHeader &, const TDesC &) |
IMPORT_C TBool | IsImportSupported (const TDesC8 &) |
IMPORT_C CSupplier * | NewL () |
IMPORT_C CSupplier * | NewLC () |
IMPORT_C void | PrepareHTTPRequestHeaders (RStringPool &, RHTTPHeaders &) |
IMPORT_C void | SetOutputDirectoryL (const TDesC &) |
Private Member Functions | |
---|---|
CSupplier () | |
void | ConstructL () |
Private Attributes | |
---|---|
CAgentResolver * | iAgentResolver |
HBufC * | iOutputDirectory |
IMPORT_C CImportFile * | ImportFileL | ( | const TDesC8 & | aMimeType, |
const CMetaDataArray & | aImportMetaData, | |||
const TDesC & | aSuggestedFileName | |||
) |
Creates a new CImportFile object and allow the agent to generate the output files
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(). |
IMPORT_C CImportFile * | ImportFileL | ( | const TDesC8 & | aMimeType, |
const CMetaDataArray & | aImportMetaData | |||
) |
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() ;
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. |
IMPORT_C CImportFile * | ImportFileL | ( | CCafMimeHeader & | aMimeHeader, |
const TDesC & | aSuggestedFileName | |||
) |
Import a file
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 |
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.
const TDesC8 & aMimeType | The mime type of the file determined by an Apparc recognition or transmission header information. |
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.
RStringPool & aStringPool | The string pool used by the HTTP session |
RHTTPHeaders & aRequestHeaders | The agents will add any required fields to the headers |
IMPORT_C void | SetOutputDirectoryL | ( | const TDesC & | aOutputDirectory | ) |
Sets the output directory for any files generated by the CAF.
const TDesC & aOutputDirectory | The preferred location to store any output files |
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.