DRM::CDrmAutomatedUsage Class Reference

class DRM::CDrmAutomatedUsage : public CBase

Utility class for DRM related automated usage handling

Usage:
        #include <drmautomatedusage.h>
      // Instantiate class CDrmAutomatedUsage
      DRM::CDrmAutomatedUsage* iAutomatedUsage =
          DRM::CDrmAutomatedUsage::NewLC();
      // ...
      // RFile myRingToneFile;
      // open my Ringtone for reading
      // ...
      ContentAccess::CData* myDataObject = ContentAccess::CData::NewL(
          myRingToneFile,
          ContentAccess::KDefaultContentObject,
          ContentAccess::EPeek );
      // check if content can be set as automated
      if ( iAutomatedUsage->CanSetAutomatedL(
          myDataObject,
          ContentAccess::EPlay,
          DRM::EAUAutomatedTypeRingingTone ) )
          {
          // automated usage allowed

          // we register content as ringing tone in this example
          iAutomatedUsage->SetAutomated(
              myDataObject,
              ContentAccess::EPlay,
              DRM::EAUAutomatedTypeRingingTone,
              DRM::EAUPassive );

          }
          else
          {
          // automated usage not allowed
          }
       
drmautomatedusage.lib
Since
S60 5.0

Inherits from

Public Member Functions
~CDrmAutomatedUsage ()
IMPORT_C TBool CanSetAutomatedL ( RFile &, const ContentAccess::TIntent , const TDrmAutomatedType )
IMPORT_C TBool CanSetAutomatedL (const ContentAccess::CData &, const ContentAccess::TIntent , const TDrmAutomatedType )
IMPORT_C TInt CancelOperation ( TInt )
IMPORT_C MDrmErrorHandling & GetErrorHandler ()
IMPORT_C CDrmUtility & GetUtility ()
IMPORT_C CDrmAutomatedUsage * NewL (CCoeEnv *)
IMPORT_C CDrmAutomatedUsage * NewLC (CCoeEnv *)
IMPORT_C void RegisterEventObserverL ( MDrmAutomatedUsageObserver &)
IMPORT_C TInt RemoveAutomatedAsyncL ( RFile &, const ContentAccess::TIntent , const TDrmAutomatedType , MDrmAsyncObserver &, const TDrmAutomatedServiceType )
IMPORT_C TInt RemoveAutomatedAsyncL (const ContentAccess::CData &, const ContentAccess::TIntent , const TDrmAutomatedType , MDrmAsyncObserver &, const TDrmAutomatedServiceType )
IMPORT_C TInt RemoveAutomatedAsyncL (const TDesC &, const ContentAccess::TIntent , const TDrmAutomatedType , MDrmAsyncObserver &, const TDrmAutomatedServiceType )
IMPORT_C void RemoveAutomatedL ( RFile &, const ContentAccess::TIntent , const TDrmAutomatedType , const TDrmAutomatedServiceType )
IMPORT_C void RemoveAutomatedL (const ContentAccess::CData &, const ContentAccess::TIntent , const TDrmAutomatedType , const TDrmAutomatedServiceType )
IMPORT_C void RemoveAutomatedL (const TDesC &, const ContentAccess::TIntent , const TDrmAutomatedType , const TDrmAutomatedServiceType )
IMPORT_C TInt SetAutomatedAsyncL ( RFile &, const ContentAccess::TIntent , const TDrmAutomatedType , MDrmAsyncObserver &, const TDrmAutomatedServiceType )
IMPORT_C TInt SetAutomatedAsyncL (const ContentAccess::CData &, const ContentAccess::TIntent , const TDrmAutomatedType , MDrmAsyncObserver &, const TDrmAutomatedServiceType )
IMPORT_C void SetAutomatedL ( RFile &, const ContentAccess::TIntent , const TDrmAutomatedType , const TDrmAutomatedServiceType )
IMPORT_C void SetAutomatedL (const ContentAccess::CData &, const ContentAccess::TIntent , const TDrmAutomatedType , const TDrmAutomatedServiceType )
IMPORT_C void UnregisterEventObserverL ( MDrmAutomatedUsageObserver &)
Private Member Functions
CDrmAutomatedUsage ()
void ConstructL (CCoeEnv *)
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()
Private Attributes
MDrmErrorHandling * iErrorHandler
CDrmAutomatedUsageImpl * iImplementation
CDrmUtility * iUtility

Constructor & Destructor Documentation

CDrmAutomatedUsage()

CDrmAutomatedUsage ( ) [private]

Default constructor

~CDrmAutomatedUsage()

~CDrmAutomatedUsage ( ) [virtual]

Destructor

Member Functions Documentation

CanSetAutomatedL(RFile &, const ContentAccess::TIntent, const TDrmAutomatedType)

IMPORT_C TBool CanSetAutomatedL ( RFile & aFile,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType
)

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

Since
S60 5.0
leave
System wide or DRM specific error code.
RFile ContentAccess::TIntent DRM::TDrmAutomatedType

Parameters

RFile & aFile file handle to the file
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType

CanSetAutomatedL(const ContentAccess::CData &, const ContentAccess::TIntent, const TDrmAutomatedType)

IMPORT_C TBool CanSetAutomatedL ( const ContentAccess::CData & aData,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType
)

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

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData ContentAccess::TIntent DRM::TDrmAutomatedType

Parameters

const ContentAccess::CData & aData CData object to the protected content
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType

CancelOperation(TInt)

IMPORT_C TInt CancelOperation ( TInt aOperationId )

Cancel an asyncronous operation

Since
S60 5.0

Parameters

TInt aOperationId identifier of the async operation to be cancelled

ConstructL(CCoeEnv *)

void ConstructL ( CCoeEnv * aCoeEnv ) [private]

Second phase constructor

Parameters

CCoeEnv * aCoeEnv

GetErrorHandler()

IMPORT_C MDrmErrorHandling & GetErrorHandler ( ) const

Returns a reference to a class which implements the MDrmErrorHandling interface. The ownership of the instance stays with the CDrmAutomatedUsage -class

GetUtility()

IMPORT_C CDrmUtility & GetUtility ( ) const

Returns a reference to a CDrmUtility instance. The ownership of the instance stays with the CDrmAutomatedUsage -class

Since
S60 5.0
DRM::CDrmUtility

NewL(CCoeEnv *)

IMPORT_C CDrmAutomatedUsage * NewL ( CCoeEnv * aCoeEnv = NULL ) [static]

Creates a new CDrmAutomatedUsage object and returns a pointer to it

Since
S60 5.0
If no CCoeEnv instance is available, applications launched will be launched as standalone applications.
leave
System wide error code
CCoeEnv

Parameters

CCoeEnv * aCoeEnv = NULL A pointer to an instance of CCoeEnv. If the parameter is not provided the global instance will be used. In the case of a server process where the global instance is not available, global notes will be used.

NewLC(CCoeEnv *)

IMPORT_C CDrmAutomatedUsage * NewLC ( CCoeEnv * aCoeEnv = NULL ) [static]

Creates a new CDrmAutomatedUsage object and returns a pointer to it Leaves the pointer to the cleanup stack

Since
S60 5.0
If no CCoeEnv instance is available, applications launched will be launched as standalone applications.
leave
System wide error code
CCoeEnv

Parameters

CCoeEnv * aCoeEnv = NULL A pointer to an instance of CCoeEnv. If the parameter is not provided the global instance will be used. In the case of a server process where the global instance is not available, global notes will be used.

RegisterEventObserverL(MDrmAutomatedUsageObserver &)

IMPORT_C void RegisterEventObserverL ( MDrmAutomatedUsageObserver & aObserver )

Registers client to listen events related to automated usage. If the client doesn't do this, all the events are handled automatically according to the S60 style.

The observer registered with this function needs to be unregistered before it is deleted.

Since
S60 5.0
leave
System wide or DRM specific error code.
DRM::MDrmAutomatedUsageObserver

Parameters

MDrmAutomatedUsageObserver & aObserver

RemoveAutomatedAsyncL(RFile &, const ContentAccess::TIntent, const TDrmAutomatedType, MDrmAsyncObserver &, const TDrmAutomatedServiceType)

IMPORT_C TInt RemoveAutomatedAsyncL ( RFile & aFile,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
MDrmAsyncObserver & aObserver,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
RFile ContentAccess::TIntent DRM::TDrmAutomatedType DRM::MDrmAsyncObserver DRM::TDrmAutomatedServiceType

Parameters

RFile & aFile file handle to the file
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
MDrmAsyncObserver & aObserver Async callback observer
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

RemoveAutomatedAsyncL(const ContentAccess::CData &, const ContentAccess::TIntent, const TDrmAutomatedType, MDrmAsyncObserver &, const TDrmAutomatedServiceType)

IMPORT_C TInt RemoveAutomatedAsyncL ( const ContentAccess::CData & aData,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
MDrmAsyncObserver & aObserver,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData ContentAccess::TIntent DRM::TDrmAutomatedType DRM::MDrmAsyncObserver DRM::TDrmAutomatedServiceType

Parameters

const ContentAccess::CData & aData CData object to the protected content
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
MDrmAsyncObserver & aObserver Async callback observer
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

RemoveAutomatedAsyncL(const TDesC &, const ContentAccess::TIntent, const TDrmAutomatedType, MDrmAsyncObserver &, const TDrmAutomatedServiceType)

IMPORT_C TInt RemoveAutomatedAsyncL ( const TDesC & aUniqueId,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
MDrmAsyncObserver & aObserver,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData::GetStringAttribute() ContentAccess::TStringAttribute ContentAccess::TIntent DRM::TDrmAutomatedType DRM::MDrmAsyncObserver DRM::TDrmAutomatedServiceType

Parameters

const TDesC & aUniqueId unique content id
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
MDrmAsyncObserver & aObserver Async callback observer
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

RemoveAutomatedL(RFile &, const ContentAccess::TIntent, const TDrmAutomatedType, const TDrmAutomatedServiceType)

IMPORT_C void RemoveAutomatedL ( RFile & aFile,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
RFile ContentAccess::TIntent DRM::TDrmAutomatedType DRM::TDrmAutomatedServiceType

Parameters

RFile & aFile file handle to the file
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

RemoveAutomatedL(const ContentAccess::CData &, const ContentAccess::TIntent, const TDrmAutomatedType, const TDrmAutomatedServiceType)

IMPORT_C void RemoveAutomatedL ( const ContentAccess::CData & aData,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData ContentAccess::TIntent DRM::TDrmAutomatedType DRM::TDrmAutomatedServiceType

Parameters

const ContentAccess::CData & aData CData object to the protected content
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

RemoveAutomatedL(const TDesC &, const ContentAccess::TIntent, const TDrmAutomatedType, const TDrmAutomatedServiceType)

IMPORT_C void RemoveAutomatedL ( const TDesC & aUniqueId,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Unregisters given content from being used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::TIntent ContentAccess::CData::GetStringAttribute() ContentAccess::TStringAttribute ContentAccess::TIntent DRM::TDrmAutomatedType DRM::TDrmAutomatedServiceType

Parameters

const TDesC & aUniqueId unique content id
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

SetAutomatedAsyncL(RFile &, const ContentAccess::TIntent, const TDrmAutomatedType, MDrmAsyncObserver &, const TDrmAutomatedServiceType)

IMPORT_C TInt SetAutomatedAsyncL ( RFile & aFile,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
MDrmAsyncObserver & aObserver,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Registers given content to be used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
RFile ContentAccess::TIntent DRM::TDrmAutomatedType DRM::MDrmAsyncObserver DRM::TDrmAutomatedServiceType

Parameters

RFile & aFile file handle to the file
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
MDrmAsyncObserver & aObserver Async callback observer
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

SetAutomatedAsyncL(const ContentAccess::CData &, const ContentAccess::TIntent, const TDrmAutomatedType, MDrmAsyncObserver &, const TDrmAutomatedServiceType)

IMPORT_C TInt SetAutomatedAsyncL ( const ContentAccess::CData & aData,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
MDrmAsyncObserver & aObserver,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Registers given content to be used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData ContentAccess::TIntent DRM::TDrmAutomatedType DRM::MDrmAsyncObserver DRM::TDrmAutomatedServiceType

Parameters

const ContentAccess::CData & aData CData object to the protected content
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
MDrmAsyncObserver & aObserver Async callback observer
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

SetAutomatedL(RFile &, const ContentAccess::TIntent, const TDrmAutomatedType, const TDrmAutomatedServiceType)

IMPORT_C void SetAutomatedL ( RFile & aFile,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Registers given content to be used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
RFile ContentAccess::TIntent DRM::TDrmAutomatedType DRM::TDrmAutomatedServiceType

Parameters

RFile & aFile file handle to the file
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

SetAutomatedL(const ContentAccess::CData &, const ContentAccess::TIntent, const TDrmAutomatedType, const TDrmAutomatedServiceType)

IMPORT_C void SetAutomatedL ( const ContentAccess::CData & aData,
const ContentAccess::TIntent aIntent,
const TDrmAutomatedType aAutomatedType,
const TDrmAutomatedServiceType aServiceType = EAUActive
)

Registers given content to be used as an automated content.

Since
S60 5.0
leave
System wide or DRM specific error code.
ContentAccess::CData ContentAccess::TIntent DRM::TDrmAutomatedType DRM::TDrmAutomatedServiceType

Parameters

const ContentAccess::CData & aData CData object to the protected content
const ContentAccess::TIntent aIntent See ContentAccess::Intent
const TDrmAutomatedType aAutomatedType Usage intention of the automated content
const TDrmAutomatedServiceType aServiceType = EAUActive default: EAUActive

UnregisterEventObserverL(MDrmAutomatedUsageObserver &)

IMPORT_C void UnregisterEventObserverL ( MDrmAutomatedUsageObserver & aObserver )

Unregisters client from listening to events related to automated usage.

If register event observer has been called, it must be unregistered before the observer object is deleted.

Since
S60 5.0
leave
System wide or DRM specific error code.
DRM::MDrmAutomatedUsageObserver

Parameters

MDrmAutomatedUsageObserver & aObserver

Member Data Documentation

MDrmErrorHandling * iErrorHandler

MDrmErrorHandling * iErrorHandler [private]

Implementation class pointer Owned

CDrmAutomatedUsageImpl * iImplementation

CDrmAutomatedUsageImpl * iImplementation [private]

Implementation class pointer Owned

CDrmUtility * iUtility

CDrmUtility * iUtility [private]

Implementation class pointer Owned