inc/drmutilitywmdrmutilities.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2008 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:  WM DRM specific methods for DRM Rights Manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DRMUTILITYWMDRMUTILITIES_H
       
    20 #define DRMUTILITYWMDRMUTILITIES_H
       
    21 
       
    22 // CONSTANTS
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class CDRMRightsConstraints;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 /**
       
    29 *  DRMUtilityWmDrmUtilities
       
    30 *
       
    31 *  Collection of WM DRM specific methods
       
    32 */
       
    33 class DrmUtilityWmDrmUtilities
       
    34 {
       
    35     public:
       
    36         /**
       
    37         * Parse WM DRM time based rights
       
    38         * @param aLex                 Lexicographic representation of a WM DRM 
       
    39         *                             rights 
       
    40         *                             string  
       
    41         * @param aStartTime           Parsed start time from the string    
       
    42         * @param aEndTime             Parsed end time from the string                         
       
    43         */
       
    44         IMPORT_C static void ParseWmDrmTimeRightsL( TLex& aLex, 
       
    45                                                     TTime& aStartTime,
       
    46                                                     TTime& aEndTime );       
       
    47     
       
    48         /**
       
    49          * Parse WM DRM count based rights
       
    50          * @param aLex                 Lexicographic representation of a WM DRM 
       
    51          *                             rights string
       
    52          * @param aCounts              The amount of count rights  
       
    53          * @return                     Whether count information was found or not                         
       
    54          */
       
    55          IMPORT_C static TBool ParseWmDrmCountRightsL( TLex& aLex, 
       
    56                                                        TUint32& aCounts );
       
    57        
       
    58         /**
       
    59          * Parse WM DRM duration rights
       
    60          * @param aLex                 Lexicographic representation of a WM DRM 
       
    61          *                             rights string  
       
    62          * @param aDuration            The duration of the rights
       
    63          * @return                     Whether duration information was found 
       
    64          *                             or not                       
       
    65          */
       
    66          IMPORT_C static TBool ParseWmDrmDurationRightsL( TLex& aLex,
       
    67             TTimeIntervalSeconds& aDuration );
       
    68     
       
    69         /**
       
    70          * Parse a WM DRM rights string to a rights constraint. Caller is responsible
       
    71          * for freeing the memory reserved for the constraint.
       
    72          * @param aRights              String to be parsed
       
    73          * @param aRightsConstraint    Rights constraint containing parsed rights
       
    74          */
       
    75          IMPORT_C static void ParseWmDrmStringL( ContentAccess::CRightsInfo& aRights,
       
    76             CDRMRightsConstraints*& aRightsConstraint );
       
    77        
       
    78         /** Checks the detailed rights of the WMDRM protected file from the
       
    79          * given array parameter. The other function parameter values are updated
       
    80          * based on the rights.
       
    81          * @param aUnconstrained       Whether the file has unlimited rights or not
       
    82          * @param aTime                Time left to use the file
       
    83          * @param aCounts              Counts left to use the file
       
    84          * @param aRights              WM DRM rights string which needs to parsed
       
    85          */
       
    86          IMPORT_C static void CheckWmDrmRightsL( TBool& aUnconstrained, 
       
    87                                                  TTimeIntervalSeconds& aTime, 
       
    88                                                  TInt& aCounts, 
       
    89                                                  ContentAccess::CRightsInfo& aRights );
       
    90                                            
       
    91     private:
       
    92                                      
       
    93 };
       
    94 
       
    95 #endif
       
    96 
       
    97 // End of File