inc/Oma1Dcf.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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 OMA1DCF_H
       
    21 #define OMA1DCF_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "DcfCommon.h"
       
    25 
       
    26 // CONSTANTS
       
    27 const TUint KOma1DcfVersion = 0x00010000;
       
    28 _LIT8(KContentName, "Content-Name");
       
    29 _LIT8(KContentDescription, "Content-Description");
       
    30 _LIT8(KRightsIssuer, "Rights-Issuer");
       
    31 _LIT8(KContentVendor, "Content-Vendor");
       
    32 _LIT8(KIconURI, "Icon-URI");
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class RWriteStream;
       
    36 class RFile;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Encapsulates an OMA DRM 1 DCF content file
       
    42 *  ?other_description_lines
       
    43 *
       
    44 *  @lib ?library
       
    45 *  @since Series 60 3.0
       
    46 */
       
    47 class COma1Dcf : public CDcfCommon
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         IMPORT_C static COma1Dcf* NewL(
       
    55             const RFile& aFile);
       
    56             
       
    57         IMPORT_C static COma1Dcf* NewL(
       
    58             const TDesC8& aMemoryBlock);
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         IMPORT_C virtual ~COma1Dcf();
       
    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         IMPORT_C static TBool IsValidDcf(
       
    74             const TDesC8& aDcfFragment);
       
    75 
       
    76         TInt ReadHeaderL(
       
    77             const TDesC8& aMemoryBlock);
       
    78 
       
    79         TInt ReadHeaderL(void);
       
    80 
       
    81         TInt CreateHeaderL(
       
    82             RWriteStream&); // use only when you know what you're doing! Writes only the header?
       
    83             
       
    84         TInt CheckUniqueId(
       
    85             const TDesC& aUniqueId);
       
    86             
       
    87         TInt OpenPart(
       
    88             const TDesC& aUniqueId);
       
    89             
       
    90         TInt OpenPart(
       
    91             TInt aPart);
       
    92             
       
    93         void GetPartIdsL(
       
    94             RPointerArray<HBufC8>& aPartList);
       
    95             
       
    96         void ReadHeaderValuesL(void);
       
    97             
       
    98         IMPORT_C TInt GetHeaderL(
       
    99             const TDesC8& aHeaderName,
       
   100             TPtrC8& aHeaderValue);
       
   101 
       
   102     public: // Functions from base classes
       
   103 
       
   104         /**
       
   105         * From ?base_class ?member_description.
       
   106         * @since Series ?XX ?SeriesXX_version
       
   107         * @param ?arg1 ?description
       
   108         * @return ?description
       
   109         */
       
   110         
       
   111     protected:  // New functions
       
   112         
       
   113         /**
       
   114         * ?member_description.
       
   115         * @since Series ?XX ?SeriesXX_version
       
   116         * @param ?arg1 ?description
       
   117         * @return ?description
       
   118         */
       
   119         //?type ?member_function( ?type ?arg1 );
       
   120 
       
   121     protected:  // Functions from base classes
       
   122         
       
   123         /**
       
   124         * From ?base_class ?member_description
       
   125         */
       
   126         //?type ?member_function();
       
   127 
       
   128     private:
       
   129 
       
   130         COma1Dcf();
       
   131 
       
   132         void ConstructL(
       
   133             const RFile& aFile);
       
   134             
       
   135         void ConstructL(
       
   136             const TDesC8& aMemoryBlock);
       
   137 
       
   138         // Prohibit copy constructor if not deriving from CBase.
       
   139         // COma1Dcf( const COma1Dcf& );
       
   140         // Prohibit assigment operator if not deriving from CBase.
       
   141         // COma1Dcf& operator=( const COma1Dcf& );
       
   142         
       
   143         static HBufC8* FetchOmaBasedInfoL();
       
   144 
       
   145     public:     // Data
       
   146         // ?one_line_short_description_of_data
       
   147         TUint iHeaderLength;
       
   148 
       
   149         HBufC8* iHeaders;
       
   150 
       
   151     protected:  // Data
       
   152         // ?one_line_short_description_of_data
       
   153         //?data_declaration;
       
   154 
       
   155     private:    // Data
       
   156         // ?one_line_short_description_of_data
       
   157         //?data_declaration;
       
   158          
       
   159         // Reserved pointer for future extension
       
   160         //TAny* iReserved;
       
   161         
       
   162     public:     // Friend classes
       
   163         //?friend_class_declaration;
       
   164     protected:  // Friend classes
       
   165         //?friend_class_declaration;
       
   166     private:    // Friend classes
       
   167         //?friend_class_declaration;
       
   168 
       
   169     };
       
   170 
       
   171 #endif      // OMA1DCF_H   
       
   172             
       
   173 // End of File