CDRMHelper Class Reference

API published in: S60 2nd Ed FP 2

Link against: drmhelper.lib

Capability Information

Required Capabilities

None

Exceptions

The capability DRM is required in:

CDRMHelper::Consume2( const TDesC8& aContentURI, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction); If the calling process doesn't have Nokia VID and "aRightsSpec is EInstall or EPeek"

CDRMHelper::ConsumeFile2( const TDesC& aFileName, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction); If the calling process doesn't have Nokia VID and "aRightsSpec is EInstall or EPeek"

CDRMHelper::ConsumeFile2( RFile& aFileHandle, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction); If the calling process doesn't have Nokia VID and "aRightsSpec is EInstall or EPeek"


#include <drmhelper.h>

Inherits MAknServerAppExitObserver.


Detailed Description

Handles some error situations DRM-aware applications may encounter.

Public Types

enum   TDRMHelperNotificationID { ETActivateTextId = 1, ETCountBasedErrorTextId = 2, ETCountUsageReduceId = 3, ETCountUsageReduceMediaId = 4 }
enum   TDRMHelperConsumeAction { EStart, EFinish, EPause, EContinue }
enum   TDRMHelperOMALevel { EOMA_None, EOMA_1_0, EOMA_2_0 }
enum   TDRMHelperPreviewType { ENoPreview, EEmbeddedPreview, EPreviewRights }
enum   TDRMHelperAutomatedType {
  EAutomatedTypeRingingTone, EAutomatedTypeMessageAlert, EAutomatedTypeEmailAlert, EAutomatedTypeIMAlert,
  EAutomatedTypeCalendarAlarm, EAutomatedTypeScreenSaver, EAutomatedTypeWallpaper, EAutomatedTypeTheme,
  EAutomatedTypeClockAlarm, EAutomatedTypeOther = KMaxTUint8
}
enum   TDRMHelperDRMMethods { EForwardLock = 0x0001, ECombinedDelivery = 0x0002, ESeparateDelivery = 0x0004, ESuperDistribution = 0x0008 }

Public Member Functions

IMPORT_C  ~CDRMHelper ()
  Destructor.
IMPORT_C TInt  HandleErrorL (TInt aError, const TDesC8 &aURI)
  Displays appropriate error note depending on error code.
IMPORT_C TInt  HandleErrorL (TInt aError, const TDesC &aFileName)
  Displays: Handles error situations 'rights expired', 'no rights' and 'rights database corrupted'.
IMPORT_C TInt  HandleErrorL (TInt aError, RFile &aFileHandle)
  Displays: Handles error situations 'rights expired', 'no rights' and 'rights database corrupted'.
IMPORT_C TInt  HandleErrorOrPreviewL (TInt aError, RFile &aFile, HBufC8 *&aEmbeddedPreviewUri)
  Handles DRM-specific error situations.
IMPORT_C TInt  HandleErrorOrPreviewL (TInt aError, const TDesC &aFileName, HBufC8 *&aEmbeddedPreviewUri)
  Handles DRM specific error situations.
IMPORT_C TInt  CheckRightsAmountL (const TDesC &aFileName, TInt aCount=KDRMHelperDefaultCountThreshold, TInt aDays=KDRMHelperDefaultTimeThreshold)
  Check rights for the file.
IMPORT_C TInt  CheckRightsAmountL (RFile &aFileHandle, TInt aCount=KDRMHelperDefaultCountThreshold, TInt aDays=KDRMHelperDefaultTimeThreshold)
  Check rights for the file.
IMPORT_C TInt  CheckRightsAmountL (const TDesC8 &aUri, TInt aCount=KDRMHelperDefaultCountThreshold, TInt aDays=KDRMHelperDefaultTimeThreshold)
  Check rights for the file.
IMPORT_C TInt  CheckRightsPercentL (const TDesC &aFileName, TInt aThreshold=KDRMHelperDefaultPercentageThreshold)
  Check rights for the file.
IMPORT_C TInt  CheckRightsPercentL (RFile &aFileHandle, TInt aThreshold=KDRMHelperDefaultPercentageThreshold)
  Check rights for the file.
IMPORT_C void  LaunchDetailsViewEmbeddedL (const TDesC8 &aURI)
  Launches DRM Rights Manager UI embedded with details view related to given content.
IMPORT_C void  LaunchDetailsViewEmbeddedL (const TDesC &aFileName)
  Launches DRM Rights Manager UI embedded with details view related to given file.
IMPORT_C void  LaunchDetailsViewEmbeddedL (RFile &aFileHandle)
  Launches DRM Rights Manager UI embedded with details view related to given file.
IMPORT_C void  LaunchDetailsViewEmbeddedL (const HBufC8 *aContentURI)
  Launches DRM Rights Manager UI embedded with details view related to given content.
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.
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.
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.
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.
IMPORT_C TInt  SetAutomated (const TDesC8 &aURI)
  Registers given content to be used as an automated content.
IMPORT_C TInt  SetAutomated (const TDesC &aFilename)
  Registers given content to be used as an automated content.
IMPORT_C TInt  SetAutomated (RFile &aFileHandle)
  Registers given content to be used as an automated content.
IMPORT_C TInt  ShowAutomatedNote (const TDesC8 &aURI)
  Displays the confirmation query about setting given content as an automated content.
IMPORT_C TInt  ShowAutomatedNote (const TDesC &aFilename)
  Displays the confirmation query about setting given content as an automated content.
IMPORT_C TInt  ShowAutomatedNote (RFile &aFileHandle)
  Displays the confirmation query about setting given content as an automated content.
IMPORT_C TInt  SetAutomatedPassive (const TDesC8 &aURI)
  Registers given content to be used as an automated content.
IMPORT_C TInt  SetAutomatedPassive (const TDesC &aFilename)
  Registers given content to be used as an automated content.
IMPORT_C TInt  SetAutomatedPassive (RFile &aFileHandle)
  Registers given content to be used as an automated content.
IMPORT_C TInt  SetAutomatedSilent (const TDesC8 &aURI, TBool aActive)
  Registers given content to be used as an automated content without confirmation query.
IMPORT_C TInt  SetAutomatedSilent (const TDesC &aFilename, TBool aActive)
  Registers given content to be used as an automated content without confirmation query.
IMPORT_C TInt  SetAutomatedSilent (RFile &aFileHandle, TBool aActive)
  Registers given content to be used as an automated content without confirmation query.
IMPORT_C TInt  RemoveAutomated (const TDesC8 &aURI)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  RemoveAutomated (const TDesC &aFilename)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  RemoveAutomated (RFile &aFileHandle)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  RemoveAutomatedPassive (const TDesC8 &aURI)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  RemoveAutomatedPassive (const TDesC &aFilename)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  RemoveAutomatedPassive (RFile &aFileHandle)
  Unregisters given content to be used as an automated content.
IMPORT_C TInt  CanSetAutomated (const TDesC8 &aURI, TBool &aValue)
  Checks if given content can be set as an automated content.
IMPORT_C TInt  CanSetAutomated (const TDesC &aFilename, TBool &aValue)
  Checks if given content can be set as an automated content.
IMPORT_C TInt  CanSetAutomated (RFile &aFileHandle, TBool &aValue)
  Checks if given content can be set as an automated content.
IMPORT_C void  IndicateIdle ()
  Informs DRMHelper that idle-screen has been activated.
IMPORT_C TInt  ShowDRMUINotification2L (TDRMHelperNotificationID aTextId, const TDesC8 &aURI)
  Handle the general UI based error notes.
IMPORT_C TInt  ShowDRMUINotification2L (TDRMHelperNotificationID aTextId, const TDesC &aFileName)
  Handle the general UI based error notes.
IMPORT_C void  SetCountLimitL (TUint aCounts)
  Set count limit for CheckRightsAmountL.
IMPORT_C void  SetTimeLimitL (TUint aDays)
  Set time limit in days for CheckRightsAmountL.
IMPORT_C void  SetPercentageLimitL (TUint aPercentage)
  Set percentage limit for CheckRightsAmountL.
IMPORT_C TInt  GetContentURIList (RPointerArray< HBufC8 > *&aURIList)
  GetContentURIList.
IMPORT_C TInt  DataTypesCount (TInt &aCount)
  DataTypesCount.
IMPORT_C TInt  SupportedDataType (const TInt aIndex, TDataType &aDataType)
  SupportedDataType.
IMPORT_C TInt  RegisterDataType (const TDataType &aDataType)
  RegisterDataType.
IMPORT_C TInt  UnRegisterDataType (const TInt aIndex)
  UnRegisterDataType.
IMPORT_C TInt  SupportedDRMMethods2 (TInt &aDRMMethod, TDRMHelperOMALevel &aOMALevel)
  SupportedDRMMethods.
IMPORT_C TInt  Consume2 (const TDesC8 &aContentURI, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction)
  Consume2.
IMPORT_C TInt  ConsumeFile2 (const TDesC &aFileName, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction)
  ConsumeFile2.
IMPORT_C TInt  ConsumeFile2 (RFile &aFileHandle, TUint32 aRightsSpec, TDRMHelperConsumeAction anAction)
  ConsumeFile2.
IMPORT_C void  ActivateContentL (CData &aContent)
  Acquires rights for given content if rights have been expired or rights are missing.
IMPORT_C void  ActivateContentL (TDesC &aFileName)
  Acquires rights for given content if rights have been expired or rights are missing.
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.
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.
IMPORT_C void  GetPreviewRightsL (CData &aContent)
  Acquires preview rights for given content.
IMPORT_C void  GetPreviewRightsL (TDesC &aFileName)
  Acquires preview rights for given content.
IMPORT_C TBool  EmbeddedPreviewCompletedL (CData &aContent)
  This method should be called after embedded preview has been played.
IMPORT_C TBool  EmbeddedPreviewCompletedL (TDesC &aFileName)
  This method should be called after embedded preview has been played.
IMPORT_C TBool  HasInfoUrlL (CData &aContent, HBufC8 *&aInfoUrl)
  Checks if given content has InfoUrl.
IMPORT_C TBool  HasInfoUrlL (TDesC &aFileName, HBufC8 *&aInfoUrl)
  Checks if given content has InfoUrl.
IMPORT_C void  OpenInfoUrlL (CData &aContent)
  Opens browser with InfoUrl of the content.
IMPORT_C void  OpenInfoUrlL (TDesC &aFileName)
  Opens browser with InfoUrl of the content.
IMPORT_C TInt  SetAutomatedType (TDRMHelperAutomatedType aAutomatedType)
  Sets the type of automated content to be registered.
IMPORT_C TInt  SetPreviewMediaType (TDRMHelperPreviewMediaType aMediaType)
  Sets media type of content for preview.

Static Public Member Functions

static IMPORT_C CDRMHelper NewL (CCoeEnv &aCoeEnv)
  Two-phased constructor.
static IMPORT_C CDRMHelper NewLC (CCoeEnv &aCoeEnv)
static IMPORT_C CDRMHelper NewL ()
  Two-phased constructor.
static IMPORT_C CDRMHelper NewLC ()
static IMPORT_C CDRMHelper NewL (CCoeEnv &aCoeEnv, RFs &aFs)
  Two-phased constructor.
static IMPORT_C CDRMHelper NewLC (CCoeEnv &aCoeEnv, RFs &aFs)
static IMPORT_C CDRMHelper NewL (RFs &aFs)
  Two-phased constructor.
static IMPORT_C CDRMHelper NewLC (RFs &aFs)

Member Enumeration Documentation

enum CDRMHelper::TDRMHelperAutomatedType
 
Enumerator:
EAutomatedTypeRingingTone 
EAutomatedTypeMessageAlert 
EAutomatedTypeEmailAlert 
EAutomatedTypeIMAlert 
EAutomatedTypeCalendarAlarm 
EAutomatedTypeScreenSaver 
EAutomatedTypeWallpaper 
EAutomatedTypeTheme 
EAutomatedTypeClockAlarm 
EAutomatedTypeOther 
enum CDRMHelper::TDRMHelperConsumeAction
 
Enumerator:
EStart 
EFinish 
EPause 
EContinue 
enum CDRMHelper::TDRMHelperDRMMethods
 
Enumerator:
EForwardLock 
ECombinedDelivery 
ESeparateDelivery 
ESuperDistribution 
enum CDRMHelper::TDRMHelperNotificationID
 
Enumerator:
ETActivateTextId 
ETCountBasedErrorTextId 
ETCountUsageReduceId 
ETCountUsageReduceMediaId 
enum CDRMHelper::TDRMHelperOMALevel
 
Enumerator:
EOMA_None 
EOMA_1_0 
EOMA_2_0 
enum CDRMHelper::TDRMHelperPreviewType
 
Enumerator:
ENoPreview 
EEmbeddedPreview 
EPreviewRights 

Constructor & Destructor Documentation

IMPORT_C CDRMHelper::~CDRMHelper  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CDRMHelper::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.

Parameters:
aFileName,:  Full path to file
IMPORT_C void CDRMHelper::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.

Parameters:
aContent,:  Content object
IMPORT_C TInt CDRMHelper::CanSetAutomated RFile &  aFileHandle,
TBool &  aValue
 

Checks if given content can be set as an automated content.

Parameters:
aFileHandle,:  file handle to the file
aValue,:  ETrue if content can be set as automated.
Returns:
System wide or DRM specific error code.
IMPORT_C TInt CDRMHelper::CanSetAutomated const TDesC &  aFilename,
TBool &  aValue
 

Checks if given content can be set as an automated content.

Parameters:
aFileName,:  Full path to file
aValue,:  ETrue if content can be set as automated.
Returns:
System wide or DRM specific error code.
IMPORT_C TInt CDRMHelper::CanSetAutomated const TDesC8 &  aURI,
TBool &  aValue
 

Checks if given content can be set as an automated content.

Parameters:
aURI,:  content URI
aValue,:  ETrue if content can be set as automated.
Returns:
System wide or DRM specific error code.
IMPORT_C TInt CDRMHelper::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.

Parameters:
aUri,:  Content URI
aCount,:  Threshold value for count limit
aDays,:  Threshold value for time limit in days
Returns:
Button code
IMPORT_C TInt CDRMHelper::CheckRightsAmountL RFile &  aFileHandle,
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.

Parameters:
aFileHandle,:  file handle to the file
aCount,:  Threshold value for count limit
aDays,:  Threshold value for time limit in days
Returns:
Button code
IMPORT_C TInt CDRMHelper::CheckRightsAmountL const TDesC &  aFileName,
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.

Parameters:
aFileName,:  Full path to file
aCount,:  Threshold value for count limit
aDays,:  Threshold value for time limit in days
Returns:
Button code
IMPORT_C TInt CDRMHelper::CheckRightsPercentL RFile &  aFileHandle,
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.

Parameters:
aFileHandle,:  file handle to the file
aThreshold,:  Threshold value in percents for displaying the note
Returns:
Button code
IMPORT_C TInt CDRMHelper::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.

Parameters:
aFileName,:  Full path to file
aThreshold,:  Threshold value in percents for displaying the note
Returns:
Button code
IMPORT_C TInt CDRMHelper::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.

Parameters:
aContentURI,:  URI of the content which will be consumed
aRightsSpec,:  the consumption intent (EPlay, EDisplay, EPrint, EExecute or EInstall)
anAction,:  the consumption action, telling whether the content consumption starts or finishes.
Returns:
EOk if consume action was successfully signalled to the engine.
IMPORT_C TInt CDRMHelper::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.

Parameters:
aFileHandle,:  file handle to the file
aRightsSpec,:  the consumption intent (EPlay, EDisplay, EPrint, EExecute or EInstall)
anAction,:  the consumption action, telling whether the content consumption starts or finishes.
Returns:
EOk if consume action was successfully signalled to the engine.
IMPORT_C TInt CDRMHelper::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.

Parameters:
@param  aRightsSpec: the consumption intent (EPlay, EDisplay, EPrint, EExecute or EInstall)
anAction,:  the consumption action, telling whether the content consumption starts or finishes.
Returns:
EOk if consume action was successfully signalled to the engine.
IMPORT_C TInt CDRMHelper::DataTypesCount TInt &  aCount  ) 
 

DataTypesCount.

Returns the number of previously registered datatypes which are supported by the DRM system and associated applications.

Parameters:
aCount,:  Out parameter for the datatype count
Returns:
EOk if the number of datatypes has been returned correctly
IMPORT_C TBool CDRMHelper::EmbeddedPreviewCompletedL TDesC &  aFileName  ) 
 

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.

Parameters:
aFileName,:  Full path to file.
Returns:
ETrue if user selects to buy rights.
IMPORT_C TBool CDRMHelper::EmbeddedPreviewCompletedL CData &  aContent  ) 
 

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.

Parameters:
aContent,:  Content object.
Returns:
ETrue if user selects to buy rights.
IMPORT_C TInt CDRMHelper::GetContentURIList RPointerArray< HBufC8 > *&  aURIList  ) 
 

GetContentURIList.

Returns a list of all content URIs that have rights in the rights database.

Parameters:
aURIList,:  Out parameter for the URI list.
Returns:
Ok if the URI list could be retreived.
IMPORT_C void CDRMHelper::GetPreviewRightsL TDesC &  aFileName  ) 
 

Acquires preview rights for given content.

Leaves with system-wide error code in case of error.

Parameters:
aFileName,:  Full path to file.
IMPORT_C void CDRMHelper::GetPreviewRightsL CData &  aContent  ) 
 

Acquires preview rights for given content.

Leaves with system-wide error code in case of error.

Parameters:
aContent,:  Content object
IMPORT_C void CDRMHelper::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.

Parameters:
[in]  aFileHandle  file handle to the file
[in]  aIntent  ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute
[out]  aExpired  ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future
[out]  aSendingAllowed  ETrue if content can be sent
[out]  aPlay  play constraints, must be deleted by caller
[out]  aDisplay  display constraints, must be deleted by caller
[out]  aExecute  execute constraints, must be deleted by caller
[out]  aPrint  print constraints, must be deleted by caller
Leave:
KErrArgument file is not DRM-protected.
Leave:
KErrCANoRights no rights
See also:
caferr.h

caftypes.h

IMPORT_C void CDRMHelper::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.

Parameters:
[in]  aFileName  Full path to file
[in]  aIntent  ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute
[out]  aExpired  ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future
[out]  aSendingAllowed  ETrue if content can be sent
[out]  aPlay  play constraints, must be deleted by caller
[out]  aDisplay  display constraints, must be deleted by caller
[out]  aExecute  execute constraints, must be deleted by caller
[out]  aPrint  print constraints, must be deleted by caller
Leave:
KErrArgument file is not DRM-protected.
Leave:
KErrCANoRights no rights
See also:
caferr.h

caftypes.h

IMPORT_C void CDRMHelper::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.

Parameters:
[in]  aFileHandle  file handle to the file
[in]  aIntent  ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute
[out]  aExpired  ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future
[out]  aSendingAllowed  ETrue if content can be sent
[out]  aPlay  play constraints, must be deleted by caller
[out]  aDisplay  display constraints, must be deleted by caller
[out]  aExecute  execute constraints, must be deleted by caller
[out]  aPrint  print constraints, must be deleted by caller
Leave:
KErrArgument file is not DRM-protected.
Leave:
KErrCANoRights no rights
See also:
caferr.h

caftypes.h

IMPORT_C void CDRMHelper::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.

Parameters:
[in]  aFileName  Full path to file
[in]  aIntent  ContentAccess::EPlay, ContentAccess::EView, ContentAccess::EPrint or ContentAccess::EExecute
[out]  aExpired  ETrue if rights are not valid. If this is ETrue and some constraints are returned, rights will become valid in future
[out]  aSendingAllowed  ETrue if content can be sent
[out]  aPlay  play constraints, must be deleted by caller
[out]  aDisplay  display constraints, must be deleted by caller
[out]  aExecute  execute constraints, must be deleted by caller
[out]  aPrint  print constraints, must be deleted by caller
Leave:
KErrArgument file is not DRM-protected.
Leave:
KErrCANoRights no rights
See also:
caferr.h

caftypes.h

IMPORT_C TInt CDRMHelper::HandleErrorL TInt  aError,
RFile &  aFileHandle
 

Displays: Handles error situations 'rights expired', 'no rights' and 'rights database corrupted'.

Parameters:
aError,:  error code returned by DRM engine
aFileHandle,:  file handle to the file
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
IMPORT_C TInt CDRMHelper::HandleErrorL TInt  aError,
const TDesC &  aFileName
 

Displays: Handles error situations 'rights expired', 'no rights' and 'rights database corrupted'.

Parameters:
aError,:  error code returned by DRM engine
aFileName,:  full path to file
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
IMPORT_C TInt CDRMHelper::HandleErrorL TInt  aError,
const TDesC8 &  aURI
 

Displays appropriate error note depending on error code.

Parameters:
aError,:  error code returned by DRM engine
aURI,:  URI of the file
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
IMPORT_C TInt CDRMHelper::HandleErrorOrPreviewL TInt  aError,
const TDesC &  aFileName,
HBufC8 *&  aEmbeddedPreviewUri
 

Handles DRM specific error situations.

Should be called instead of HandleErrorL if user should be asked to play embedded preview or get preview/silent rights if there is no valid rights and either embedded preview or preview rights are available.

Parameters:
aError,:  error code to be handled.
aFileName,:  name of file for which error was received.
aEmbeddedPreviewUri,:  contain URI of embedded preview part upon return if caller should play the embedded preview. If embedded preview should not be played this is NULL. Must be freed by caller.
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 CDRMHelper::HandleErrorOrPreviewL TInt  aError,
RFile &  aFile,
HBufC8 *&  aEmbeddedPreviewUri
 

Handles DRM-specific error situations.

Should be called instead of HandleErrorL if user should be asked to play embedded preview or get preview/silent rights if there is no valid rights and either embedded preview or preview rights are available.

Parameters:
aError,:  error code to be handled.
aFile,:  handle of file for which error was received.
aEmbeddedPreviewUri,:  contain URI of embedded preview part upon return if caller should play the embedded preview. If embedded preview should not be played this is NULL. Must be freed by caller.
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 TBool CDRMHelper::HasInfoUrlL TDesC &  aFileName,
HBufC8 *&  aInfoUrl
 

Checks if given content has InfoUrl.

Leaves with system-wide error code in case of error.

Parameters:
aFileName,:  Full path to file.
aInfoUrl,:  Out: InfoUrl. Must be freed by caller.
Returns:
ETrue if content has InfoUrl.
IMPORT_C TBool CDRMHelper::HasInfoUrlL CData &  aContent,
HBufC8 *&  aInfoUrl
 

Checks if given content has InfoUrl.

Leaves with system-wide error code in case of error.

Parameters:
aContent,:  Content object.
aInfoUrl,:  Out: InfoUrl. Must be freed by caller.
Returns:
ETrue if content has InfoUrl.
IMPORT_C TDRMHelperPreviewType CDRMHelper::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.

Parameters:
aFileName,:  Full path to file.
aPreviewUri,:  Out: URI of the embedded preview or PreviewRights URL. Must be freed by caller
Returns:
preview type
IMPORT_C TDRMHelperPreviewType CDRMHelper::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.

Parameters:
aContent,:  Content object
aPreviewUri,:  Out: URI of the embedded preview or PreviewRights URL. Must be freed by caller
Returns:
preview type
IMPORT_C void CDRMHelper::IndicateIdle  ) 
 

Informs DRMHelper that idle-screen has been activated.

Returns:
-
IMPORT_C void CDRMHelper::LaunchDetailsViewEmbeddedL const HBufC8 *  aContentURI  ) 
 

Launches DRM Rights Manager UI embedded with details view related to given content.

Parameters:
aContentURI,:  URI of the content
Returns:
-
IMPORT_C void CDRMHelper::LaunchDetailsViewEmbeddedL RFile &  aFileHandle  ) 
 

Launches DRM Rights Manager UI embedded with details view related to given file.

Parameters:
aFileHandle,:  file handle to the file
Returns:
-
IMPORT_C void CDRMHelper::LaunchDetailsViewEmbeddedL const TDesC &  aFileName  ) 
 

Launches DRM Rights Manager UI embedded with details view related to given file.

Parameters:
aFileName,:  Full path to file
Returns:
-
IMPORT_C void CDRMHelper::LaunchDetailsViewEmbeddedL const TDesC8 &  aURI  ) 
 

Launches DRM Rights Manager UI embedded with details view related to given content.

Parameters:
aURI,:  URI of the file
Returns:
-
static IMPORT_C CDRMHelper* CDRMHelper::NewL RFs &  aFs  )  [static]
 

Two-phased constructor.

static IMPORT_C CDRMHelper* CDRMHelper::NewL CCoeEnv &  aCoeEnv,
RFs &  aFs
[static]
 

Two-phased constructor.

static IMPORT_C CDRMHelper* CDRMHelper::NewL  )  [static]
 

Two-phased constructor.

static IMPORT_C CDRMHelper* CDRMHelper::NewL CCoeEnv &  aCoeEnv  )  [static]
 

Two-phased constructor.

static IMPORT_C CDRMHelper* CDRMHelper::NewLC RFs &  aFs  )  [static]
 
static IMPORT_C CDRMHelper* CDRMHelper::NewLC CCoeEnv &  aCoeEnv,
RFs &  aFs
[static]
 
static IMPORT_C CDRMHelper* CDRMHelper::NewLC  )  [static]
 
static IMPORT_C CDRMHelper* CDRMHelper::NewLC CCoeEnv &  aCoeEnv  )  [static]
 
IMPORT_C void CDRMHelper::OpenInfoUrlL TDesC &  aFileName  ) 
 

Opens browser with InfoUrl of the content.

Leaves with system-wide error code in case of error.

Parameters:
aFileName,:  Full path to file.
IMPORT_C void CDRMHelper::OpenInfoUrlL CData &  aContent  ) 
 

Opens browser with InfoUrl of the content.

Leaves with system-wide error code in case of error.

Parameters:
aContent,:  Content object.
IMPORT_C TInt CDRMHelper::RegisterDataType const TDataType &  aDataType  ) 
 

RegisterDataType.

Registers a datatype as a supported datatype.

Parameters:
aDataType,:  Datatype to register
Returns:
EOk if the datatype has been registered
IMPORT_C TInt CDRMHelper::RemoveAutomated RFile &  aFileHandle  ) 
 

Unregisters given content to be used as an automated content.

Parameters:
aFileHandle,:  file handle to the file
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::RemoveAutomated const TDesC &  aFilename  ) 
 

Unregisters given content to be used as an automated content.

Parameters:
aFileName,:  Full path to file
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::RemoveAutomated const TDesC8 &  aURI  ) 
 

Unregisters given content to be used as an automated content.

Parameters:
aURI,:  content URI
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::RemoveAutomatedPassive RFile &  aFileHandle  ) 
 

Unregisters given content to be used as an automated content.

This function must be used when content was registered using SetAutomatedPassive.

Parameters:
aFileHandle,:  file handle to the file
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::RemoveAutomatedPassive const TDesC &  aFilename  ) 
 

Unregisters given content to be used as an automated content.

This function must be used when content was registered using SetAutomatedPassive.

Parameters:
aFileName,:  Full path to file
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::RemoveAutomatedPassive const TDesC8 &  aURI  ) 
 

Unregisters given content to be used as an automated content.

This function must be used when content was registered using SetAutomatedPassive.

Parameters:
aURI,:  content URI
Returns:
System wide error code.
IMPORT_C TInt CDRMHelper::SetAutomated RFile &  aFileHandle  ) 
 

Registers given content to be used as an automated content.

This function is used when registering application listens expiry

Parameters:
aFileHandle,:  file handle to the file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomated const TDesC &  aFilename  ) 
 

Registers given content to be used as an automated content.

This function is used when registering application listens expiry notifications itself.

Parameters:
aFileName,:  Full path to file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomated const TDesC8 &  aURI  ) 
 

Registers given content to be used as an automated content.

This function is used when registering application listens expiry notifications itself

Parameters:
aURI,:  content URI
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedPassive RFile &  aFileHandle  ) 
 

Registers given content to be used as an automated content.

This function is used when phone application listens to expiry notifications.

Parameters:
aFileHandle,:  file handle to the file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedPassive const TDesC &  aFilename  ) 
 

Registers given content to be used as an automated content.

This function is used when phone application listens to expiry notifications.

Parameters:
aFileName,:  Full path to file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedPassive const TDesC8 &  aURI  ) 
 

Registers given content to be used as an automated content.

This function is used when phone application listens to expiry notifications.

Parameters:
aURI,:  content URI
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedSilent RFile &  aFileHandle,
TBool  aActive
 

Registers given content to be used as an automated content without confirmation query.

Parameters:
aFileHandle,:  file handle to the file
aActive,:  ETrue if registering application itself listens expiry notifications
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedSilent const TDesC &  aFilename,
TBool  aActive
 

Registers given content to be used as an automated content without confirmation query.

Parameters:
aFileName,:  Full path to file
aActive,:  ETrue if registering application itself listens expiry notifications
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedSilent const TDesC8 &  aURI,
TBool  aActive
 

Registers given content to be used as an automated content without confirmation query.

Parameters:
aURI,:  content URI
aActive,:  ETrue if registering application itself listens expiry notifications
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::SetAutomatedType TDRMHelperAutomatedType  aAutomatedType  ) 
 

Sets the type of automated content to be registered.

This method should be called before calling any of SetAutomated* methods.

Parameters:
aAutomatedType,:  type of automated content
Returns:
System wide error code
IMPORT_C void CDRMHelper::SetCountLimitL TUint  aCounts  ) 
 

Set count limit for CheckRightsAmountL.

Parameters:
aCounts,:  new count limit for displaying the note.
Returns:
-
IMPORT_C void CDRMHelper::SetPercentageLimitL TUint  aPercentage  ) 
 

Set percentage limit for CheckRightsAmountL.

Applies to both counts and time.

Parameters:
aPercentage,:  new limit for displaying the note.
Returns:
-
IMPORT_C TInt CDRMHelper::SetPreviewMediaType TDRMHelperPreviewMediaType  aMediaType  ) 
 

Sets media type of content for preview.

Should be called prior to calling HandleErrorOrPreviewL or EmbeddedPreviewCompletedL.

Parameters:
aMediaType,:  media type of content.
Returns:
System wide error code
IMPORT_C void CDRMHelper::SetTimeLimitL TUint  aDays  ) 
 

Set time limit in days for CheckRightsAmountL.

Parameters:
aDays,:  new time limit for displaying the note.
Returns:
-
IMPORT_C TInt CDRMHelper::ShowAutomatedNote RFile &  aFileHandle  ) 
 

Displays the confirmation query about setting given content as an automated content.

Note that this function does not actually register content, just displays the note

Parameters:
aFileHandle,:  file handle to the file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::ShowAutomatedNote const TDesC &  aFilename  ) 
 

Displays the confirmation query about setting given content as an automated content.

Note that this function does not actually register content, just displays the note

Parameters:
aFileName,:  Full path to file
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::ShowAutomatedNote const TDesC8 &  aURI  ) 
 

Displays the confirmation query about setting given content as an automated content.

Note that this function does not actually register content, just displays the note

Parameters:
aURI,:  content URI
Returns:
System wide error code (KErrCancel if user pressed no to query).
IMPORT_C TInt CDRMHelper::ShowDRMUINotification2L TDRMHelperNotificationID  aTextId,
const TDesC &  aFileName
 

Handle the general UI based error notes.

Parameters:
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 CDRMHelper::ShowDRMUINotification2L TDRMHelperNotificationID  aTextId,
const TDesC8 &  aURI
 

Handle the general UI based error notes.

Parameters:
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 CDRMHelper::SupportedDataType const TInt  aIndex,
TDataType &  aDataType
 

SupportedDataType.

Returns a specific datatype which has been registered before by giving an index

Parameters:
aIndex,:  Number of the datatype to return
aDataType,:  Out parameter for the datatype
Returns:
EOk if the datatype was returned correctly
IMPORT_C TInt CDRMHelper::SupportedDRMMethods2 TInt &  aDRMMethod,
TDRMHelperOMALevel aOMALevel
 

SupportedDRMMethods.

Returns the supported DRM protection methods and the OMA compliance level of the DRM engine

Parameters:
aDRMMethod,:  Out parameter, bit mask containing any combination of EForwardLock, ECombinedDelivery, ESeparateDelivery etc.
aOMALevel,:  OMA compliance of the DRM engine
Returns:
DRMCommon error code
IMPORT_C TInt CDRMHelper::UnRegisterDataType const TInt  aIndex  ) 
 

UnRegisterDataType.

Unregisters a datatype via its index.

Parameters:
aIndex,:  Number of the datatype to unregister
Returns:
EOk if the datatype has been unregistered

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top