drm_plat/drm_utility_api/inc/drmrightsinfo.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Provides operations for rights information handling of DRM
       
    15  *                content
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CDRMRIGHTSINFO_H
       
    21 #define CDRMRIGHTSINFO_H
       
    22 
       
    23 //*** system include files go here:
       
    24 #include <e32base.h>
       
    25 #include <caf/caftypes.h>
       
    26 #include <drmutilitytypes.h>
       
    27 
       
    28 namespace DRM
       
    29     {
       
    30 
       
    31     //*** forward declarations go here:
       
    32     class CDrmUtility;
       
    33     class CDrmRightsInfoImpl;
       
    34     class MDrmAsyncObserver;
       
    35 
       
    36     /**
       
    37      *  Utility class for DRM related rights information handling
       
    38      *
       
    39      *  @lib drmrightsinfo.lib
       
    40      *  @since S60 v5.0
       
    41      */
       
    42 NONSHARABLE_CLASS( CDrmRightsInfo ) : public CBase
       
    43     {
       
    44 
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Creates a new CDrmRightsInfo object and returns a pointer to it
       
    49      *
       
    50      * @return A functional CDrmRightsInfo -object
       
    51      * @leave System wide error code
       
    52      */
       
    53     IMPORT_C static CDrmRightsInfo* NewL();
       
    54 
       
    55     /**
       
    56      * Creates a new CDrmRightsInfo object and returns a pointer to it
       
    57      * Leaves the pointer to the cleanup stack
       
    58      *
       
    59      * @return A functional CDrmRightsInfo -object
       
    60      * @leave System wide error code
       
    61      */
       
    62     IMPORT_C static CDrmRightsInfo* NewLC();
       
    63 
       
    64     /**
       
    65      * Destructor
       
    66      */
       
    67     virtual ~CDrmRightsInfo();
       
    68 
       
    69 
       
    70     /**
       
    71      * Returns a reference to a CDrmUtility instance. The ownership
       
    72      * of the instance stays with the CDrmRightsInfo -class
       
    73      *
       
    74      * @since S60 v5.0
       
    75      *
       
    76      * @return A reference to a functional CDrmUtility instance
       
    77      *
       
    78      * @leave None
       
    79      *
       
    80      * @see CDrmUtility
       
    81      */
       
    82     IMPORT_C CDrmUtility& GetUtility() const;
       
    83 
       
    84 
       
    85 
       
    86     /**
       
    87      * Checks the rights and their status for a specific unique id
       
    88      *
       
    89      * @param[in]   aUniqueId   The unique identifier of the content
       
    90      * @param[in]   aIntent     The intent for the rights to check
       
    91      * @param[out]  aDetails    Details of the rights status
       
    92      * @return none
       
    93      * @leave System wide error code
       
    94      * @see ContentAccess::TIntent
       
    95      */
       
    96     IMPORT_C void CheckRightsL(
       
    97             const TDesC& aUniqueId,
       
    98             ContentAccess::TIntent aIntent,
       
    99             TDrmRightsInfo& aDetails );
       
   100 
       
   101     /**
       
   102      * Checks the rights and their status for a specific unique id
       
   103      *
       
   104      * @param[in]   aUniqueId   The unique identifier of the content
       
   105      * @param[in]   aIntent     The intent for the rights to check
       
   106      * @param[out]  aDetails    Details of the rights status, the
       
   107      *                          details are available via this
       
   108      *                          parameter, once the async call completes
       
   109      *                          successfully
       
   110      * @param[in]   aObserver   reference to observer
       
   111      *
       
   112      * @return Operation Identifier for the async request
       
   113      *         required for cancelling an operation and
       
   114      *         identifying which request has been completed
       
   115      *
       
   116      * @leave System wide error code
       
   117      * @see ContentAccess::TIntent
       
   118      */
       
   119     IMPORT_C TInt CheckRightsAsyncL(
       
   120             const TDesC& aUniqueId,
       
   121             ContentAccess::TIntent aIntent,
       
   122             TDrmRightsInfo& aDetails,
       
   123             MDrmAsyncObserver& aObserver );
       
   124 
       
   125 
       
   126     /**
       
   127      * Cancel an asyncronous operation
       
   128      *
       
   129      * @since S60 v5.0
       
   130      * @param[in]   aOperationId    identifier of the async operation
       
   131      *                              to be cancelled
       
   132      * @return KErrNotFound if the operation has already been executed
       
   133      *         or it does not exist
       
   134      */
       
   135     IMPORT_C TInt CancelOperation( TInt aOperationId );
       
   136 
       
   137 private:
       
   138 
       
   139     //*** private, non-derived functions go here, starting with the C++
       
   140     //*** constructor and the Symbian second-phase constructor
       
   141 
       
   142     CDrmRightsInfo();
       
   143 
       
   144     void ConstructL();
       
   145 
       
   146 private: // Data members
       
   147 
       
   148     /**
       
   149      * Implementation class pointer
       
   150      * Owned
       
   151      */
       
   152     CDrmRightsInfoImpl* iImplementation;
       
   153 
       
   154 
       
   155     /**
       
   156      * CDrmUtility class pointer
       
   157      * Owned
       
   158      */
       
   159     CDrmUtility* iUtility;
       
   160 
       
   161     };
       
   162     }
       
   163 
       
   164 
       
   165 #endif // CDRMRIGHTSINFO_H