ContentAccess::CManager Class Reference

class ContentAccess::CManager : public CBase

Manages files and content access agents

Inherits from

  • ContentAccess::CManager
Public Member Functions
~CManager()
IMPORT_C TIntAgentSpecificCommand(TAgent &, TInt, const TDesC8 &, TDes8 &)
IMPORT_C voidAgentSpecificCommand(TAgent &, TInt, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C TIntCancelNotifyStatusChange(const TDesC &, TRequestStatus &)
IMPORT_C TIntCopyFile(const TDesC &, const TDesC &)
IMPORT_C TIntCopyFile(RFile &, const TDesC &)
IMPORT_C CRightsManager *CreateRightsManagerL(TAgent &)
IMPORT_C TIntDeleteFile(const TDesC &)
IMPORT_C voidDeleteFileL(const TDesC &)
IMPORT_C voidDisplayInfoL(TDisplayInfo, const TVirtualPathPtr &)
IMPORT_C voidDisplayInfoL(TDisplayInfo, RFile &, const TDesC &)
IMPORT_C voidDisplayManagementInfoL(TAgent &)
IMPORT_C TIntGetAttribute(TInt, TInt &, const TVirtualPathPtr &)
IMPORT_C TIntGetAttribute(TInt, TInt &, RFile &, const TDesC &)
IMPORT_C TIntGetAttributeSet(RAttributeSet &, const TVirtualPathPtr &)
IMPORT_C TIntGetAttributeSet(RAttributeSet &, RFile &, const TDesC &)
IMPORT_C TIntGetDir(const TDesC &, TUint, TUint, CDir *&)
IMPORT_C TIntGetDir(const TDesC &, TUint, TUint, CDir *&, CDir *&)
IMPORT_C TIntGetDir(const TDesC &, const TUidType &, TUint, CDir *&)
IMPORT_C TIntGetStringAttribute(TInt, TDes &, const TVirtualPathPtr &)
IMPORT_C TIntGetStringAttribute(TInt, TDes &, RFile &, const TDesC &)
IMPORT_C TIntGetStringAttributeSet(RStringAttributeSet &, const TVirtualPathPtr &)
IMPORT_C TIntGetStringAttributeSet(RStringAttributeSet &, RFile &, const TDesC &)
IMPORT_C voidListAgentsL(RArray< TAgent > &)
IMPORT_C TIntMkDir(const TDesC &)
IMPORT_C TIntMkDirAll(const TDesC &)
IMPORT_C CManager *NewL()
IMPORT_C CManager *NewLC()
IMPORT_C voidNotifyStatusChange(const TDesC &, TEventMask, TRequestStatus &)
IMPORT_C TIntRenameDir(const TDesC &, const TDesC &)
IMPORT_C TIntRenameFile(const TDesC &, const TDesC &)
IMPORT_C TIntRmDir(const TDesC &)
IMPORT_C TIntSetProperty(TAgentProperty, TInt)
Private Member Functions
CManager()
voidConstructL()
voidDoCancelNotifyStatusChangeL(const TDesC &, TRequestStatus &)
voidDoCopyFileL(const TDesC &, const TDesC &)
voidDoCopyFileL(RFile &, const TDesC &)
voidDoDeleteFileL(const TDesC &)
voidDoGetAttributeL(TInt, TInt &, const TVirtualPathPtr &)
voidDoGetAttributeL(TInt, TInt &, RFile &, const TDesC &)
voidDoGetAttributeSetL(RAttributeSet &, const TVirtualPathPtr &)
voidDoGetAttributeSetL(RAttributeSet &, RFile &, const TDesC &)
voidDoGetDirL(const TDesC &, TUint, TUint, CDir *&)
voidDoGetDirL(const TDesC &, TUint, TUint, CDir *&, CDir *&)
voidDoGetDirL(const TDesC &, const TUidType &, TUint, CDir *&)
voidDoGetStringAttributeL(TInt, TDes &, const TVirtualPathPtr &)
voidDoGetStringAttributeL(TInt, TDes &, RFile &, const TDesC &)
voidDoGetStringAttributeSetL(RStringAttributeSet &, const TVirtualPathPtr &)
voidDoGetStringAttributeSetL(RStringAttributeSet &, RFile &, const TDesC &)
voidDoMkDirAllL(const TDesC &)
voidDoMkDirL(const TDesC &)
voidDoNotifyStatusChangeL(const TDesC &, TEventMask, TRequestStatus &)
voidDoRenameDirL(const TDesC &, const TDesC &)
voidDoRenameFileL(const TDesC &, const TDesC &)
voidDoRmDirL(const TDesC &)
voidDoSetPropertyL(TAgentProperty, TInt)
voidGetListOfAgentPrivateDirectoriesL(CDir *&)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CAgentResolver *iResolver

Constructor & Destructor Documentation

CManager()

CManager()[private]

~CManager()

~CManager()[virtual]

destructor

Member Functions Documentation

AgentSpecificCommand(TAgent &, TInt, const TDesC8 &, TDes8 &)

IMPORT_C TIntAgentSpecificCommand(TAgent &aAgent,
TIntaCommand,
const TDesC8 &aInputBuffer,
TDes8 &aOutputBuffer
)

Allows extended synchronous calls to an agent

capability
DRM Access to extended DRM agent functions is not permitted for processes without DRM capability

Parameters

TAgent & aAgentThe agent.
TInt aCommandThe agent defined command.
const TDesC8 & aInputBufferNon modifyable input data buffer.
TDes8 & aOutputBufferModifyable output buffer to hold the result of the command.

AgentSpecificCommand(TAgent &, TInt, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C voidAgentSpecificCommand(TAgent &aAgent,
TIntaCommand,
const TDesC8 &aInputBuffer,
TDes8 &aOutputBuffer,
TRequestStatus &aStatus
)

Allows extended asynchronous calls to an agent. NB: It is important that the descriptor passed to aOutputBuffer remains in scope until the request has completed.

capability
DRM Access to extended DRM agent functions is not permitted for processes without DRM capability

Parameters

TAgent & aAgentThe agent.
TInt aCommandThe agent defined command.
const TDesC8 & aInputBufferNon modifyable input data buffer.
TDes8 & aOutputBufferModifyable output buffer to hold the result of the command.
TRequestStatus & aStatusAsynchronous request status. On completion this will contain one of the following error codes: KErrNone if the command was successful. KErrCANotSupported if the agent does not recognize the command. KErrPermissionDenied if the agent does not permit the client to execute this command. Otherwise one of the other CAF error codes defined in caferr.h or one of the other system-wide error codes for any other errors.

CancelNotifyStatusChange(const TDesC &, TRequestStatus &)

IMPORT_C TIntCancelNotifyStatusChange(const TDesC &aURI,
TRequestStatus &aStatus
)
Cancel a previous notification request
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted

Parameters

const TDesC & aURIThe URI supplied in the call to NotifyStatusChange().
TRequestStatus & aStatusThe TRequestStatus supplied in the call to NotifyStatusChange().

ConstructL()

voidConstructL()[private]

CopyFile(const TDesC &, const TDesC &)

IMPORT_C TIntCopyFile(const TDesC &aSource,
const TDesC &aDestination
)const

Make a copy of a file (eg to removable media)

Access to the agents private directory is permitted at the agents discretion.

capability
DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted

Parameters

const TDesC & aSourceThe full pathname of the source file.
const TDesC & aDestinationThe full pathname of the destination file.

CopyFile(RFile &, const TDesC &)

IMPORT_C TIntCopyFile(RFile &aSourceFile,
const TDesC &aDestination
)const

Make a copy of a file (eg to removable media) using a file handle

Access to the agents private directory is permitted at the agents discretion.

capability
DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted

Parameters

RFile & aSourceFileThe handle the source file.
const TDesC & aDestinationThe full pathname of the destination file.

CreateRightsManagerL(TAgent &)

IMPORT_C CRightsManager *CreateRightsManagerL(TAgent &aAgent)const

Allow clients to list, view and delete the rights contained by an agent in a generic manner.

This function is only relevant for agents implementing a DRM scheme. Other agents will leave with KErrCANotSupported if an application attempts to invoke the rights manager.

To manage the rights in a more comprehensive manner the application should use the DisplayManagementInfoL() function where the agent can present its own management information.

leave
KErrCANotSupported If the agent does not implement DRM or support rights management.
leave
KErrPermissionDenied If the agent does not allow the client to create a rights manager.
capability
DRM Access to DRM rights is not permitted for processes without DRM capability.

Parameters

TAgent & aAgentThe agent to create a rights manager object.

DeleteFile(const TDesC &)

IMPORT_C TIntDeleteFile(const TDesC &aFileName)const

Delete a file on the device

The agent who manages the file will be used to delete it.

In the case of a DRM agent implementation it may delete rights that were associated with the file at the same time. If an agent deletes rights at the same time as the content it will display a confirmation dialog that makes it clear that the rights will be also deleted.

Access to the agent private directories is permitted at the agents discretion.

capability
DRM Deleting DRM protected content is not permitted for processes without DRM capability.

Parameters

const TDesC & aFileNameThe full pathname of the file to delete.

DeleteFileL(const TDesC &)

IMPORT_C voidDeleteFileL(const TDesC &aFileName)[static]

Delete a file Use DeleteFile() instead.

Parameters

const TDesC & aFileNameThe file to delete.

DisplayInfoL(TDisplayInfo, const TVirtualPathPtr &)

IMPORT_C voidDisplayInfoL(TDisplayInfoaInfo,
const TVirtualPathPtr &aVirtualPath
)

View information associated with a single content object

This call blocks execution and only returns once the display is dismissed by the user

ContentAccess::TDisplayInfo
leave
KErrCANotSupported if agent cannot display the requested information.
leave
... One of the other CAF error codes defined in caferr.h or one of the system-wide error codes for any other errors.
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

TDisplayInfo aInfoThe information to display.
const TVirtualPathPtr & aVirtualPathThe content object.

DisplayInfoL(TDisplayInfo, RFile &, const TDesC &)

IMPORT_C voidDisplayInfoL(TDisplayInfoaInfo,
RFile &aFile,
const TDesC &aUniqueId
)

View information associated with a single content object in a file specified by file handle. Can be used when the source file is in the client's private directory.

This call blocks execution and only returns once the display is dismissed by the user.

leave
KErrCANotSupported if the feature not supported or if agent cannot display the requested information.
leave
... One of the other CAF error codes defined in caferr.h or one of the system-wide error codes for any other errors.
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

TDisplayInfo aInfoThe information to display.
RFile & aFileThe file handle for the file containing the content object.
const TDesC & aUniqueIdThe unique id of the content object.

DisplayManagementInfoL(TAgent &)

IMPORT_C voidDisplayManagementInfoL(TAgent &aAgent)

Allows a client to display management information for a particular agent

This allows a user to see all the specific information associated with a particular agent. In the case of an agent implementing DRM this could include the ability to list, view or delete DRM rights objects.

leave
KErrCANotSupported If the specified agent does not support the display of management information.
capability
DRM Agents implementing DRM may not display their management dialog to processes without DRM capability

Parameters

TAgent & aAgentThe agent.

DoCancelNotifyStatusChangeL(const TDesC &, TRequestStatus &)

voidDoCancelNotifyStatusChangeL(const TDesC &aURI,
TRequestStatus &aStatus
)[private]

Parameters

const TDesC & aURI
TRequestStatus & aStatus

DoCopyFileL(const TDesC &, const TDesC &)

voidDoCopyFileL(const TDesC &aSource,
const TDesC &aDestination
)const [private]

Parameters

const TDesC & aSource
const TDesC & aDestination

DoCopyFileL(RFile &, const TDesC &)

voidDoCopyFileL(RFile &aSourceFile,
const TDesC &aDestination
)const [private]

Parameters

RFile & aSourceFile
const TDesC & aDestination

DoDeleteFileL(const TDesC &)

voidDoDeleteFileL(const TDesC &aFileName)const [private]

Parameters

const TDesC & aFileName

DoGetAttributeL(TInt, TInt &, const TVirtualPathPtr &)

voidDoGetAttributeL(TIntaAttribute,
TInt &aValue,
const TVirtualPathPtr &aVirtualPath
)const [private]

Parameters

TInt aAttribute
TInt & aValue
const TVirtualPathPtr & aVirtualPath

DoGetAttributeL(TInt, TInt &, RFile &, const TDesC &)

voidDoGetAttributeL(TIntaAttribute,
TInt &aValue,
RFile &aFile,
const TDesC &aUniqueId
)const [private]

Parameters

TInt aAttribute
TInt & aValue
RFile & aFile
const TDesC & aUniqueId

DoGetAttributeSetL(RAttributeSet &, const TVirtualPathPtr &)

voidDoGetAttributeSetL(RAttributeSet &aAttributeSet,
const TVirtualPathPtr &aVirtualPath
)const [private]

Parameters

RAttributeSet & aAttributeSet
const TVirtualPathPtr & aVirtualPath

DoGetAttributeSetL(RAttributeSet &, RFile &, const TDesC &)

voidDoGetAttributeSetL(RAttributeSet &aAttributeSet,
RFile &aFile,
const TDesC &aUniqueId
)const [private]

Parameters

RAttributeSet & aAttributeSet
RFile & aFile
const TDesC & aUniqueId

DoGetDirL(const TDesC &, TUint, TUint, CDir *&)

voidDoGetDirL(const TDesC &aName,
TUintaEntryAttMask,
TUintaEntrySortKey,
CDir *&aEntryList
)const [private]

Parameters

const TDesC & aName
TUint aEntryAttMask
TUint aEntrySortKey
CDir *& aEntryList

DoGetDirL(const TDesC &, TUint, TUint, CDir *&, CDir *&)

voidDoGetDirL(const TDesC &aName,
TUintaEntryAttMask,
TUintanEntrySortKey,
CDir *&aEntryList,
CDir *&aDirList
)const [private]

Parameters

const TDesC & aName
TUint aEntryAttMask
TUint anEntrySortKey
CDir *& aEntryList
CDir *& aDirList

DoGetDirL(const TDesC &, const TUidType &, TUint, CDir *&)

voidDoGetDirL(const TDesC &aName,
const TUidType &aEntryUid,
TUintaEntrySortKey,
CDir *&aFileList
)const [private]

Parameters

const TDesC & aName
const TUidType & aEntryUid
TUint aEntrySortKey
CDir *& aFileList

DoGetStringAttributeL(TInt, TDes &, const TVirtualPathPtr &)

voidDoGetStringAttributeL(TIntaAttribute,
TDes &aValue,
const TVirtualPathPtr &aVirtualPath
)const [private]

Parameters

TInt aAttribute
TDes & aValue
const TVirtualPathPtr & aVirtualPath

DoGetStringAttributeL(TInt, TDes &, RFile &, const TDesC &)

voidDoGetStringAttributeL(TIntaAttribute,
TDes &aValue,
RFile &aFile,
const TDesC &aUniqueId
)const [private]

Parameters

TInt aAttribute
TDes & aValue
RFile & aFile
const TDesC & aUniqueId

DoGetStringAttributeSetL(RStringAttributeSet &, const TVirtualPathPtr &)

voidDoGetStringAttributeSetL(RStringAttributeSet &aStringAttributeSet,
const TVirtualPathPtr &aVirtualPath
)const [private]

Parameters

RStringAttributeSet & aStringAttributeSet
const TVirtualPathPtr & aVirtualPath

DoGetStringAttributeSetL(RStringAttributeSet &, RFile &, const TDesC &)

voidDoGetStringAttributeSetL(RStringAttributeSet &aStringAttributeSet,
RFile &aFile,
const TDesC &aUniqueId
)const [private]

Parameters

RStringAttributeSet & aStringAttributeSet
RFile & aFile
const TDesC & aUniqueId

DoMkDirAllL(const TDesC &)

voidDoMkDirAllL(const TDesC &aPath)const [private]

Parameters

const TDesC & aPath

DoMkDirL(const TDesC &)

voidDoMkDirL(const TDesC &aPath)const [private]

Parameters

const TDesC & aPath

DoNotifyStatusChangeL(const TDesC &, TEventMask, TRequestStatus &)

voidDoNotifyStatusChangeL(const TDesC &aURI,
TEventMaskaMask,
TRequestStatus &aStatus
)[private]

Parameters

const TDesC & aURI
TEventMask aMask
TRequestStatus & aStatus

DoRenameDirL(const TDesC &, const TDesC &)

voidDoRenameDirL(const TDesC &aOldName,
const TDesC &aNewName
)const [private]

Parameters

const TDesC & aOldName
const TDesC & aNewName

DoRenameFileL(const TDesC &, const TDesC &)

voidDoRenameFileL(const TDesC &aSource,
const TDesC &aDestination
)const [private]

Parameters

const TDesC & aSource
const TDesC & aDestination

DoRmDirL(const TDesC &)

voidDoRmDirL(const TDesC &aPath)const [private]

Parameters

const TDesC & aPath

DoSetPropertyL(TAgentProperty, TInt)

voidDoSetPropertyL(TAgentPropertyaProperty,
TIntaValue
)[private]

Parameters

TAgentProperty aProperty
TInt aValue

GetAttribute(TInt, TInt &, const TVirtualPathPtr &)

IMPORT_C TIntGetAttribute(TIntaAttribute,
TInt &aValue,
const TVirtualPathPtr &aVirtualPath
)const

Get an attribute from a content object

ContentAccess::TAttributee.g.

		TInt value = 0;
		CManager* manager = CManager::NewL();
		
		err = manager->GetAttribute(EIsProtected, value, aVirtualPath);
		if(err == KErrNone && value)
			{
			DisplayPadLock();
			}
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

TInt aAttributeThe attribute to retrieve, from ContentAccess::TAttribute.
TInt & aValueUsed to return the value of the attribute.
const TVirtualPathPtr & aVirtualPathThe content object whose attributes are to be queried.

GetAttribute(TInt, TInt &, RFile &, const TDesC &)

IMPORT_C TIntGetAttribute(TIntaAttribute,
TInt &aValue,
RFile &aFile,
const TDesC &aUniqueId
)

Get a content's attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.

capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

TInt aAttributeThe attribute to retrieve, from ContentAccess::TAttribute.
TInt & aValueUsed to return the value of the attribute.
RFile & aFileThe file handle for the file containing the content object.
const TDesC & aUniqueIdThe unique id of the content object.

GetAttributeSet(RAttributeSet &, const TVirtualPathPtr &)

IMPORT_C TIntGetAttributeSet(RAttributeSet &aAttributeSet,
const TVirtualPathPtr &aVirtualPath
)const

Get a set of attributes from a content object

ContentAccess::TAttributeThe following example determines whether the content object is protected and has rights that will enable it to be viewed by the user

		TInt err = KErrNone;
		TInt value = 0;
		
		// The manager		
		CManager* manager = CManager::NewLC();

		// Prepare the RAttributeSet object with the attributes to query		
		RAttributeSet attributeSet;
		CleanupClosePushL(attributeSet);
		attributeSet.AddL(EProtected);
		attributeSet.AddL(ECanView);
		
		// Retrieve the attributes from the agent
		User::LeaveIfError(manager->GetAttributeSet(attributeSet, aVirtualPath));
		
		// Check if the content object is protected
		err =attributeSet.GetValue(EProtected, value);
		if(err == KErrNone && value)
			{
			// content object is DRM protected
			}
		
		// Check if the content object can be display on screen
		err = attributeSet.GetValue(ECanView, value);
		if(err == KErrNone && value)
			{
			// content object is DRM protected
			}
	
  		// Can reuse the RAttributeSet if necessary
		User::LeaveIfError(manager->GetAttributeSet(attributeSet, aVirtualPath));
		
		...
		// Finished
		CleanupStack::PopAndDestroy(2);		// manager, attributeSet.Close()
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

RAttributeSet & aAttributeSetThe set of attributes to query and update.
const TVirtualPathPtr & aVirtualPathThe content object to retrieve attributes from.

GetAttributeSet(RAttributeSet &, RFile &, const TDesC &)

IMPORT_C TIntGetAttributeSet(RAttributeSet &aAttributeSet,
RFile &aFile,
const TDesC &aUniqueId
)

Get a content's set of attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.

capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

RAttributeSet & aAttributeSetThe set of attributes to query and update.
RFile & aFileThe file handle for the file containing the content object.
const TDesC & aUniqueIdThe unique id of the content object.

GetDir(const TDesC &, TUint, TUint, CDir *&)

IMPORT_C TIntGetDir(const TDesC &aName,
TUintaEntryAttMask,
TUintaEntrySortKey,
CDir *&aEntryList
)const

Gets a filtered list of a directory's contents.

The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.

Notes:
  1. If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.

  2. The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.

  3. The caller of this function is responsible for deleting aFileList after the function has returned.

Access to agent private directories is permitted at the agents discretion.

TEntryKey
capability
DRM Required when attempting to access an agents private directory

Parameters

const TDesC & aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
TUint aEntryAttMaskBitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes
TUint aEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
CDir *& aEntryListOn return contains a filtered list of directory and file entries.

GetDir(const TDesC &, TUint, TUint, CDir *&, CDir *&)

IMPORT_C TIntGetDir(const TDesC &aName,
TUintaEntryAttMask,
TUintaEntrySortKey,
CDir *&aEntryList,
CDir *&aDirList
)const

Gets a filtered list of the directory and file entries contained in a directory and a list of the directory entries only

The bitmask determines which file and directory entry types should be listed in aFileList. The contents of the second list, aDirList are not affected by the bitmask; it returns all directory entries contained in directory aName. The sort key determines the order in which both lists are sorted.

Notes:
  1. If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.

  2. The function sets both aFileList and aDirList to NULL, and then allocates memory to them before appending entries to the lists. Therefore, aFileList and aDirList should have no memory allocated to them before this function is called, otherwise the allocated memory will become orphaned.

  3. The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.

Access to agent private directories is permitted at the agents discretion.

TEntryKey
capability
DRM Required when attempting to access an agents private directory.

Parameters

const TDesC & aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
TUint aEntryAttMaskBitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in aFileList. aDirList is unaffected by this mask. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
TUint aEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries in both lists are to be sorted. These flags are defined by TEntryKey.
CDir *& aEntryListOn return contains a filtered list of directory and file entries.
CDir *& aDirListOn return contains a filtered list of directory entries only.

GetDir(const TDesC &, const TUidType &, TUint, CDir *&)

IMPORT_C TIntGetDir(const TDesC &aName,
const TUidType &aEntryUid,
TUintaEntrySortKey,
CDir *&aFileList
)const

Gets a filtered list of a directory's contents by UID

The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.

Notes:
  1. The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.

  2. The caller of this function is responsible for deleting aFileList after the function has returned.

Access to agent private directories is permitted at the agents discretion.

TEntryKey
capability
DRM Required when attempting to access an agents private directory.

Parameters

const TDesC & aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
const TUidType & aEntryUidOnly those files whose UIDs match those specified within this UID type will be included in the file list. Any, or all, of the three UIDs within the UID type may be omitted. Any UID which is omitted acts in a similar manner to a wildcard character, matching to all UIDs.
TUint aEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
CDir *& aFileListOn return contains a filtered list of directory and file entries.

GetListOfAgentPrivateDirectoriesL(CDir *&)

voidGetListOfAgentPrivateDirectoriesL(CDir *&aDir)const [private]

Populate the list of agents in the CDirStreamable

Parameters

CDir *& aDirReference to a CDir pointer, this pointer must be set to NULL

GetStringAttribute(TInt, TDes &, const TVirtualPathPtr &)

IMPORT_C TIntGetStringAttribute(TIntaAttribute,
TDes &aValue,
const TVirtualPathPtr &aVirtualPath
)const

Get text string attributes or meta-data from the file

ContentAccess::TStringAttributee.g.
		CManager* manager = CManager::NewLC();
		
		TBuf <MAX_PATH> previewUri;
		if(manager->GetStringAttribute(EPreviewURI, previewUri, uri) == KErrNone)
			{
			DisplayPreview(previewUri);
			}
			
		CleanupStack::PopAndDestroy();	// manager

Parameters

TInt aAttributeThe attribute to retrieve, from ContentAccess::TStringAttribute.
TDes & aValueUsed to return the value of the attribute.
const TVirtualPathPtr & aVirtualPathThe content object whose attributes are to be retrieved.

GetStringAttribute(TInt, TDes &, RFile &, const TDesC &)

IMPORT_C TIntGetStringAttribute(TIntaAttribute,
TDes &aValue,
RFile &aFile,
const TDesC &aUniqueId
)

Get a content's text string attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.

capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

TInt aAttributeThe attribute to retrieve, from ContentAccess::TAttribute.
TDes & aValueUsed to return the value of the attribute.
RFile & aFileThe file handle for the file containing the content object.
const TDesC & aUniqueIdThe unique id of the content object whose attributes are to be retrieved.

GetStringAttributeSet(RStringAttributeSet &, const TVirtualPathPtr &)

IMPORT_C TIntGetStringAttributeSet(RStringAttributeSet &aStringAttributeSet,
const TVirtualPathPtr &aVirtualPath
)const

Used to obtain a set of string attributes

ContentAccess::TStringAttribute
		TInt err = KErrNone;
		TInt value = 0;
		
		CManager* manager = CManager::NewLC();
		
		// Prepare the RStringAttributeSet object with the attributes to query		
		RStringAttributeSet stringAttributeSet;
		CleanupClosePushL(stringAttributeSet);
		stringAttributeSet.AddL(EPreviewURI);
		
		// Retrieve the attributes from the agent
		User::LeaveIfError(manager->GetAttributeSet(stringAttributeSet, aVirtualPath));
		
		// display preview
		TBuf <MAX_PATH> previewUri;
		if(stringAttributeSet.GetValue(ECanView, previewUri))
			{
			DisplayPreview(previewUri);
			}
	
		// Finished
		CleanupStack::PopAndDestroy(2);		// manager, stringAttributeSet.Close()
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

RStringAttributeSet & aStringAttributeSetThe set of attributes to query and update.
const TVirtualPathPtr & aVirtualPathThe content object whose attributes are to be retrieved.

GetStringAttributeSet(RStringAttributeSet &, RFile &, const TDesC &)

IMPORT_C TIntGetStringAttributeSet(RStringAttributeSet &aStringAttributeSet,
RFile &aFile,
const TDesC &aUniqueId
)

Get a content's set of string attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.

capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.

Parameters

RStringAttributeSet & aStringAttributeSetThe set of attributes to query and update.
RFile & aFileThe file handle for the file containing the content object.
const TDesC & aUniqueIdThe unique id of the content object whose attributes are to be retrieved

ListAgentsL(RArray< TAgent > &)

IMPORT_C voidListAgentsL(RArray< TAgent > &aAgents)

List all the agents installed on the device (except F32Agent)

The caller must call RPointerArray::ResetAndDestroy() on the array when it has finished.

Parameters

RArray< TAgent > & aAgentsOn completion this will contain a list of all the agents.

MkDir(const TDesC &)

IMPORT_C TIntMkDir(const TDesC &aPath)const

Create a directory

This function can be used to create a directory within in the agent's private directory. Access to the agents private directory is permitted at the agents discretion.

capability
DRM Required when attempting to access an agents private directory.

Parameters

const TDesC & aPathThe full pathname of the directory to create.

MkDirAll(const TDesC &)

IMPORT_C TIntMkDirAll(const TDesC &aPath)const

Create all directories in the given path if they do not exist

This function can be used to create directories within in the agent's private directory. Access to the agents private directory is permitted at the agents discretion.

capability
DRM Required when attempting to access an agents private directory.

Parameters

const TDesC & aPathThe full pathname of the directory to create.

NewL()

IMPORT_C CManager *NewL()[static]

Creates a CManager

NewLC()

IMPORT_C CManager *NewLC()[static]

Creates a CManager

NotifyStatusChange(const TDesC &, TEventMask, TRequestStatus &)

IMPORT_C voidNotifyStatusChange(const TDesC &aURI,
TEventMaskaMask,
TRequestStatus &aStatus
)

Notify the caller when the status of a DRM protected content object changes

ContentAccess::TEventMask
capability
DRM Deleting DRM protected content is not permitted for processes without DRM capability.

Parameters

const TDesC & aURIThe location of the file.
TEventMask aMaskBitmask of events the caller is interested in.
TRequestStatus & aStatusThe TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications.

RenameDir(const TDesC &, const TDesC &)

IMPORT_C TIntRenameDir(const TDesC &aOldName,
const TDesC &aNewName
)const

Rename a directory

This function can be used to rename a directory from within the agent's private directory. Access to the agents private directory is permitted at the agents discretion.

capability
DRM Required when attempting to access an agents private directory

Parameters

const TDesC & aOldNameThe existing pathname of the directory to rename.
const TDesC & aNewNameThe new pathname of the directory.

RenameFile(const TDesC &, const TDesC &)

IMPORT_C TIntRenameFile(const TDesC &aSource,
const TDesC &aDestination
)const

Rename or move the content file (eg to removable media)

Access to the agent private directories is permitted at the agents discretion.

capability
DRM Moving DRM protected files is not permitted for processes without DRM capability. Moving unprotected files is permitted

Parameters

const TDesC & aSourceThe full pathname of the source file.
const TDesC & aDestinationThe full pathname of the destination file.

RmDir(const TDesC &)

IMPORT_C TIntRmDir(const TDesC &aPath)const

Remove a directory

This function can be used to remove a directory from within the agent's private directory. Access to the agents private directory is permitted at the agents discretion.

capability
DRM Required when attempting to access an agents private directory

Parameters

const TDesC & aPathThe full pathname of the directory to remove.

SetProperty(TAgentProperty, TInt)

IMPORT_C TIntSetProperty(TAgentPropertyaProperty,
TIntaValue
)

Request all agents to set a property value. If the property is set it is only set for this CManager session and does not impact other CAF users.

ContentAccess::TAgentProperty
capability
DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted

Parameters

TAgentProperty aPropertyThe property to set.
TInt aValueThe value of the property.

Member Data Documentation

CAgentResolver * iResolver

CAgentResolver *iResolver[private]