dependencies/DRMNotifier.h
author kashif.sayed
Fri, 26 Mar 2010 04:17:01 +0530
branchv5backport
changeset 31 a3e98f9c292b
permissions -rw-r--r--
added missing files user: kashif.sayed added dependencies/AknTaskList.h added dependencies/DRMEvent.h added dependencies/DRMEventObserver.h added dependencies/DRMNotifier.h added dependencies/SchemeDefs.hrh added dependencies/SchemeHandler.h added dependencies/SchemeHandler.inl added dependencies/aiwcommon.hrh added dependencies/aiwdialdata.h added dependencies/drmrightsinfo.h added dependencies/drmutilitytypes.h added dependencies/javaattribute.h added dependencies/javadomainpskeys.h added dependencies/javaregistry.h added dependencies/javaregistryapplicationentry.h added dependencies/javaregistryentry.h added dependencies/javaregistryentrytype.h added dependencies/javaregistrypackageentry.h added dependencies/mjavaattribute.h added dependencies/swi/bld.inf added dependencies/swi/sispackagetrust.h added dependencies/swi/sisregistryentry.h added dependencies/swi/sisregistrylog.h added dependencies/swi/sisregistrysession.h changed .cproject changed dependencies/S3libs/bld.inf changed dependencies/bld.inf

/*
* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  This class handles registering and unregistering of
*                DRM event observers to DRM notifier, and sending
*                DRM notifications to other registered observers.
*
*/



#ifndef CDRMNOTIFIER_H
#define CDRMNOTIFIER_H

//  INCLUDES
#include <e32base.h>
#include <DRMEventObserver.h>
#include <DRMEvent.h>

// CONSTANTS
// MACROS
// DATA TYPES
// FUNCTION PROTOTYPES
// FORWARD DECLARATIONS
class CDRMEventHandler;

// CLASS DECLARATION

/**
 *  With this class an application can register to receive DRM related 
 *  notifications.
 *
 *  @lib DRMCommon.dll
 *  @since S60Rel2.6
 */
class CDRMNotifier : public CBase
{
public:  // Constructors and destructor   
    /**
    * Two-phased constructor.
    */
    IMPORT_C static CDRMNotifier* NewL( void );
   
    /**
    * Two-phased constructor.
    */
    IMPORT_C static CDRMNotifier* NewLC( void );
   
    /**
    * Destructor.
    */
    IMPORT_C virtual ~CDRMNotifier();
   
public: // New functions   
    /**
    * RegisterEventObserverL
    *
    * Registers a new event observer to DRM Notifier. Listens to all events
    * of the given type
    *
    * @since S60Rel2.6
    * @param aObserver Observer.
    * @param aEvent the type of event to listen to
    * @return none, leaves with Symbian OS error code if an error occurs
    */
    IMPORT_C void RegisterEventObserverL( MDRMEventObserver& aObserver , 
                                          const TDRMEventType& aEvent);   
    /**
    * UnRegisterEventObserverL
    *
    * Unregisters existing event observer from DRM Notifier.
    *
    * @since S60Rel2.6
    * @param aObserver Observer.
    * @param aEvent the type of event to unregister
    * @return none, leaves with Symbian OS error code if an error occurs
    */
    IMPORT_C void UnRegisterEventObserverL( MDRMEventObserver& aObserver, 
                                            const TDRMEventType& aEvent);
    /**
    * RegisterEventObserverL
    *
    * Registers a new event observer to DRM Notifier. Only recieves
    * notification when the rights accociated with the given content id
    * are handled
    *
    * @since S60Rel2.6
    * @param aObserver Observer
    * @param aEvent the type of event to listen to
    * @param aContentID the specific content id to listen to
    * @return none, leaves with Symbian OS error code if an error occurs
    */
    IMPORT_C void RegisterEventObserverL( MDRMEventObserver& aObserver , 
                                          const TDRMEventType& aEvent,
                                          const TDesC8& aContentID);
    /**
    * UnRegisterEventObserverL
    *
    * Unregisters existing event observer from DRM Notifier.
    *
    * @since S60Rel2.6
    * @param aObserver Observer.
    * @param aEvent the type of event to listen to
    * @param aContentID the specific content id to listen to
    * @return none, leaves with Symbian OS error code if an error occurs
    */
    IMPORT_C void UnRegisterEventObserverL( MDRMEventObserver& aObserver, 
                                            const TDRMEventType& aEvent,
                                            const TDesC8& aContentID);

    /**
    * SendEventL
    *
    * Sends a notification to registered observers
    *
    * @since S60Rel2.6
    * @param aEvent  the event to be sent
    * @param aStatus  the request status for the event, will be updated when
    *                 the event has been sent
    * @return none
    */
    IMPORT_C void SendEventL( MDRMEvent& aEvent, TRequestStatus& aStatus ); 
   
private:
   
    /**
    * C++ default constructor.
    */
    CDRMNotifier( void );

    /**
    * First Phase constructor
    */
    void ConstructL();
   
    // Prohibit copy constructor if not deriving from CBase.
    CDRMNotifier( const CDRMNotifier& );

    // Prohibit assigment operator if not deriving from CBase.
    CDRMNotifier& operator=( const CDRMNotifier& );

  private:    // Data
   // Event handler.
   CDRMEventHandler* iEventHandler;
};

#endif      // CDRMNOTIFIER_H   

// End of File