class ContentAccess::CAgentManager : public CBase |
Defines the agent interface for manager operations.
The CAgentManager is not related to any particular content object but used to manage files and settings belonging to this agent
All operations performed by the agent manager should be implemented in a transactional manner by either completing or reverting to the state before the function was called.
TInt | AgentSpecificCommand | ( | TInt | aCommand, |
const TDesC8 & | aInputBuffer, | |||
TDes8 & | aOutputBuffer | |||
) | [pure virtual] |
Allows extended synchronous calls to the agent Objects are passed in and out using serialization
void | AgentSpecificCommand | ( | TInt | aCommand, |
const TDesC8 & | aInputBuffer, | |||
TDes8 & | aOutputBuffer, | |||
TRequestStatus & | aStatus | |||
) | [pure virtual] |
Allows extended asynchronous calls to the agent. Objects can be passed in and out using serialization. NB: No assumption should be made about the scope of the descriptor passed to aInputBuffer for asynchronous IPC.
TInt aCommand | The agent defined command. |
const TDesC8 & aInputBuffer | Non modifyable input data buffer. |
TDes8 & aOutputBuffer | Modifyable output buffer to hold the result of the command. |
TRequestStatus & aStatus | Asynchronous 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. |
TInt | CancelNotifyStatusChange | ( | const TDesC & | aURI, |
TRequestStatus & | aStatus | |||
) | [pure virtual] |
const TDesC & aURI | The URI supplied in the call to NotifyStatusChange(). |
TRequestStatus & aStatus | The TRequestStatus supplied in the call to NotifyStatusChange(). |
TInt | CopyFile | ( | const TDesC & | aSource, |
const TDesC & | aDestination | |||
) | [pure virtual] |
Make a copy of the content file (eg to removable media) belonging to this agent
Access to the agents private directory is permitted at the agents discretion.
IMPORT_C TInt | CopyFile | ( | RFile & | aSource, |
const TDesC & | aDestination | |||
) | [virtual] |
Make a copy of the content file (eg to removable media) belonging to this agent using a file handle
Access to the agents private directory is permitted at the agents discretion.
TInt | DeleteFile | ( | const TDesC & | aFileName | ) | [pure virtual] |
Delete a file belonging to this agent
The agent implementation may delete rights that were associated with the content at the same time. If an agent does delete rights at the same time as the content it should display a confirmation dialog that makes it clear to the user the rights they paid for will be also deleted.
Execution will be blocked until any dialog displayed is complete. Applications can request to disable the agents user interface using the SetProperty() command
Access to the agents private directory is permitted at the agents discretion.
const TDesC & aFileName | The full pathname of the file to delete. |
void | DisplayInfoL | ( | TDisplayInfo | aInfo, |
const TVirtualPathPtr & | aVirtualPath | |||
) | [pure virtual] |
View information associated with a single content object
This call blocks execution and only returns once the display is dismissed by the user.
TDisplayInfo aInfo | The information to display. |
const TVirtualPathPtr & aVirtualPath | The content object. |
IMPORT_C void | DisplayInfoL | ( | TDisplayInfo | aInfo, |
RFile & | aFile, | |||
const TDesC & | aUniqueId | |||
) | [virtual] |
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.
TDisplayInfo aInfo | The information to display. |
RFile & aFile | The file handle for the file containing the content object. |
const TDesC & aUniqueId | The unique id of the content object. |
void | DisplayManagementInfoL | ( | ) | [pure virtual] |
Allow the agent to display management information for users to manage any settings or other information stored by the agent
The scope of this information is left to the agent implementation but it is expected that a DRM agent will display the state of all DRM rights objects (pending, available, expired, orphaned) and allow users to delete rights that are no longer required.
TInt | GetAttribute | ( | TInt | aAttribute, |
TInt & | aValue, | |||
const TVirtualPathPtr & | aVirtualPath | |||
) | [pure virtual] |
Get an attribute from a content object
TInt aAttribute | The attribute to retrieve, from ContentAccess::TAttribute. |
TInt & aValue | Used to return the value of the attribute. |
const TVirtualPathPtr & aVirtualPath | The content object whose attributes are to be queried. |
IMPORT_C TInt | GetAttribute | ( | TInt | aAttribute, |
TInt & | aValue, | |||
RFile & | aFile, | |||
const TDesC & | aUniqueId | |||
) | [virtual] |
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.
TInt | GetAttributeSet | ( | RAttributeSet & | aAttributeSet, |
const TVirtualPathPtr & | aVirtualPath | |||
) | [pure virtual] |
Get a set of attributes from a content object
RAttributeSet & aAttributeSet | The set of attributes to query and update. |
const TVirtualPathPtr & aVirtualPath | The content object to retrieve attributes from. |
IMPORT_C TInt | GetAttributeSet | ( | RAttributeSet & | aAttributeSet, |
RFile & | aFile, | |||
const TDesC & | aUniqueId | |||
) | [virtual] |
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.
RAttributeSet & aAttributeSet | The set of attributes to query and update. |
RFile & aFile | The file handle for the file containing the content object. |
const TDesC & aUniqueId | The unique id of the content object. |
TInt | GetDir | ( | const TDesC & | aName, |
TUint | aEntryAttMask, | |||
TUint | aEntrySortKey, | |||
CDir *& | aEntryList | |||
) | const [pure virtual] |
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.
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.
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.
The caller of this function is responsible for deleting aFileList after the function has returned.
This function can be used to list the contents of the agent's private directory. Access to the agents private directory is permitted at the agents discretion.
Agents can just return KErrCANotSupported if they do not wish to publish their private directory. Alternatively they can just populate the CDir object with the entries they wish to show.
const TDesC & aName | The name of the directory for which a listing is required. Wildcards may be used to specify particular files. |
TUint aEntryAttMask | Bitmask 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 aEntrySortKey | The 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 *& aEntryList | On return contains a filtered list of directory and file entries. |
TInt | GetDir | ( | const TDesC & | aName, |
TUint | aEntryAttMask, | |||
TUint | aEntrySortKey, | |||
CDir *& | aEntryList, | |||
CDir *& | aDirList | |||
) | const [pure virtual] |
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.
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.
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.
The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.
This function can be used to list the contents of the agent's private directory. Access to the agents private directory is permitted at the agents discretion.
Agents can just return KErrCANotSupported if they do not wish to publish their private directory. Alternatively they can just populate the CDir object with the entries they wish to show.
const TDesC & aName | The name of the directory for which a listing is required. Wildcards may be used to specify particular files. |
TUint aEntryAttMask | Bitmask 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 aEntrySortKey | The 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 *& aEntryList | On return contains a filtered list of directory and file entries. |
CDir *& aDirList | On return contains a filtered list of directory entries only. |
TInt | GetDir | ( | const TDesC & | aName, |
const TUidType & | aEntryUid, | |||
TUint | aEntrySortKey, | |||
CDir *& | aFileList | |||
) | const [pure virtual] |
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.
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.
The caller of this function is responsible for deleting aFileList after the function has returned.
This function can be used to list the contents of the agent's private directory. Access to the agents private directory is permitted at the agents discretion.
Agents can just return KErrCANotSupported if they do not wish to publish their private directory. Alternatively they can just populate the CDir object with the entries they wish to show.
const TDesC & aName | The name of the directory for which a listing is required. Wildcards may be used to specify particular files. |
const TUidType & aEntryUid | Only 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 aEntrySortKey | The 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 *& aFileList | On return contains a filtered list of directory and file entries. |
TInt | GetStringAttribute | ( | TInt | aAttribute, |
TDes & | aValue, | |||
const TVirtualPathPtr & | aVirtualPath | |||
) | [pure virtual] |
Get text string attributes or meta-data from the file
TInt aAttribute | The attribute to retrieve, from ContentAccess::TStringAttribute. |
TDes & aValue | Used to return the value of the attribute. |
const TVirtualPathPtr & aVirtualPath | The content object whose attributes are to be retrieved. |
IMPORT_C TInt | GetStringAttribute | ( | TInt | aAttribute, |
TDes & | aValue, | |||
RFile & | aFile, | |||
const TDesC & | aUniqueId | |||
) | [virtual] |
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.
TInt aAttribute | The attribute to retrieve, from ContentAccess::TAttribute. |
TDes & aValue | Used to return the value of the attribute. |
RFile & aFile | The file handle for the file containing the content object. |
const TDesC & aUniqueId | The unique id of the content object whose attributes are to be retrieved. |
TInt | GetStringAttributeSet | ( | RStringAttributeSet & | aStringAttributeSet, |
const TVirtualPathPtr & | aVirtualPath | |||
) | [pure virtual] |
Used to obtain a set of string attributes
RStringAttributeSet & aStringAttributeSet | The set of attributes to query and update. |
const TVirtualPathPtr & aVirtualPath | The content object whose attributes are to be retrieved. |
IMPORT_C TInt | GetStringAttributeSet | ( | RStringAttributeSet & | aStringAttributeSet, |
RFile & | aFile, | |||
const TDesC & | aUniqueId | |||
) | [virtual] |
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.
TBool | IsRecognizedL | ( | const TDesC & | aURI, |
TContentShareMode | aShareMode | |||
) | const [pure virtual] |
Identifies whether or not the file at the given URI is to be handled by this agent.
The agent should perform the mimimum possible processing to make the recognition process as fast as possible. It should avoid opening the file whenever possible.
The agent should leave only if a temporary or permanent condition prevents it from knowing whether it can detect the content's type.
const TDesC & aURI | Location of the file to be examined. |
TContentShareMode aShareMode | The share mode to use if the agent opens a file. |
TBool | IsRecognizedL | ( | RFile & | aFile | ) | const [pure virtual] |
Identifies whether or not the file is handled by this agent.
The agent should look at the name of the file first to try and avoid the need to read from the file.
The agent should leave only if a temporary or permanent condition prevents it from knowing whether it can detect the content's type.
RFile & aFile | An open file handle. |
TInt | MkDir | ( | const TDesC & | aPath | ) | [pure virtual] |
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.
const TDesC & aPath | The full pathname of the directory to create. |
TInt | MkDirAll | ( | const TDesC & | aPath | ) | [pure virtual] |
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.
const TDesC & aPath | The full pathname of the directory to create. |
void | NotifyStatusChange | ( | const TDesC & | aURI, |
TEventMask | aMask, | |||
TRequestStatus & | aStatus | |||
) | [pure virtual] |
Notify the caller when the status of a DRM protected content object changes. NB: No assumption should be made about the scope of the descriptor passed to aURI for asynchronous IPC.
const TDesC & aURI | The location of the file. |
TEventMask aMask | Bitmask of events the caller is interested in. |
TRequestStatus & aStatus | The TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications. |
void | PrepareHTTPRequestHeaders | ( | RStringPool & | aStringPool, |
RHTTPHeaders & | aRequestHeaders | |||
) | const [pure virtual] |
Prepare the HTTP request headers required to download files that may be required for this agent.
RStringPool & aStringPool | The string pool used by the HTTP session. |
RHTTPHeaders & aRequestHeaders | The agent will add any required headers to this object. |
TBool | RecognizeFileL | ( | const TDesC & | aFileName, |
const TDesC8 & | aBuffer, | |||
TDes8 & | aFileMimeType, | |||
TDes8 & | aContentMimeType | |||
) | const [pure virtual] |
Determines whether the file is recognized by this agent. If it is the agent will fill in the file mime type and content mime type.
The agent should attempt to recognized the file in an efficient manner It should avoid opening the file to provide the best performance.
The agent should leave only if a temporary or permanent condition prevents it from detecting content's type.
The agent SHOULD NOT perform any API policing on this API since it will be called from within the Apparc server's process.
If a file is recognized, the file mime type should always be set to the correct value. For the content mime type there are three special cases:
If the file needs to be imported through the Supplier API before it can be used then the agent should leave the aContentMimeType parameter blank (zero length).
If the file has no embedded content, eg an image/jpeg (.jpg) file the agent should leave the aContentMimeType parameter blank (zero length).
If more than one content object is contained within the file, the agent will set aContentMimeType to "application/x-caf" indicating it is an archive that can be navigated by CAF regardless of the actual file format.
const TDesC & aFileName | The name of the file to recognize. The name is examined, not the file itself. |
const TDesC8 & aBuffer | Buffer containing bytes from the start of the file. |
TDes8 & aFileMimeType | Used to return the mime type of the file to the caller. |
TDes8 & aContentMimeType | Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content. |
IMPORT_C TInt | RenameDir | ( | const TDesC & | aOldName, |
const TDesC & | aNewName | |||
) | [virtual] |
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.
TInt | RenameFile | ( | const TDesC & | aSource, |
const TDesC & | aDestination | |||
) | [pure virtual] |
Rename or move the content file (eg to removable media) belonging to this agent
Access to the agent private directories is permitted at the agents discretion.
TInt | RmDir | ( | const TDesC & | aPath | ) | [pure virtual] |
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.
const TDesC & aPath | The full pathname of the directory to remove. |
TInt | SetProperty | ( | TAgentProperty | aProperty, |
TInt | aValue | |||
) | [pure virtual] |
Allows an application to request the modification of a property within the agent. The agent may or may not permit the property to be changed
TAgentProperty aProperty | The property to set. |
TInt aValue | The value of the property. |
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.