omadrm/drmengine/ro/inc/DrmRel1_0StringDict00.h
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    22 #ifndef __SISTRINGDICT00_H__
    22 #ifndef __SISTRINGDICT00_H__
    23 #define __SISTRINGDICT00_H__
    23 #define __SISTRINGDICT00_H__
    24 
    24 
    25 #include <e32std.h>
    25 #include <e32std.h>
    26 #include <stringpool.h>
    26 #include <stringpool.h>
    27 #include <Xml/Plugins/StringDictionary.h>
    27 #include <xml/plugins/stringdictionary.h>
    28 
    28 
    29 
    29 
    30 class CDrmRel1_0StringDict00 : public CBase, public Xml::MStringDictionary
    30 class CDrmRel1_0StringDict00 : public CBase, public Xml::MStringDictionary
    31 /**
    31 /**
    32 The DrmRel1_0StringDict00 class is a derived class defining the API of a single string dictionary. 
    32 The DrmRel1_0StringDict00 class is a derived class defining the API of a single string dictionary.
    33 
    33 
    34 Derived classes must add all elements, attributes names, and attribute values that belong
    34 Derived classes must add all elements, attributes names, and attribute values that belong
    35 to this string dictionary as static string tables to the StringPool. WBXML token mappings between 
    35 to this string dictionary as static string tables to the StringPool. WBXML token mappings between
    36 strings and WBXML tokens should also be maintained.
    36 strings and WBXML tokens should also be maintained.
    37 
    37 
    38 @internalTechnology
    38 @internalTechnology
    39 @interim This is the first drop of this component.
    39 @interim This is the first drop of this component.
    40 */
    40 */
    41 	{
    41     {
    42 public:
    42 public:
    43 	static Xml::MStringDictionary* NewL(TAny* aStringPool);
    43     static Xml::MStringDictionary* NewL(TAny* aStringPool);
    44 	virtual ~CDrmRel1_0StringDict00();
    44     virtual ~CDrmRel1_0StringDict00();
    45 	void ConstructL();
    45     void ConstructL();
    46 
    46 
    47 	void ElementL(TInt aToken, RString& aElement) const;
    47     void ElementL(TInt aToken, RString& aElement) const;
    48 	void AttributeL(TInt aToken, RString& aAttribute) const;
    48     void AttributeL(TInt aToken, RString& aAttribute) const;
    49 	void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const;
    49     void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const;
    50 	void AttributeValueL(TInt aToken, RString& aValue) const;
    50     void AttributeValueL(TInt aToken, RString& aValue) const;
    51 
    51 
    52 	TBool CompareThisDictionary(const RString& aDictionaryDescription) const;
    52     TBool CompareThisDictionary(const RString& aDictionaryDescription) const;
    53 
    53 
    54 	TInt SwitchCodePage(TInt aCodePage);
    54     TInt SwitchCodePage(TInt aCodePage);
    55 	void PublicIdentifier(RString& aPubId);
    55     void PublicIdentifier(RString& aPubId);
    56 	void NamespaceUri(RString& aUri);
    56     void NamespaceUri(RString& aUri);
    57 
    57 
    58 	void Release();
    58     void Release();
    59 
    59 
    60 public:
    60 public:
    61 
    61 
    62 	// CodePage tokens.
    62     // CodePage tokens.
    63 	//
    63     //
    64 	// Note: There will be correlation between these token values and their
    64     // Note: There will be correlation between these token values and their
    65 	// strings via the CDictionaryCodePage using the RStringPool.
    65     // strings via the CDictionaryCodePage using the RStringPool.
    66 
    66 
    67 	enum TTagToken
    67     enum TTagToken
    68         {
    68         {
    69 		// CodePage 00
    69         // CodePage 00
    70 		// -//OMA//DTD DRMREL 1.0//EN
    70         // -//OMA//DTD DRMREL 1.0//EN
    71         ERights = 0x05,
    71         ERights = 0x05,
    72         EContext = 0x06,
    72         EContext = 0x06,
    73         EVersion = 0x07,
    73         EVersion = 0x07,
    74         EUid = 0x08,
    74         EUid = 0x08,
    75         EAgreement = 0x09,
    75         EAgreement = 0x09,
    85         ECount = 0x13,
    85         ECount = 0x13,
    86         EDateTime = 0x14,
    86         EDateTime = 0x14,
    87         EStart = 0x15,
    87         EStart = 0x15,
    88         EEnd = 0x16,
    88         EEnd = 0x16,
    89         EInterval = 0x17
    89         EInterval = 0x17
    90     	};
    90         };
    91 
    91 
    92 
    92 
    93 	enum TAttributeToken
    93     enum TAttributeToken
    94         {
    94         {
    95 		// CodePage 00
    95         // CodePage 00
    96 		// -//OMA//DTD DRMREL 1.0//EN
    96         // -//OMA//DTD DRMREL 1.0//EN
    97         EXmlnsOEx = 0x05,
    97         EXmlnsOEx = 0x05,
    98         EXmlnsODd = 0x06,
    98         EXmlnsODd = 0x06,
    99         EXmlnsDs = 0x07
    99         EXmlnsDs = 0x07
   100     	};
   100         };
   101 
   101 
   102 
   102 
   103 
   103 
   104 	enum TAttributeValueToken
   104     enum TAttributeValueToken
   105         {
   105         {
   106 		// CodePage 00
   106         // CodePage 00
   107 		// -//OMA//DTD DRMREL 1.0//EN
   107         // -//OMA//DTD DRMREL 1.0//EN
   108         EValueXmlnsOEx = 0x05,
   108         EValueXmlnsOEx = 0x05,
   109         EValueXmlnsODd = 0x06,
   109         EValueXmlnsODd = 0x06,
   110         EValueXmlnsDs = 0x07,
   110         EValueXmlnsDs = 0x07,
   111         EOdrlEx = 0x85,
   111         EOdrlEx = 0x85,
   112         EOdrlDd = 0x86,
   112         EOdrlDd = 0x86,
   113         EXmlDsig = 0x87
   113         EXmlDsig = 0x87
   114 	    };
   114         };
   115 
   115 
   116 
   116 
   117 
   117 
   118 private:
   118 private:
   119 
   119 
   120 	CDrmRel1_0StringDict00(RStringPool* aStringPool);
   120     CDrmRel1_0StringDict00(RStringPool* aStringPool);
   121 
   121 
   122 private:
   122 private:
   123 
   123 
   124 /**
   124 /**
   125 The StringPool for this string dictionary.
   125 The StringPool for this string dictionary.
   126 We don't own this.
   126 We don't own this.
   127 */
   127 */
   128 	RStringPool				iStringPool;
   128     RStringPool             iStringPool;
   129 
   129 
   130 	Xml::CDictionaryCodePage*	iCodepage00Table;
   130     Xml::CDictionaryCodePage*   iCodepage00Table;
   131 
   131 
   132 	TInt					iCodePage;
   132     TInt                    iCodePage;
   133 
   133 
   134 	};
   134     };
   135 
   135 
   136 
   136 
   137 const TInt iTagCodePage00[] = 
   137 const TInt iTagCodePage00[] =
   138 	{
   138     {
   139     CDrmRel1_0StringDict00::ERights,
   139     CDrmRel1_0StringDict00::ERights,
   140     CDrmRel1_0StringDict00::EContext,
   140     CDrmRel1_0StringDict00::EContext,
   141     CDrmRel1_0StringDict00::EVersion,
   141     CDrmRel1_0StringDict00::EVersion,
   142     CDrmRel1_0StringDict00::EUid,
   142     CDrmRel1_0StringDict00::EUid,
   143     CDrmRel1_0StringDict00::EAgreement,
   143     CDrmRel1_0StringDict00::EAgreement,
   153     CDrmRel1_0StringDict00::ECount,
   153     CDrmRel1_0StringDict00::ECount,
   154     CDrmRel1_0StringDict00::EDateTime,
   154     CDrmRel1_0StringDict00::EDateTime,
   155     CDrmRel1_0StringDict00::EStart,
   155     CDrmRel1_0StringDict00::EStart,
   156     CDrmRel1_0StringDict00::EEnd,
   156     CDrmRel1_0StringDict00::EEnd,
   157     CDrmRel1_0StringDict00::EInterval,
   157     CDrmRel1_0StringDict00::EInterval,
   158 	0 // ok to end with zero as this is used by a global token
   158     0 // ok to end with zero as this is used by a global token
   159     }; 
   159     };
   160 
   160 
   161 
   161 
   162 const TInt iAttributeCodePage00[] = 
   162 const TInt iAttributeCodePage00[] =
   163 	{
   163     {
   164     CDrmRel1_0StringDict00::EXmlnsOEx,
   164     CDrmRel1_0StringDict00::EXmlnsOEx,
   165     CDrmRel1_0StringDict00::EXmlnsODd,
   165     CDrmRel1_0StringDict00::EXmlnsODd,
   166     CDrmRel1_0StringDict00::EXmlnsDs,
   166     CDrmRel1_0StringDict00::EXmlnsDs,
   167 	0  // ok to end with zero as this is used by a global token
   167     0  // ok to end with zero as this is used by a global token
   168     };
   168     };
   169 
   169 
   170 
   170 
   171 
   171 
   172 const TInt iAttributeValueCodePage00[] = 
   172 const TInt iAttributeValueCodePage00[] =
   173 	{
   173     {
   174     CDrmRel1_0StringDict00::EXmlnsOEx,
   174     CDrmRel1_0StringDict00::EXmlnsOEx,
   175     CDrmRel1_0StringDict00::EXmlnsODd,
   175     CDrmRel1_0StringDict00::EXmlnsODd,
   176     CDrmRel1_0StringDict00::EXmlnsDs,
   176     CDrmRel1_0StringDict00::EXmlnsDs,
   177     CDrmRel1_0StringDict00::EOdrlEx,
   177     CDrmRel1_0StringDict00::EOdrlEx,
   178     CDrmRel1_0StringDict00::EOdrlDd,
   178     CDrmRel1_0StringDict00::EOdrlDd,
   179     CDrmRel1_0StringDict00::EXmlDsig,
   179     CDrmRel1_0StringDict00::EXmlDsig,
   180 	0 // ok to end with zero as this is used by a global token
   180     0 // ok to end with zero as this is used by a global token
   181     }; 
   181     };
   182 
   182 
   183 
   183 
   184 #endif //__SISTRINGDICT00_H__
   184 #endif //__SISTRINGDICT00_H__