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.

Inherits from

  • ContentAccess::CSupplier

Constructor & Destructor Documentation

CSupplier()

CSupplier()[private]

~CSupplier()

~CSupplier()[virtual]

destructor

Member Functions Documentation

ConstructL()

voidConstructL()[private]

ImportFileL(const TDesC8 &, const CMetaDataArray &, const TDesC &)

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

leave
KErrCANoAgent No agent supports the mime type supplied in aMimeType

Parameters

const TDesC8 & aMimeTypeThis should be one of the mime types supported by CAF, IsImportSupported() can be used to check this.
const CMetaDataArray & aImportMetaDataAny 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 & aSuggestedFileNameSuggested 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 &)

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();

leave
KErrCANoAgent No agent supports the mime type supplied in aMimeType

Parameters

const TDesC8 & aMimeTypeThis should be one of the mime types supported a CAF agent, IsImportSupported() can be used to check this.
const CMetaDataArray & aImportMetaDataAny 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 &)

IMPORT_C CImportFile *ImportFileL(CCafMimeHeader &aMimeHeader,
const TDesC &aSuggestedFileName
)

Import a file

Parameters

CCafMimeHeader & aMimeHeaderMime headers associated with the file to import
const TDesC & aSuggestedFileNameThe application supplied name for any output file created by the agent

IsImportSupported(const TDesC8 &)

IMPORT_C TBoolIsImportSupported(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 & aMimeTypeThe mime type of the file determined by an Apparc recognition or transmission header information.

NewL()

IMPORT_C CSupplier *NewL()[static]

Create a new CSupplier

NewLC()

IMPORT_C CSupplier *NewLC()[static]

Create a new CSupplier

PrepareHTTPRequestHeaders(RStringPool &, RHTTPHeaders &)

IMPORT_C voidPrepareHTTPRequestHeaders(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 & aStringPoolThe string pool used by the HTTP session
RHTTPHeaders & aRequestHeadersThe agents will add any required fields to the headers

SetOutputDirectoryL(const TDesC &)

IMPORT_C voidSetOutputDirectoryL(const TDesC &aOutputDirectory)

Sets the output directory for any files generated by the CAF.

Parameters

const TDesC & aOutputDirectoryThe preferred location to store any output files

Member Data Documentation

CAgentResolver * iAgentResolver

CAgentResolver *iAgentResolver[private]

HBufC * iOutputDirectory

HBufC *iOutputDirectory[private]