Home · All Classes · Annotated · Functions

QDrmContentAgent Class Reference

#include <QDrmContentAgent>

Public Types

Public Functions

Static Public Members


Detailed Description

This class is an abstraction layer to allow the Qtopia Documents API and Server system to interact with a 3rd party DRM Agent program. The Documents API implementation will call methods on this class in order to access the encryption, decryption, rights management and meta-information services provided by the DRM Agent program.


Member Type Documentation

enum QDrmContentAgent::MetaData

Represents meta data that can be queried from a dcf file.

ConstantValueDescription
QDrmContentAgent::Unknown0x0000Base value for use in flags.
QDrmContentAgent::ContentSize0x0001The plaintext size of the protected content.
QDrmContentAgent::ContentType0x0002The MIME type of the protected content.
QDrmContentAgent::ContentId0x0004The files unique id.
QDrmContentAgent::ContentUrl0x0008Location of the content.
QDrmContentAgent::ContentVersion0x0010Version of the content.
QDrmContentAgent::RightsIssuerUrl0x0020Url where rights to the content can be obtained.
QDrmContentAgent::Title0x0040The user visible name of the content.
QDrmContentAgent::Description0x0080A description of the content.
QDrmContentAgent::Copyright0x0100Copyrights string for the content.
QDrmContentAgent::Author0x0200The author of the content.
QDrmContentAgent::IconUri0x0400A location where an icon for the content can be obtained.
QDrmContentAgent::InfoUrl0x0800A URL where additional information about the content can be obtained.

typedef QDrmContentAgent::MetaDataFlags

Synonym for QFlags< QDrmContentAgent::MetaData >


Member Function Documentation

QDrmContentAgent::QDrmContentAgent ()

Constructs a new QDrmMContentAgent object.

QDrmContentAgent::~QDrmContentAgent ()   [virtual]

Destroys a QDrmMContentAgent object.

QIODevice * QDrmContentAgent::createReadDevice ( const QString & dcfFilePath, QDrmContent::PermissionType permission )   [virtual]

Creates a new QIODevice from which the decrypted data in the dcf file located at dcfFilePath can be read. The file will be opened with permission and the caller is responsible for deleteing the QIODevice.

QAbstractItemModel * QDrmContentAgent::createRightsModel ( QObject * parent = 0 )   [virtual]

Creates a new QAbstractItemModel with parent containing a complete list of all rights stored in the drm agent database. If no parent is given the caller must explicitly delete the model.

QIODevice * QDrmContentAgent::createWriteDevice ( const QString & targetPath, const QString & boundary = QString(), qint64 contentLength = -1 )   [virtual]

Creates a QIODevice that will encode drm message data written to it and save the data to a dcf file at targetPath. If MIME headers are available the boundary and contentLength values should be supplied otherwise they will be inferred from the message data. The caller is responsible for deleting the QIODevice.

bool QDrmContentAgent::deleteRights ( const QString & dcfFilePath )   [virtual]

Deletes all rights associacted with the dcf file located at dcfFilePath. Returns true on success.

QDrmContent::ActivationOptions QDrmContentAgent::getActivationOptions ( const QString & dcfFilePath )   [virtual]

Returns flags indicating what options are available for activating the dcf file located at dcfFilePath.

QDrmContentAgent * QDrmContentAgent::getDrm ()   [static]

Returns a pointer to a static instance of DRMContentAgent.

QVariant QDrmContentAgent::getMetaData ( const QString & dcfFilePath, MetaData field )   [virtual]

Returns the value for a meta data field from the dcf file located at dcfFilePath.

bool QDrmContentAgent::getMetaData ( const QString & dcfFilePath, MetaDataFlags fields, QMap<MetaData, QVariant> & data )   [virtual]

This is an overloaded member function, provided for convenience.

Reads the meta data specificed in fields from the dcf file located at dcfFilePath. Each value successfully read is added to data, if any field cannot be read this will return false.

QDrmRights QDrmContentAgent::getRights ( const QString & dcfFilePath, QDrmContent::PermissionType permission )   [virtual]

Returns the current rights information for permission of the dcf file at dcfFilePath.

void QDrmContentAgent::getRights ( const QString & dcfFilePath, QDrmContent::PermissionFlags permissions, QMap<QDrmContent::PermissionType, QDrmRights> & rights )   [virtual]

This is an overloaded member function, provided for convenience.

Obtains the current rights information for permissions of the dcf file at dcfFilePath and adds them to rights.

bool QDrmContentAgent::hasRights ( const QString & dcfFilePath, QDrmContent::PermissionFlags permissions = QDrmContent::AllPermissions )   [virtual]

Returns true if the dcf file located at dcfFilePath contains any valid rights matching permissions.

bool QDrmContentAgent::installMessage ( QIODevice * message, const QString & targetPath, const QString & boundary = QString(), qint64 contentLength = -1 )   [virtual]

Encodes the drm message data in message and saves it to a dcf file at targetPath. If MIME headers are available the boundary and contentLength values should be supplied otherwise they will be inferred from the message data. Returns true if the installation was successful.

bool QDrmContentAgent::installMessage ( const QByteArray & message, const QString & targetPath, const QString & boundary = QString(), qint64 contentLength = -1 )   [virtual]

This is an overloaded member function, provided for convenience.

Encodes the drm message data in message and saves it to a dcf file at targetPath. If MIME headers are available the boundary and contentLength values should be supplied otherwise they will be inferred from the message data. Returns true if the installation was successful.

bool QDrmContentAgent::installRightsObject ( const QByteArray & rightsObject )   [virtual]

Installs a rightsObject to the agent rights database. Returns true on success.

bool QDrmContentAgent::isRedistributable ( const QString & dcfFilePath )   [virtual]

Returns true if the the dcf file located at dcfFilePath can copied off the device.

bool QDrmContentAgent::isValidDcf ( const QString & dcfFilePath )   [virtual]

Checks in the file located at dcfFilePath is a valid dcf file. Returns true if the file is a dcf file false otherwise.

QString QDrmContentAgent::parseRightsObject ( const QByteArray & rightsObject, QMap<QDrmContent::PermissionType, QDrmRights> & rights )   [virtual]

Parses a rightsObject and writes the contained rights information to rights. If known the file path of the associated dcf file is returned.

bool QDrmContentAgent::registerDcf ( const QString & dcfFilePath )   [virtual]

Registers the dcf file located at dcfFilePath with the drm agent. Returns true if the file is a valid dcf file and the registration was successful.

QDrmContentLicence * QDrmContentAgent::requestContentLicence ( const QContent & content, QDrmContent::PermissionType permission, QDrmContent::RenderState initialState )   [virtual]

Checks if there are current valid rights of type permission to render content. If the rights are valid a new ContentLicence is created with its starting render state set to initialState.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7