drm_plat/drm_legacy_api/inc/DRMEventAddRemove.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Rights object notification event
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CDRMEVENTADDREMOVE_H
       
    21 #define CDRMEVENTADDREMOVE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <DRMEvent.h>   
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 typedef enum 
       
    33     {
       
    34     ERightsObjectRecieved = 0,
       
    35     ERightsObjectDeleted = 1,
       
    36     ERightsObjectDeletedAll = 2,
       
    37     } TAddRemoveEventStatus;
       
    38 
       
    39 // FUNCTION PROTOTYPES
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 /**
       
    46 *  DRM Rights Object notication event class
       
    47 *  Used as data structure in the notification service
       
    48 *
       
    49 *  @lib DRMCommon.dll
       
    50 *  @since S60Rel2.6
       
    51 */
       
    52 
       
    53 class CDRMEventAddRemove : public MDRMEvent, public CBase 
       
    54 {
       
    55 public: // Constructors and destructor
       
    56 
       
    57 
       
    58     /**
       
    59     * NewLC
       
    60     *
       
    61     * Creates and instance of the CDRMEventAddRemove class and
       
    62     * returns a pointer to it Leaves the object in the cleanup
       
    63     * stack
       
    64     *
       
    65     * @return A functional CDRMEventAddRemove -object
       
    66     * @since S60Rel3.0
       
    67     */
       
    68     IMPORT_C static CDRMEventAddRemove* NewLC( TAddRemoveEventStatus aStatus );
       
    69 
       
    70     /**
       
    71     * NewL
       
    72     *
       
    73     * Creates and instance of the CDRMEventAddRemove class and
       
    74     * returns a pointer to it
       
    75     *
       
    76     * @return A functional CDRMEventAddRemove -object
       
    77     * @since S60Rel3.0
       
    78     */
       
    79     IMPORT_C static CDRMEventAddRemove* NewL( TAddRemoveEventStatus aStatus );
       
    80     
       
    81     /**
       
    82     * Destructor
       
    83     */   
       
    84     IMPORT_C virtual ~CDRMEventAddRemove();
       
    85 
       
    86 public: // new functions
       
    87 
       
    88 
       
    89     /**
       
    90     * SetContentIDL
       
    91     *
       
    92     * Sets the content id of the object and leaves if an error occurs
       
    93     *
       
    94     * @param aContentID : Descriptor containing the content id
       
    95     * @since S60Rel2.6
       
    96     */
       
    97     IMPORT_C virtual void SetContentIDL( const TDesC8& aContentID );
       
    98 
       
    99     /**
       
   100     * Status
       
   101     *
       
   102     * Returns the Rights Object event status
       
   103     *
       
   104     * @param aEventType : Out parameter for the event type
       
   105     * @since S60Rel2.6
       
   106     */
       
   107     IMPORT_C virtual TAddRemoveEventStatus Status() const;
       
   108 
       
   109     /**
       
   110     * GetContentIDL
       
   111     *
       
   112     * Returns a pointer to newly reserved buffer that containts the
       
   113     * content id. The caller must free the memory. 
       
   114     *
       
   115     * @since S60Rel2.6
       
   116     */
       
   117     IMPORT_C virtual HBufC8* GetContentIDL() const;
       
   118 
       
   119 public: // Functions from base classes
       
   120     /**
       
   121     * ExternalizeL
       
   122     *
       
   123     * Writes the objects data into a stream
       
   124     *
       
   125     * @param aOutput : an output stream where to write
       
   126     * @since S60Rel2.6
       
   127     */
       
   128     IMPORT_C virtual void ExternalizeL(RWriteStream& aOutput);
       
   129 
       
   130     /**
       
   131     * InternalizeL
       
   132     *
       
   133     * Reads the objects data from a stream
       
   134     *
       
   135     * @param aInput : an input stream where to read from
       
   136     * @since S60Rel2.6
       
   137     */
       
   138     IMPORT_C virtual void InternalizeL(RReadStream& aInput);
       
   139 
       
   140 private:
       
   141 
       
   142     /**
       
   143     * Constructor
       
   144     *
       
   145     * @param  aStatus the status of the event as TAddRemoveEventStatus 
       
   146     */
       
   147     CDRMEventAddRemove( TAddRemoveEventStatus aStatus );
       
   148     
       
   149     /**
       
   150     * C++ default constructor.
       
   151     */
       
   152     CDRMEventAddRemove( void );
       
   153 
       
   154     /**
       
   155     * First Phase constructor
       
   156     */
       
   157     void ConstructL();
       
   158    
       
   159     // Prohibit copy constructor
       
   160     CDRMEventAddRemove( const CDRMEventAddRemove& );
       
   161 
       
   162     // Prohibit assigment operator
       
   163     CDRMEventAddRemove& operator=( const CDRMEventAddRemove& );
       
   164 
       
   165     // The content identifier
       
   166     HBufC8* iContentID;
       
   167 
       
   168     // The status of the event
       
   169     TAddRemoveEventStatus iStatus;
       
   170 };
       
   171 
       
   172 #endif      // CDRMEVENTADDREMOVE_H
       
   173             
       
   174 // End of File