Home · All Classes · Annotated · Functions

DRM Agent Integration

Integrating a DRM Agent

All DRM agent functionality within Qtopia is accessed by either direct calls to the QDrmContentAgent class or through helper objects created by the QDrmContentAgent class. A DRM agent can be integrated into Qtopia by creating a new class that inherits from QDrmContentAgent and implements all of its virtual methods (excluding createFileEngine()) and reimplementing the QDrmContentAgent getDrm() method to return a pointer to a static instance of the agent class. This will also require implementing the helper classes returned by the createReadDevice(), createWriteDevice(), requestContentLicence() and createRightsModel() methods of QDrmContentAgent.

QDrmContentAgent

QDrmContentAgent provides an interface to access to the functionality of the DRM agent. This includes plaintext file access, content installation, rights management and content meta information queries.

QDrmContentLicence

A QDrmContentLicence object is responsible for maintaining information related to the usage of drm protected content. Applications consuming DRM protected content request an instance of QDrmContent for the content before accessing the content. If the licence is granted the application will then render the content informing the licence of the time rendered and number of uses by calling the renderStateChanged() slot whenever the rendering is started, stopped and paused. If the rights are invalid when a render is started or the rights expire while the content is being rendered QDrmContent licence should emit the rightsExpired signal to allow the application to take appropriate action.

QDrmContentAgent::createReadDevice()

The QIODevice returned by the createReadDevice() member of DRMContentAgent provides read only access to the plaintext content of DRM protected files. The QIODevice is not responsible for maintaining the rights of the file it is accessing, opening a file with invalid rights should fail but once opened the content of the file should be accessible until the it is closed again and all usage information should be updated seperately using QDrmContentLicence.

QDrmContentAgent::createWriteDevice()

The QIODevice implementation returned by the createWriteDevice() member of DRMContentAgent performs the same function as the installMessage members. DRM messsage data (application/vnd.oma.drm.message) written to the QIODevice is converted to the content format (application/vnd.oma.drm.content), written to filesystem and the associated rights are installed in the DRM agent database. There is no requirement on how the message data should be handled as it is received provided that on closing the QIODevice the message content is saved to the filesystem at the given file path in the .dcf format and all associated rights are installed to the drm agent rights database.

QDrmContentAgent::createRightsModel()

The QAbstractItemModel implementation returned by the createRightsModel() member of DRMContentAgent provides a complete listing of all rights objects stored in the DRM agent rights database. This model is used by administration applications to present the rights objects installed on the device to the user and provide a method for deleting individual rights objects. When a row is deleted from the model it is expected that the corresponding rights object be removed from DRM agent rights database.

The expected structure of a rights model is a list of rights objects with the following Qt::ItemDataRole mappings:

Qt::ItemDataRoleData
Qt::DisplayRoleName of content associated with rights.
Qt::DecorationRoleIcon for content associated with rights.
Qt::UserRoleSummary of rights object.

Beep Science Reference Integration

Qtopia provides a reference integration of the Beep Science DRM Agent V2.3 which is implemented in the files: $QPEDIR/src/libraries/qtopia/bsciagent.h $QPEDIR/src/libraries/qtopia/bsciagent.cpp


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7