DRMCommon Class Reference

class DRMCommon : public CBase

DRMCommon: provides common DRM functions.

DRMCommon.dll
Since
2.0

Inherits from

Public Member Functions
~DRMCommon(void)
IMPORT_C TIntCheckContentRights(const TDesC8 &, TUint32)
IMPORT_C TIntCheckFileRights(const TDesC &, TUint32)
IMPORT_C TIntCheckFileRights(RFile &, TUint32)
IMPORT_C TIntConnect(void)
IMPORT_C TIntDataTypesCount(TInt &)
IMPORT_C TIntDisconnect(void)
IMPORT_C TIntGetActiveRights(const TDesC8 &, TUint32, CDRMRights *&)
IMPORT_C TIntGetContentHeader(const TDesC8 &, const TDesC8 &, HBufC8 *&)
IMPORT_C TIntGetContentInfo(const TDesC8 &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TIntGetContentURIList(RPointerArray< HBufC8 > *&)
IMPORT_C TIntGetDetailedContentRights(const TDesC8 &, RPointerArray< CDRMRights > *&)
IMPORT_C TIntGetDetailedFileRights(const TDesC &, RPointerArray< CDRMRights > *&)
IMPORT_C TIntGetDetailedFileRights(RFile &, RPointerArray< CDRMRights > *&)
IMPORT_C TIntGetFileHeader(const TFileName &, const TDesC8 &, HBufC8 *&)
IMPORT_C TIntGetFileHeader(RFile &, const TDesC8 &, HBufC8 *&)
IMPORT_C TIntGetFileInfo(const TDesC &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TIntGetFileInfo(RFile &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TIntGetSingleRightsObject(const TDesC8 &, TUint32, CDRMRights *&)
IMPORT_C TIntIsProtectedContent(const TDesC8 &, TBool &)
IMPORT_C TIntIsProtectedFile(const TDesC &, TBool &)
IMPORT_C TIntIsProtectedFile(RFile &, TBool &)
IMPORT_C voidMergeParentAndChild(CDRMRights *)
IMPORT_C DRMCommon *NewL(void)
IMPORT_C TIntRegisterDataType(const TDataType &)
IMPORT_C TVersionServerVersion(void)
IMPORT_C TIntSetContentHeader(HBufC8 *&, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntSetFileHeader(const TDesC16 &, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntSetFileHeader(RFile &, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntStaticDataTypesCount(TInt &)
IMPORT_C TIntSupportedDRMMethods(TInt &, TOMALevel &)
IMPORT_C TIntSupportedDataType(const TInt, TDataType &)
IMPORT_C TIntUnRegisterDataType(const TInt)
IMPORT_C TVersionVersion(void)
Protected Member Functions
DRMCommon(void)
IMPORT_C voidConstructL(void)
IMPORT_C TIntMapErrorCode(const TInt)
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()
Public Member Enumerations
enumanonymous { EPlay = ContentAccess::EPlay, EDisplay = ContentAccess::EView, EExecute = ContentAccess::EExecute, EPrint = ContentAccess::EPrint, EInstall = ContentAccess::EInstall }
enumanonymous {
EOk = KErrNone, EGeneralError = -30100, EUnknownMIME = -30101, EVersionNotSupported = -30102, ESessionError = -30103, ENoRights = KErrCANoRights, ERightsDBCorrupted = -30105, EUnsupported = KErrCANotSupported, ERightsExpired = KErrCANoPermission, EInvalidRights = -30108, EPaddingFailed = -30109, EFileError = -30110
}
enumanonymous { EForwardLock = 0x0001, ECombinedDelivery = 0x0002, ESeparateDelivery = 0x0004, ESuperDistribution = 0x0008 }
enumTConsumeAction { EStart, EFinish }
enumTContentProtection { ENoDCFFile, EForwardLocked, ESuperDistributable }
enumTOMALevel { EOMA_None, EOMA_1_0, EOMA_2_0 }

Constructor & Destructor Documentation

DRMCommon(void)

IMPORT_CDRMCommon(void)[protected]

C++ default constructor.

Parameters

void

~DRMCommon(void)

IMPORT_C~DRMCommon(void)[virtual]

Destructor.

Parameters

void

Member Functions Documentation

CheckContentRights(const TDesC8 &, TUint32)

IMPORT_C TIntCheckContentRights(const TDesC8 &aContentURI,
TUint32aRightsSpec
)

CheckContentRights

Takes a Content URI and a rights specification. Checks if the specified rights can be exercised with this content by looking up the content URI in the rights database and checking the stored rights.

Since
2.0

Parameters

const TDesC8 & aContentURI
TUint32 aRightsSpec

CheckFileRights(const TDesC &, TUint32)

IMPORT_C TIntCheckFileRights(const TDesC &aFileName,
TUint32aRightsSpec
)

CheckFileRights

Takes a file name and a rights specification. Opens the given file and checks if the specified rights can be exercised with this file by extracting the content URI from the file, looking up the content URI in the rights database and checking the stored rights.

Since
2.0

Parameters

const TDesC & aFileName
TUint32 aRightsSpec

CheckFileRights(RFile &, TUint32)

IMPORT_C TIntCheckFileRights(RFile &aFileHandle,
TUint32aRightsSpec
)

CheckFileRights

Takes a file name and a rights specification. Opens the given file and checks if the specified rights can be exercised with this file by extracting the content URI from the file, looking up the content URI in the rights database and checking the stored rights.

Since
3.0

Parameters

RFile & aFileHandle
TUint32 aRightsSpec

Connect(void)

IMPORT_C TIntConnect(void)

Connect

Connect to the DRM Engine.

Since
2.0

Parameters

void

ConstructL(void)

IMPORT_C voidConstructL(void)[protected]

2nd phase constructor.

Parameters

void

DataTypesCount(TInt &)

IMPORT_C TIntDataTypesCount(TInt &aCount)

DataTypesCount

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

Since
2.0

Parameters

TInt & aCount

Disconnect(void)

IMPORT_C TIntDisconnect(void)

Disconnect

Disconnect the current connection.

Since
2.0

Parameters

void

GetActiveRights(const TDesC8 &, TUint32, CDRMRights *&)

IMPORT_C TIntGetActiveRights(const TDesC8 &aContentURI,
TUint32aRightsSpec,
CDRMRights *&aRightsObject
)

GetActiveRights

Takes a Content URI and a rights specification. Finds all rights objects associated with given URI and returns a possible active one. The out parameters will contain a pointer to the found rights object. The found rights object can be expired. The details about expiration and constraints of the rights can be retrieved with the CDRMRights::GetRightsInfo function.

Since
2.5

Parameters

const TDesC8 & aContentURI
TUint32 aRightsSpec
CDRMRights *& aRightsObject

GetContentHeader(const TDesC8 &, const TDesC8 &, HBufC8 *&)

IMPORT_C TIntGetContentHeader(const TDesC8 &aContent,
const TDesC8 &aHeaderName,
HBufC8 *&aHeaderValue
)

GetContentHeader

Takes a memory buffer containing a DCF(or at least the header part of it) and a header name and returns the value of the header field in an out parameter. Return value specifies if the header has been found. Search is case insensitive.

Since
2.0

Parameters

const TDesC8 & aContent
const TDesC8 & aHeaderName
HBufC8 *& aHeaderValue

GetContentInfo(const TDesC8 &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)

IMPORT_C TIntGetContentInfo(const TDesC8 &aContent,
TContentProtection &aProtection,
HBufC8 *&aMIMEType,
HBufC8 *&aContentURI,
TUint &aDataLength
)

GetContentInfo

Takes a memory buffer containing a DCF(or at least the header part of it) and returns the protection for this content, the MIME type, Content URI and encrypted data length in out parameters.

Since
2.0

Parameters

const TDesC8 & aContent
TContentProtection & aProtection
HBufC8 *& aMIMEType
HBufC8 *& aContentURI
TUint & aDataLength

GetContentURIList(RPointerArray< HBufC8 > *&)

IMPORT_C TIntGetContentURIList(RPointerArray< HBufC8 > *&aURIList)

GetContentURIList

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

Since
2.5

Parameters

RPointerArray< HBufC8 > *& aURIList

GetDetailedContentRights(const TDesC8 &, RPointerArray< CDRMRights > *&)

IMPORT_C TIntGetDetailedContentRights(const TDesC8 &aContentURI,
RPointerArray< CDRMRights > *&aRightsList
)

GetDetailedContentRights

Takes a Content URI and an array out parameter. Fills the rights specification array with the available rights by looking up the content URI in the rights database and retrieving the stored rights. The array parameter will contain a list of pointers to all rights object for the given content URI. The rights objects themselves can be distinguished by their local ID.

Since
2.5

Parameters

const TDesC8 & aContentURI
RPointerArray< CDRMRights > *& aRightsList

GetDetailedFileRights(const TDesC &, RPointerArray< CDRMRights > *&)

IMPORT_C TIntGetDetailedFileRights(const TDesC &aFileName,
RPointerArray< CDRMRights > *&aRightsList
)

GetDetailedFileRights

Takes a file name and a rights specification. Opens the given file and fills the rights specification array with the available rights by looking up the content URI in the rights database and retrieving the stored rights. The array parameter will contain a list of pointers to all rights object for the given content URI. The rights objects themselves can be distinguished by their local ID.

Since
2.5

Parameters

const TDesC & aFileName
RPointerArray< CDRMRights > *& aRightsList

GetDetailedFileRights(RFile &, RPointerArray< CDRMRights > *&)

IMPORT_C TIntGetDetailedFileRights(RFile &aFileHandle,
RPointerArray< CDRMRights > *&aRightsList
)

GetDetailedFileRights

Takes a file name and a rights specification. Opens the given file and fills the rights specification array with the available rights by looking up the content URI in the rights database and retrieving the stored rights. The array parameter will contain a list of pointers to all rights object for the given content URI. The rights objects themselves can be distinguished by their local ID.

Since
3.0

Parameters

RFile & aFileHandle
RPointerArray< CDRMRights > *& aRightsList

GetFileHeader(const TFileName &, const TDesC8 &, HBufC8 *&)

IMPORT_C TIntGetFileHeader(const TFileName &aFileName,
const TDesC8 &aHeaderName,
HBufC8 *&aHeaderValue
)

GetFileHeader

Takes the name of a DCF file and a header name, opens the DCF file and returns the value of the header field in an out parameter. Return value specifies if the header has been found. Search is case insensitive.

Since
2.0

Parameters

const TFileName & aFileName
const TDesC8 & aHeaderName
HBufC8 *& aHeaderValue

GetFileHeader(RFile &, const TDesC8 &, HBufC8 *&)

IMPORT_C TIntGetFileHeader(RFile &aFileHandle,
const TDesC8 &aHeaderName,
HBufC8 *&aHeaderValue
)

GetFileHeader

Takes the name of a DCF file and a header name, opens the DCF file and returns the value of the header field in an out parameter. Return value specifies if the header has been found. Search is case insensitive.

Since
3.0

Parameters

RFile & aFileHandle
const TDesC8 & aHeaderName
HBufC8 *& aHeaderValue

GetFileInfo(const TDesC &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)

IMPORT_C TIntGetFileInfo(const TDesC &aFileName,
TContentProtection &aProtection,
HBufC8 *&aMIMEType,
HBufC8 *&aContentURI,
TUint &aDataLength
)

GetFileInfo

Takes the name of a DCF file, opens it and returns the protection for this content, the MIME type, Content URI and encrypted data length in out parameters.

Since
2.0

Parameters

const TDesC & aFileName
TContentProtection & aProtection
HBufC8 *& aMIMEType
HBufC8 *& aContentURI
TUint & aDataLength

GetFileInfo(RFile &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)

IMPORT_C TIntGetFileInfo(RFile &aFileHandle,
TContentProtection &aProtection,
HBufC8 *&aMIMEType,
HBufC8 *&aContentURI,
TUint &aDataLength
)

GetFileInfo

Takes the name of a DCF file, opens it and returns the protection for this content, the MIME type, Content URI and encrypted data length in out parameters.

Since
3.0

Parameters

RFile & aFileHandle
TContentProtection & aProtection
HBufC8 *& aMIMEType
HBufC8 *& aContentURI
TUint & aDataLength

GetSingleRightsObject(const TDesC8 &, TUint32, CDRMRights *&)

IMPORT_C TIntGetSingleRightsObject(const TDesC8 &aContentURI,
TUint32aLocalID,
CDRMRights *&aRightsObject
)

GetSingleRightsObject

Takes a content URI, a local ID and a rights object out parameter. Looks up the rights object using the content URI and the local ID and returns it in the out parameter.

Since
2.5

Parameters

const TDesC8 & aContentURI
TUint32 aLocalID
CDRMRights *& aRightsObject

IsProtectedContent(const TDesC8 &, TBool &)

IMPORT_C TIntIsProtectedContent(const TDesC8 &aContent,
TBool &aProtection
)

IsProtectedContent

Takes a memory buffer containing a file and checks if it is a DCF file or a regular file.

Since
2.0

Parameters

const TDesC8 & aContent
TBool & aProtection

IsProtectedFile(const TDesC &, TBool &)

IMPORT_C TIntIsProtectedFile(const TDesC &aFileName,
TBool &aProtection
)

IsProtectedFile

Takes a file name and checks if it is a DCF file or a regular file.

Since
2.0

Parameters

const TDesC & aFileName
TBool & aProtection

IsProtectedFile(RFile &, TBool &)

IMPORT_C TIntIsProtectedFile(RFile &aFileHandle,
TBool &aProtection
)

IsProtectedFile

Takes a file name and checks if it is a DCF file or a regular file.

Since
3.0

Parameters

RFile & aFileHandle
TBool & aProtection

MapErrorCode(const TInt)

IMPORT_C TIntMapErrorCode(const TIntaCode)[protected]

MapErrorCode

Maps the error codes returned by the core engine to DRMCommon error codes.

Since
2.5

Parameters

const TInt aCode

MergeParentAndChild(CDRMRights *)

IMPORT_C voidMergeParentAndChild(CDRMRights *aRights)

MergeParentAndChild

Merge rights with their parent rights

Since
3.0

Parameters

CDRMRights * aRightsRights to be merged with their parent rights

NewL(void)

IMPORT_C DRMCommon *NewL(void)[static]

Two-phased constructor.

Parameters

void

RegisterDataType(const TDataType &)

IMPORT_C TIntRegisterDataType(const TDataType &aDataType)

RegisterDataType

Registers a datatype as a supported datatype.

Since
2.0

Parameters

const TDataType & aDataType

ServerVersion(void)

IMPORT_C TVersionServerVersion(void)[static]

ServerVersion

Returns the version of the DRM Engine.

Since
2.0

Parameters

void

SetContentHeader(HBufC8 *&, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntSetContentHeader(HBufC8 *&aContent,
const TDesC8 &aHeaderName,
const TDesC8 &aHeaderValue
)

SetContentHeader

Takes a memory buffer containing a DCF(or at least the header part of it), a header name and the value for the header field. Sets the header field in the optional DCF header. If the header field has not existed before, it is created. Any previous value of the header field will be overwritten.

Since
2.0

Parameters

HBufC8 *& aContent
const TDesC8 & aHeaderName
const TDesC8 & aHeaderValue

SetFileHeader(const TDesC16 &, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntSetFileHeader(const TDesC16 &aFileName,
const TDesC8 &aHeaderName,
const TDesC8 &aHeaderValue
)

SetFileHeader

Takes the name of a DCF file, a header name and the value for the header field. Opens the DCF file, sets the header field in the optional DCF header and writes the DCF file. If the header field has not existed before, it is created. Any previous value of the header field will be overwritten.

Since
2.0

Parameters

const TDesC16 & aFileName
const TDesC8 & aHeaderName
const TDesC8 & aHeaderValue

SetFileHeader(RFile &, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntSetFileHeader(RFile &aFileHandle,
const TDesC8 &aHeaderName,
const TDesC8 &aHeaderValue
)

SetFileHeader

Takes the name of a DCF file, a header name and the value for the header field. Opens the DCF file, sets the header field in the optional DCF header and writes the DCF file. If the header field has not existed before, it is created. Any previous value of the header field will be overwritten.

Since
3.0

Parameters

RFile & aFileHandle
const TDesC8 & aHeaderName
const TDesC8 & aHeaderValue

StaticDataTypesCount(TInt &)

IMPORT_C TIntStaticDataTypesCount(TInt &aCount)

StaticDataTypesCount

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

Since
2.0

Parameters

TInt & aCount

SupportedDRMMethods(TInt &, TOMALevel &)

IMPORT_C TIntSupportedDRMMethods(TInt &aDRMMethod,
TOMALevel &aOMALevel
)

SupportedDRMMethods

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

Since
2.0

Parameters

TInt & aDRMMethod
TOMALevel & aOMALevel

SupportedDataType(const TInt, TDataType &)

IMPORT_C TIntSupportedDataType(const TIntaIndex,
TDataType &aDataType
)

SupportedDataType

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

Since
2.0

Parameters

const TInt aIndex
TDataType & aDataType

UnRegisterDataType(const TInt)

IMPORT_C TIntUnRegisterDataType(const TIntaIndex)

UnRegisterDataType

Unregisters a datatype via its index.

Since
2.5

Parameters

const TInt aIndex

Version(void)

IMPORT_C TVersionVersion(void)[static]

Version

Returns the version of this API.

Since
2.0

Parameters

void

Member Enumerations Documentation

Enum anonymous

Enumerators

EPlay = ContentAccess::EPlay
EDisplay = ContentAccess::EView
EExecute = ContentAccess::EExecute
EPrint = ContentAccess::EPrint
EInstall = ContentAccess::EInstall

Enum anonymous

Enumerators

EOk = KErrNone
EGeneralError = -30100
EUnknownMIME = -30101
EVersionNotSupported = -30102
ESessionError = -30103
ENoRights = KErrCANoRights
ERightsDBCorrupted = -30105
EUnsupported = KErrCANotSupported
ERightsExpired = KErrCANoPermission
EInvalidRights = -30108
EPaddingFailed = -30109
EFileError = -30110

Enum anonymous

Enumerators

EForwardLock = 0x0001
ECombinedDelivery = 0x0002
ESeparateDelivery = 0x0004
ESuperDistribution = 0x0008

Enum TConsumeAction

Enumerators

EStart
EFinish

Enum TContentProtection

Enumerators

ENoDCFFile
EForwardLocked
ESuperDistributable

Enum TOMALevel

Enumerators

EOMA_None
EOMA_1_0
EOMA_2_0