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 TInt CheckContentRights (const TDesC8 &, TUint32 )
IMPORT_C TInt CheckFileRights (const TDesC &, TUint32 )
IMPORT_C TInt CheckFileRights ( RFile &, TUint32 )
IMPORT_C TInt Connect (void)
IMPORT_C TInt DataTypesCount ( TInt &)
IMPORT_C TInt Disconnect (void)
IMPORT_C TInt GetActiveRights (const TDesC8 &, TUint32 , CDRMRights *&)
IMPORT_C TInt GetContentHeader (const TDesC8 &, const TDesC8 &, HBufC8 *&)
IMPORT_C TInt GetContentInfo (const TDesC8 &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TInt GetContentURIList ( RPointerArray < HBufC8 > *&)
IMPORT_C TInt GetDetailedContentRights (const TDesC8 &, RPointerArray < CDRMRights > *&)
IMPORT_C TInt GetDetailedFileRights (const TDesC &, RPointerArray < CDRMRights > *&)
IMPORT_C TInt GetDetailedFileRights ( RFile &, RPointerArray < CDRMRights > *&)
IMPORT_C TInt GetFileHeader (const TFileName &, const TDesC8 &, HBufC8 *&)
IMPORT_C TInt GetFileHeader ( RFile &, const TDesC8 &, HBufC8 *&)
IMPORT_C TInt GetFileInfo (const TDesC &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TInt GetFileInfo ( RFile &, TContentProtection &, HBufC8 *&, HBufC8 *&, TUint &)
IMPORT_C TInt GetSingleRightsObject (const TDesC8 &, TUint32 , CDRMRights *&)
IMPORT_C TInt IsProtectedContent (const TDesC8 &, TBool &)
IMPORT_C TInt IsProtectedFile (const TDesC &, TBool &)
IMPORT_C TInt IsProtectedFile ( RFile &, TBool &)
IMPORT_C void MergeParentAndChild ( CDRMRights *)
IMPORT_C DRMCommon * NewL (void)
IMPORT_C TInt RegisterDataType (const TDataType &)
IMPORT_C TVersion ServerVersion (void)
IMPORT_C TInt SetContentHeader ( HBufC8 *&, const TDesC8 &, const TDesC8 &)
IMPORT_C TInt SetFileHeader (const TDesC16 &, const TDesC8 &, const TDesC8 &)
IMPORT_C TInt SetFileHeader ( RFile &, const TDesC8 &, const TDesC8 &)
IMPORT_C TInt StaticDataTypesCount ( TInt &)
IMPORT_C TInt SupportedDRMMethods ( TInt &, TOMALevel &)
IMPORT_C TInt SupportedDataType (const TInt , TDataType &)
IMPORT_C TInt UnRegisterDataType (const TInt )
IMPORT_C TVersion Version (void)
Protected Member Functions
DRMCommon (void)
IMPORT_C void ConstructL (void)
IMPORT_C TInt MapErrorCode (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
enum anonymous { EPlay  = ContentAccess::EPlay, EDisplay  = ContentAccess::EView, EExecute  = ContentAccess::EExecute, EPrint  = ContentAccess::EPrint, EInstall  = ContentAccess::EInstall }
enum anonymous {
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 { EForwardLock  = 0x0001, ECombinedDelivery  = 0x0002, ESeparateDelivery  = 0x0004, ESuperDistribution  = 0x0008 }
enum TConsumeAction { EStart , EFinish }
enum TContentProtection { ENoDCFFile , EForwardLocked , ESuperDistributable }
enum TOMALevel { EOMA_None , EOMA_1_0 , EOMA_2_0 }

Constructor & Destructor Documentation

DRMCommon(void)

IMPORT_C DRMCommon ( 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 TInt CheckContentRights ( const TDesC8 & aContentURI,
TUint32 aRightsSpec
)

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 TInt CheckFileRights ( const TDesC & aFileName,
TUint32 aRightsSpec
)

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 TInt CheckFileRights ( RFile & aFileHandle,
TUint32 aRightsSpec
)

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 TInt Connect ( void )

Connect

Connect to the DRM Engine.

Since
2.0

Parameters

void

ConstructL(void)

IMPORT_C void ConstructL ( void ) [protected]

2nd phase constructor.

Parameters

void

DataTypesCount(TInt &)

IMPORT_C TInt DataTypesCount ( 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 TInt Disconnect ( void )

Disconnect

Disconnect the current connection.

Since
2.0

Parameters

void

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

IMPORT_C TInt GetActiveRights ( const TDesC8 & aContentURI,
TUint32 aRightsSpec,
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 TInt GetContentHeader ( 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 TInt GetContentInfo ( 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 TInt GetContentURIList ( 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 TInt GetDetailedContentRights ( 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 TInt GetDetailedFileRights ( 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 TInt GetDetailedFileRights ( 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 TInt GetFileHeader ( 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 TInt GetFileHeader ( 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 TInt GetFileInfo ( 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 TInt GetFileInfo ( 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 TInt GetSingleRightsObject ( const TDesC8 & aContentURI,
TUint32 aLocalID,
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 TInt IsProtectedContent ( 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 TInt IsProtectedFile ( 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 TInt IsProtectedFile ( 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 TInt MapErrorCode ( const TInt aCode ) [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 void MergeParentAndChild ( CDRMRights * aRights )

MergeParentAndChild

Merge rights with their parent rights

Since
3.0

Parameters

CDRMRights * aRights Rights 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 TInt RegisterDataType ( const TDataType & aDataType )

RegisterDataType

Registers a datatype as a supported datatype.

Since
2.0

Parameters

const TDataType & aDataType

ServerVersion(void)

IMPORT_C TVersion ServerVersion ( void ) [static]

ServerVersion

Returns the version of the DRM Engine.

Since
2.0

Parameters

void

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

IMPORT_C TInt SetContentHeader ( 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 TInt SetFileHeader ( 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 TInt SetFileHeader ( 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 TInt StaticDataTypesCount ( 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 TInt SupportedDRMMethods ( 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 TInt SupportedDataType ( const TInt aIndex,
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 TInt UnRegisterDataType ( const TInt aIndex )

UnRegisterDataType

Unregisters a datatype via its index.

Since
2.5

Parameters

const TInt aIndex

Version(void)

IMPORT_C TVersion Version ( 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