#include <mw/DRMHelper.h>
class CDRMHelper : public CBase |
Handles some error situations DRM-aware applications may encounter.
IMPORT_C void | ActivateContentL | ( | CData & | aContent | ) |
Acquires rights for given content if rights have been expired or rights are missing. If content already has valid or future rights, does nothing. This function should be called when user selects activate from options menu. Leaves with system-wide error code in case of error.
IMPORT_C void | ActivateContentL | ( | TDesC & | aFileName | ) |
Acquires rights for given content if rights have been expired or rights are missing. If content already has valid or future rights, does nothing. This function should be called when user selects activate from options menu. Leaves with system-wide error code in case of error.
IMPORT_C TInt | CheckRightsAmountL | ( | const TDesC & | aFileName, |
TInt | aCount = KDRMHelperDefaultCountThreshold , | |||
TInt | aDays = KDRMHelperDefaultTimeThreshold | |||
) |
Returns: Button code Check rights for the file. If there is less than given amount of usage time/count/percentage left, appropriate note is displayed depending on situation. Button code Check rights for the file. If there is less than given amount of usage time/count/percentage left, appropriate note is displayed depending on situation. Button code Button code
IMPORT_C TInt | CheckRightsAmountL | ( | RFile & | aFileHandle, |
TInt | aCount = KDRMHelperDefaultCountThreshold , | |||
TInt | aDays = KDRMHelperDefaultTimeThreshold | |||
) |
Returns: Button code
IMPORT_C TInt | CheckRightsAmountL | ( | const TDesC8 & | aUri, |
TInt | aCount = KDRMHelperDefaultCountThreshold , | |||
TInt | aDays = KDRMHelperDefaultTimeThreshold | |||
) |
Check rights for the file. If there is less than given amount of usage time/count left, one of the following note is displayed depending on situation: 'Usage rights about to expire. View details?' 'Usage rights about to expire. N days left. View details?' 'Usage rights about to expire. 1 day left. View details?' 'Usage rights about to expire. N counts left. View details?' 'Usage rights about to expire. 1 count left. View details?' It also checks that rights are valid and displays appropriate note, if they are not.
Returns: Button code
IMPORT_C TInt | CheckRightsPercentL | ( | const TDesC & | aFileName, |
TInt | aThreshold = KDRMHelperDefaultPercentageThreshold | |||
) |
Check rights for the file. If there is less than aThreshold percent of usage time/count left, one of the following note is displayed depending on situation: 'Usage rights about to expire. View details?' 'Usage rights about to expire. N days left. View details?' 'Usage rights about to expire. 1 day left. View details?' 'Usage rights about to expire. N counts left. View details?' 'Usage rights about to expire. 1 count left. View details?' It also checks that rights are valid and displays appropriate note, if they are not.
Returns: Button code
IMPORT_C TInt | CheckRightsPercentL | ( | RFile & | aFileHandle, |
TInt | aThreshold = KDRMHelperDefaultPercentageThreshold | |||
) |
Returns: Button code
IMPORT_C TInt | Consume2 | ( | const TDesC8 & | aContentURI, |
TUint32 | aRightsSpec, | |||
TDRMHelperConsumeAction | anAction | |||
) |
Consume2
Overrides any rights consumption. This function must only be used by applications with user interaction and not by intermediate components. The main use cases are signalling that content is to be installed (including thumbnail generation), or that content is to be consumed. They are characterized as calls to this function with the correct intent (i.e. EPlay or EInstall) and the corresponding action (i.e. telling whether the indicated intent is started or finished). Calls to this function must be the result of a user interaction or otherwise high level event.
Returns: EOk if consume action was successfully signalled to the engine.
IMPORT_C TInt | ConsumeFile2 | ( | const TDesC & | aFileName, |
TUint32 | aRightsSpec, | |||
TDRMHelperConsumeAction | anAction | |||
) |
ConsumeFile2
Overrides any rights consumption. This function must only be used by applications with user interaction and not by intermediate components. The main use cases are signalling that content is to be installed (including thumbnail generation), or that content is to be consumed. They are characterized as calls to this function with the correct intent (i.e. EPlay or EInstall) and the corresponding action (i.e. telling whether the indicated intent is started or finished). Calls to this function must be the result of a user interaction or otherwise high level event.
Returns: EOk if consume action was successfully signalled to the engine.
IMPORT_C TInt | ConsumeFile2 | ( | RFile & | aFileHandle, |
TUint32 | aRightsSpec, | |||
TDRMHelperConsumeAction | anAction | |||
) |
ConsumeFile2
Overrides any rights consumption. This function must only be used by applications with user interaction and not by intermediate components. The main use cases are signalling that content is to be installed (including thumbnail generation), or that content is to be consumed. They are characterized as calls to this function with the correct intent (i.e. EPlay or EInstall) and the corresponding action (i.e. telling whether the indicated intent is started or finished). Calls to this function must be the result of a user interaction or otherwise high level event.
Returns: EOk if consume action was successfully signalled to the engine.
This method should be called after embedded preview has been played. It asks from user if he/she wants to buy rights and acquires those if user agrees. Leaves with system-wide error code in case of error.
Returns: ETrue if user selects to buy rights.
This method should be called after embedded preview has been played. It asks from user if he/she wants to buy rights and acquires those if user agrees. Leaves with system-wide error code in case of error.
Returns: ETrue if user selects to buy rights.
IMPORT_C TInt | GetContentURIList | ( | RPointerArray< HBufC8 > *& | aURIList | ) |
GetContentURIList
Returns a list of all content URIs that have rights in the rights database.
Returns: Ok if the URI list could be retreived.
IMPORT_C void | GetPreviewRightsL | ( | CData & | aContent | ) |
Acquires preview rights for given content. Leaves with system-wide error code in case of error.
IMPORT_C void | GetPreviewRightsL | ( | TDesC & | aFileName | ) |
Acquires preview rights for given content. Leaves with system-wide error code in case of error.
IMPORT_C void | GetRightsDetailsL | ( | const TDesC & | aFileName, |
TUint32 | aIntent, | |||
TBool & | aExpired, | |||
TBool & | aSendingAllowed, | |||
CDRMHelperRightsConstraints *& | aPlay, | |||
CDRMHelperRightsConstraints *& | aDisplay, | |||
CDRMHelperRightsConstraints *& | aExecute, | |||
CDRMHelperRightsConstraints *& | aPrint | |||
) |
Gets details of rights object associated of given file.
See also: caferr.h caftypes.h
Parameter | Description |
---|---|
aFileName | Full path to file |
aIntent | ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute |
aExpired | ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future |
aSendingAllowed | ETrue if content can be sent |
aPlay | play constraints, must be deleted by caller |
aDisplay | display constraints, must be deleted by caller |
aExecute | execute constraints, must be deleted by caller |
aPrint | print constraints, must be deleted by caller |
IMPORT_C void | GetRightsDetailsL | ( | RFile & | aFileHandle, |
TUint32 | aIntent, | |||
TBool & | aExpired, | |||
TBool & | aSendingAllowed, | |||
CDRMHelperRightsConstraints *& | aPlay, | |||
CDRMHelperRightsConstraints *& | aDisplay, | |||
CDRMHelperRightsConstraints *& | aExecute, | |||
CDRMHelperRightsConstraints *& | aPrint | |||
) |
Gets details of rights object associated of given file.
See also: caferr.h caftypes.h
Parameter | Description |
---|---|
aFileHandle | file handle to the file |
aIntent | ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute |
aExpired | ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future |
aSendingAllowed | ETrue if content can be sent |
aPlay | play constraints, must be deleted by caller |
aDisplay | display constraints, must be deleted by caller |
aExecute | execute constraints, must be deleted by caller |
aPrint | print constraints, must be deleted by caller |
IMPORT_C void | GetRightsDetailsL | ( | const TDesC & | aFileName, |
TUint32 | aIntent, | |||
TBool & | aExpired, | |||
TBool & | aSendingAllowed, | |||
CDRMRightsConstraints *& | aPlay, | |||
CDRMRightsConstraints *& | aDisplay, | |||
CDRMRightsConstraints *& | aExecute, | |||
CDRMRightsConstraints *& | aPrint | |||
) |
Gets details of rights object associated of given file.
See also: caferr.h caftypes.h
Parameter | Description |
---|---|
aFileName | Full path to file |
aIntent | ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute |
aExpired | ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future |
aSendingAllowed | ETrue if content can be sent |
aPlay | play constraints, must be deleted by caller |
aDisplay | display constraints, must be deleted by caller |
aExecute | execute constraints, must be deleted by caller |
aPrint | print constraints, must be deleted by caller |
IMPORT_C void | GetRightsDetailsL | ( | RFile & | aFileHandle, |
TUint32 | aIntent, | |||
TBool & | aExpired, | |||
TBool & | aSendingAllowed, | |||
CDRMRightsConstraints *& | aPlay, | |||
CDRMRightsConstraints *& | aDisplay, | |||
CDRMRightsConstraints *& | aExecute, | |||
CDRMRightsConstraints *& | aPrint | |||
) |
Gets details of rights object associated of given file.
See also: caferr.h caftypes.h
Parameter | Description |
---|---|
aFileHandle | file handle to the file |
aIntent | ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute |
aExpired | ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future |
aSendingAllowed | ETrue if content can be sent |
aPlay | play constraints, must be deleted by caller |
aDisplay | display constraints, must be deleted by caller |
aExecute | execute constraints, must be deleted by caller |
aPrint | print constraints, must be deleted by caller |
Displays appropriate error note depending on error code.
Returns: Button code, if user selected "buy rights" or "launch rights manager" in query.0 if user selected "No", "Back" or "Cancel" (or whatever which just dismiss the query)0 if just a simple error note is displayed
Displays: Handles error situations 'rights expired', 'no rights' and 'rights database corrupted'.
Returns: Button code, if user selected "buy rights" or "launch rights manager" in query.0 if user selected "No", "Back" or "Cancel" (or whatever which just dismiss the query)0 if just a simple error note is displayed
Returns: Button code, if user selected "buy rights" or "launch rights manager" in query.0 if user selected "No", "Back" or "Cancel" (or anything that just dismisses the query)0 if just a simple error note is displayed
Returns: KErrNone if the content is now usable (e.g. silent rights or preview rights were gotten). If the return code is KErrNone and the aEmbeddedPreviewUri parameter is not NULL, the player should use embedded preview KErrCancel if the user cancelled any of the actions within the function KErrCANoRights and KErrCANoPermission if after the function call, still no rights exist KErrCompletion if the user did launch the browser, but it is not clear whether the content was activated
IMPORT_C TInt | HandleErrorOrPreviewL | ( | TInt | aError, |
const TDesC & | aFileName, | |||
HBufC8 *& | aEmbeddedPreviewUri | |||
) |
Returns: KErrNone if the content is now usable (e.g. silent rights or preview rights were gotten). If the return code is KErrNone and the aEmbeddedPreviewUri parameter is not NULL, the player should use embedded preview KErrCancel if the user cancelled any of the actions within the function KErrCANoRights and KErrCANoPermission if after the function call, still no rights exist KErrCompletion if the user did launch the browser, but it is not clear whether the content was activated
IMPORT_C TDRMHelperPreviewType | HasPreviewL | ( | CData & | aContent, |
HBufC8 *& | aPreviewUri | |||
) |
Checks if given content has embedded preview or if it is possible to get preview rights for it. Leaves with system-wide error code in case of error.
Returns: preview type
IMPORT_C TDRMHelperPreviewType | HasPreviewL | ( | TDesC & | aFileName, |
HBufC8 *& | aPreviewUri | |||
) |
Checks if given content has embedded preview or if it is possible to get preview rights for it. Leaves with system-wide error code in case of error.
Returns: preview type
IMPORT_C void | IndicateIdle | ( | ) |
Returns: -
IMPORT_C void | LaunchDetailsViewEmbeddedL | ( | const TDesC8 & | aURI | ) |
Launches DRM Rights Manager UI embedded with details view related to given content.
Returns: -
IMPORT_C void | LaunchDetailsViewEmbeddedL | ( | const TDesC & | aFileName | ) |
Launches DRM Rights Manager UI embedded with details view related to given file.
Returns: -
IMPORT_C void | LaunchDetailsViewEmbeddedL | ( | RFile & | aFileHandle | ) |
Returns: -
IMPORT_C void | LaunchDetailsViewEmbeddedL | ( | const HBufC8 * | aContentURI | ) |
Launches DRM Rights Manager UI embedded with details view related to given content.
Returns: -
IMPORT_C CDRMHelper * | NewL | ( | CCoeEnv & | aCoeEnv, |
RFs & | aFs | |||
) | [static] |
IMPORT_C CDRMHelper * | NewL | ( | RFs & | aFs | ) | [static] |
IMPORT_C void | OpenInfoUrlL | ( | CData & | aContent | ) |
Opens browser with InfoUrl of the content. Leaves with system-wide error code in case of error.
IMPORT_C void | OpenInfoUrlL | ( | TDesC & | aFileName | ) |
Opens browser with InfoUrl of the content. Leaves with system-wide error code in case of error.
IMPORT_C TInt | SetAutomatedType | ( | TDRMHelperAutomatedType | aAutomatedType | ) |
Returns: System wide error code
IMPORT_C void | SetPercentageLimitL | ( | TUint | aPercentage | ) |
Set percentage limit for CheckRightsAmountL. Applies to both counts and time.
Returns: -
IMPORT_C TInt | SetPreviewMediaType | ( | TDRMHelperPreviewMediaType | aMediaType | ) |
Returns: System wide error code
Returns: System wide error code (KErrCancel if user pressed no to query).
Returns: System wide error code (KErrCancel if user pressed no to query).
Returns: System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt | ShowDRMUINotification2L | ( | TDRMHelperNotificationID | aTextId, |
const TDesC8 & | aURI | |||
) |
Parameter | Description |
---|---|
aTextId | The code for DRM general notification note. |
aURI | The DRM files URI, that caused the DRM error. |
Returns: KErrnone if everything went ok, else wide scale of Symbian errors
IMPORT_C TInt | ShowDRMUINotification2L | ( | TDRMHelperNotificationID | aTextId, |
const TDesC & | aFileName | |||
) |
Parameter | Description |
---|---|
aTextId | The code for DRM general notification note. |
aFileName | The DRM file's name and path, that caused the DRM error. |
Returns: KErrnone if everything went ok, else wide scale of Symbian errors
IMPORT_C TInt | SupportedDRMMethods2 | ( | TInt & | aDRMMethod, |
TDRMHelperOMALevel & | aOMALevel | |||
) |
SupportedDRMMethods
Returns the supported DRM protection methods and the OMA compliance level of the DRM engine
Returns: DRMCommon error code