xml/wbxmlparser/src/sd_serviceindication/si1_0stringdict00.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Plugin interface
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __SISTRINGDICT00_H__
       
    19 #define __SISTRINGDICT00_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <stringpool.h>
       
    23 
       
    24 #include <xml/plugins/stringdictionary.h>
       
    25 
       
    26 
       
    27 class CSi1_0StringDict00 : public CBase, public Xml::MStringDictionary
       
    28 /**
       
    29 The Si1_0StringDict00 class is a derived class defining the API of a single string dictionary. 
       
    30 
       
    31 Derived classes must add all elements, attributes names, and attribute values that belong
       
    32 to this string dictionary as static string tables to the StringPool. WBXML token mappings between 
       
    33 strings and WBXML tokens should also be maintained.
       
    34 
       
    35 @internalTechnology
       
    36 */
       
    37 	{
       
    38 public:
       
    39 	static Xml::MStringDictionary* NewL(TAny* aStringPool);
       
    40 	virtual ~CSi1_0StringDict00();
       
    41 	void ConstructL();
       
    42 
       
    43 	void ElementL(TInt aToken, RString& aElement) const;
       
    44 	void AttributeL(TInt aToken, RString& aAttribute) const;
       
    45 	void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const;
       
    46 	void AttributeValueL(TInt aToken, RString& aValue) const;
       
    47 
       
    48 	TBool CompareThisDictionary(const RString& aDictionaryDescription) const;
       
    49 
       
    50 	TInt SwitchCodePage(TInt aCodePage);
       
    51 	void PublicIdentifier(RString& aPubId);
       
    52 	void NamespaceUri(RString& aUri);
       
    53 
       
    54 	void Release();
       
    55 
       
    56 public:
       
    57 
       
    58 	// CodePage tokens.
       
    59 	//
       
    60 	// Note: There will be correlation between these token values and their
       
    61 	// strings via the CDictionaryCodePage using the RStringPool.
       
    62 
       
    63 	enum TTagToken {
       
    64 		// CodePage 00
       
    65 		// -//WAPFORUM//DTD SI 1.0//EN
       
    66 		ETagTokenSi 						= 0x05,
       
    67 		ETagTokenIndication 				= 0x06,
       
    68 		ETagTokenInfo 						= 0x07,
       
    69 		ETagTokenItem 						= 0x08,
       
    70 	};
       
    71 
       
    72 
       
    73 	enum TAttributeToken {
       
    74 		// CodePage 00
       
    75 		// -//WAPFORUM//DTD SI 1.0//EN
       
    76 		EAttributeTokenAction1 				= 0x05,
       
    77 		EAttributeTokenAction2 				= 0x06,
       
    78 		EAttributeTokenAction3 				= 0x07,
       
    79 		EAttributeTokenAction4 				= 0x08,
       
    80 		EAttributeTokenAction5 				= 0x09,
       
    81 		EAttributeTokenCreated 				= 0x0A,
       
    82 		EAttributeTokenHref1 				= 0x0B,
       
    83 		EAttributeTokenHref2 				= 0x0C,
       
    84 		EAttributeTokenHref3 				= 0x0D,
       
    85 		EAttributeTokenHref4 				= 0x0E,
       
    86 		EAttributeTokenHref5 				= 0x0F,
       
    87 		EAttributeTokenSiExpires 			= 0x10,
       
    88 		EAttributeTokenSiId 				= 0x11,
       
    89 		EAttributeTokenClass 				= 0x12,	
       
    90 	};
       
    91 
       
    92 
       
    93 
       
    94 	enum TAttributeValueToken {
       
    95 		// CodePage 00
       
    96 		// -//WAPFORUM//DTD SI 1.0//EN
       
    97 		EAttributeValueTokenAction1 		= 0x05,
       
    98 		EAttributeValueTokenAction2 		= 0x06,
       
    99 		EAttributeValueTokenAction3 		= 0x07,
       
   100 		EAttributeValueTokenAction4 		= 0x08,
       
   101 		EAttributeValueTokenAction5 		= 0x09,
       
   102 		EAttributeValueTokenCreated			= 0x0A,
       
   103 		EAttributeValueTokenHref1			= 0x0B,
       
   104 		EAttributeValueTokenHref2 			= 0x0C,
       
   105 		EAttributeValueTokenHref3 			= 0x0D,
       
   106 		EAttributeValueTokenHref4 			= 0x0E,
       
   107 		EAttributeValueTokenHref5 			= 0x0F,
       
   108 		EAttributeValueTokenSiExpires		= 0x10,
       
   109 		EAttributeValueTokenSiId			= 0x11,
       
   110 		EAttributeValueTokenClass			= 0x12,
       
   111 		EAttributeValueTokenCom 			= 0x85,
       
   112 		EAttributeValueTokenEdu 			= 0x86,
       
   113 		EAttributeValueTokenNet 			= 0x87,
       
   114 		EAttributeValueTokenOrg 			= 0x88,
       
   115 	};
       
   116 
       
   117 
       
   118 
       
   119 private:
       
   120 
       
   121 	CSi1_0StringDict00(RStringPool* aStringPool);
       
   122 
       
   123 private:
       
   124 
       
   125 /**
       
   126 The StringPool for this string dictionary.
       
   127 We don't own this.
       
   128 */
       
   129 	RStringPool				iStringPool;
       
   130 
       
   131 	Xml::CDictionaryCodePage*	iCodepage00Table;
       
   132 
       
   133 	TInt					iCodePage;
       
   134 
       
   135 	};
       
   136 
       
   137 
       
   138 const TInt iTagCodePage00[] = 
       
   139 	{CSi1_0StringDict00::ETagTokenSi,
       
   140 	 CSi1_0StringDict00::ETagTokenIndication,
       
   141 	 CSi1_0StringDict00::ETagTokenInfo,
       
   142 	 CSi1_0StringDict00::ETagTokenItem,
       
   143 	 0}; // ok to end with zero as this is used by a global token
       
   144 
       
   145 
       
   146 const TInt iAttributeCodePage00[] = 
       
   147 	{CSi1_0StringDict00::EAttributeTokenAction1,
       
   148 	 CSi1_0StringDict00::EAttributeTokenAction2,
       
   149 	 CSi1_0StringDict00::EAttributeTokenAction3,
       
   150 	 CSi1_0StringDict00::EAttributeTokenAction4,
       
   151 	 CSi1_0StringDict00::EAttributeTokenAction5,
       
   152 	 CSi1_0StringDict00::EAttributeTokenCreated,
       
   153 	 CSi1_0StringDict00::EAttributeTokenHref1,
       
   154 	 CSi1_0StringDict00::EAttributeTokenHref2,
       
   155 	 CSi1_0StringDict00::EAttributeTokenHref3,
       
   156 	 CSi1_0StringDict00::EAttributeTokenHref4,
       
   157 	 CSi1_0StringDict00::EAttributeTokenHref5,
       
   158 	 CSi1_0StringDict00::EAttributeTokenSiExpires,
       
   159 	 CSi1_0StringDict00::EAttributeTokenSiId,
       
   160 	 CSi1_0StringDict00::EAttributeTokenClass,	
       
   161 	 0}; // ok to end with zero as this is used by a global token
       
   162 
       
   163 
       
   164 
       
   165 const TInt iAttributeValueCodePage00[] = 
       
   166 	{CSi1_0StringDict00::EAttributeValueTokenAction1,
       
   167 	 CSi1_0StringDict00::EAttributeValueTokenAction2,
       
   168 	 CSi1_0StringDict00::EAttributeValueTokenAction3,
       
   169 	 CSi1_0StringDict00::EAttributeValueTokenAction4,
       
   170 	 CSi1_0StringDict00::EAttributeValueTokenAction5,
       
   171 	 CSi1_0StringDict00::EAttributeValueTokenCreated,
       
   172 	 CSi1_0StringDict00::EAttributeValueTokenHref1,
       
   173 	 CSi1_0StringDict00::EAttributeValueTokenHref2,
       
   174 	 CSi1_0StringDict00::EAttributeValueTokenHref3,
       
   175 	 CSi1_0StringDict00::EAttributeValueTokenHref4,
       
   176 	 CSi1_0StringDict00::EAttributeValueTokenHref5,
       
   177 	 CSi1_0StringDict00::EAttributeValueTokenSiExpires,
       
   178 	 CSi1_0StringDict00::EAttributeValueTokenSiId,
       
   179 	 CSi1_0StringDict00::EAttributeValueTokenClass,
       
   180 	 CSi1_0StringDict00::EAttributeValueTokenCom,
       
   181 	 CSi1_0StringDict00::EAttributeValueTokenEdu,
       
   182 	 CSi1_0StringDict00::EAttributeValueTokenNet,
       
   183 	 CSi1_0StringDict00::EAttributeValueTokenOrg,
       
   184 	 0}; // ok to end with zero as this is used by a global token
       
   185 
       
   186 
       
   187 #endif //__SISTRINGDICT00_H__