drm_plat/drm_rights_api/inc/DcfCommon.h
changeset 0 95b198f216e5
child 31 908beac81e0a
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef DCFCOMMON_H
       
    21 #define DCFCOMMON_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <apmstd.h>
       
    25 #include <f32file.h>
       
    26 #include <oma2agent.h>
       
    27 #include <drmtypes.h>
       
    28 
       
    29 using namespace ContentAccess;
       
    30 // CONSTANTS
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class RFile;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  ?one_line_short_description.
       
    39 *  ?other_description_lines
       
    40 *
       
    41 *  @lib ?library
       
    42 *  @since Series ?XX ?SeriesXX_version
       
    43 */
       
    44 class CDcfCommon : public CBase
       
    45     {
       
    46     public:  // Enumerations
       
    47 
       
    48     public:  // Constructors and destructor
       
    49         
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         IMPORT_C static CDcfCommon* NewL(
       
    54             const RFile& aFile);
       
    55             
       
    56         IMPORT_C static CDcfCommon* NewL(
       
    57             const TDesC& aFileName,
       
    58             RFs* aFs = NULL);
       
    59             
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         IMPORT_C virtual ~CDcfCommon();
       
    64 
       
    65     public: // New functions
       
    66         
       
    67         /**
       
    68         * ?member_description.
       
    69         * @since Series ?XX ?SeriesXX_version
       
    70         * @param ?arg1 ?description
       
    71         * @return ?description
       
    72         */
       
    73 		virtual TInt CheckUniqueId(const TDesC& aUniqueId);
       
    74         virtual TInt OpenPart(const TDesC& aUniqueId) = 0;
       
    75         virtual TInt OpenPart(TInt Index) = 0;
       
    76         virtual void GetPartIdsL(RPointerArray<HBufC8>& aPartList) = 0;
       
    77 
       
    78     public: // Functions from base classes
       
    79 
       
    80         /**
       
    81         * From ?base_class ?member_description.
       
    82         * @since Series ?XX ?SeriesXX_version
       
    83         * @param ?arg1 ?description
       
    84         * @return ?description
       
    85         */
       
    86         //?type ?member_function( ?type ?arg1 );
       
    87         
       
    88     protected:  // New functions
       
    89         
       
    90         /**
       
    91         * ?member_description.
       
    92         * @since Series ?XX ?SeriesXX_version
       
    93         * @param ?arg1 ?description
       
    94         * @return ?description
       
    95         */
       
    96         //?type ?member_function( ?type ?arg1 );
       
    97 
       
    98     protected:  // Functions from base classes
       
    99         
       
   100         /**
       
   101         * From ?base_class ?member_description
       
   102         */
       
   103         //?type ?member_function();
       
   104 
       
   105     protected:
       
   106 
       
   107         /**
       
   108         * C++ default constructor.
       
   109         */
       
   110         CDcfCommon();
       
   111 
       
   112         /**
       
   113         * Symbian 2nd phase constructor.
       
   114         */
       
   115         void ConstructL(
       
   116             const RFile& aFile);
       
   117             
       
   118         void ConstructL(
       
   119             const TDesC8& aMemoryBlock);
       
   120             
       
   121         // Prohibit copy constructor if not deriving from CBase.
       
   122         // CDcfCommon( const CDcfCommon& );
       
   123         // Prohibit assigment operator if not deriving from CBase.
       
   124         // CDcfCommon& operator=( const CDcfCommon& );
       
   125 
       
   126     public:     // Data
       
   127         // File to be used for reading
       
   128         RFile iFile;
       
   129 
       
   130         // Offset of the data part from the beginning of the file
       
   131         TInt iOffset;
       
   132 
       
   133         // The data part, used only when opening from a memory block
       
   134         HBufC8* iData;
       
   135     
       
   136         // DCF version
       
   137         TUint iVersion;
       
   138 
       
   139         // Size of the DCF itself
       
   140         TInt iLength;
       
   141 
       
   142         // Size of the encrypted data
       
   143         TUint iDataLength;
       
   144 
       
   145         // Size of the decrypted data
       
   146         TUint iPlainTextLength;
       
   147 
       
   148         // Flag indicating if the padding is removed from the plaintext length
       
   149         TBool iPlainTextLengthValid;
       
   150 
       
   151         // Original MIME type
       
   152         HBufC8* iMimeType;
       
   153 
       
   154         // Unique OMA DCF content ID
       
   155         HBufC8* iContentID;
       
   156 
       
   157         // Rights issuer URL for rights refresh
       
   158         HBufC8* iRightsIssuerURL;
       
   159 
       
   160         // Size of the padding for the encrypted data, negative if not valid
       
   161         TInt iPadding;
       
   162         
       
   163         // Encryption method (NULL, CBC or CTR)
       
   164         TEncryptionMethod iEncryptionMethod;
       
   165 
       
   166         // Title of the content (content name for OMA DRM 1.0 DCF files)
       
   167         HBufC8* iTitle;
       
   168         
       
   169         // Content description
       
   170         HBufC8* iDescription;
       
   171         
       
   172         // URI for a descriptive icon
       
   173         HBufC8* iIconUri;
       
   174 
       
   175     protected:  // Data
       
   176 
       
   177     private:    // Data
       
   178         // ?one_line_short_description_of_data
       
   179         //?data_declaration;
       
   180          
       
   181         // Reserved pointer for future extension
       
   182         //TAny* iReserved;
       
   183 
       
   184     public:     // Friend classes
       
   185         //?friend_class_declaration;
       
   186     protected:  // Friend classes
       
   187         //?friend_class_declaration;
       
   188     private:    // Friend classes
       
   189         //?friend_class_declaration;
       
   190 
       
   191     };
       
   192 
       
   193 #endif      // DCFCOMMON_H   
       
   194             
       
   195 // End of File