xml/wbxmlparser/src/sd_emn/emn1_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 #ifndef __EMNSTRINGDICT00_H__
       
    18 #define __EMNSTRINGDICT00_H__
       
    19 
       
    20 #include <e32std.h>
       
    21 #include <stringpool.h>
       
    22 
       
    23 #include <xml/plugins/stringdictionary.h>
       
    24 
       
    25 
       
    26 class CEmn1_0StringDict00 : public CBase, public Xml::MStringDictionary
       
    27 /**
       
    28 The Emn1_0StringDict00 class is a derived class defining the API of a single string dictionary. 
       
    29 
       
    30 Derived classes must add all elements, attributes names, and attribute values that belong
       
    31 to this string dictionary as static string tables to the StringPool. WBXML token mappings between 
       
    32 strings and WBXML tokens should also be maintained.
       
    33 
       
    34 @internalTechnology
       
    35 */
       
    36 	{
       
    37 public:
       
    38 	static Xml::MStringDictionary* NewL(TAny* aStringPool);
       
    39 	virtual ~CEmn1_0StringDict00();
       
    40 	void ConstructL();
       
    41 
       
    42 	void ElementL(TInt aToken, RString& aElement) const;
       
    43 	void AttributeL(TInt aToken, RString& aAttribute) const;
       
    44 	void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const;
       
    45 	void AttributeValueL(TInt aToken, RString& aValue) const;
       
    46 
       
    47 	TBool CompareThisDictionary(const RString& aDictionaryDescription) const;
       
    48 
       
    49 	TInt SwitchCodePage(TInt aCodePage);
       
    50 	void PublicIdentifier(RString& aPubId);
       
    51 	void NamespaceUri(RString& aUri);
       
    52 
       
    53 	void Release();
       
    54 
       
    55 public:
       
    56 
       
    57 	// CodePage tokens.
       
    58 	//
       
    59 	// Note: There will be correlation between these token values and their
       
    60 	// strings via the CDictionaryCodePage using the RStringPool.
       
    61 
       
    62 	enum TTagToken {
       
    63 		// CodePage 00
       
    64 		// -//WAPFORUM//DTD EMN 1.0//EN
       
    65 		ETagTokenEmn 						= 0x05,
       
    66 	};
       
    67 
       
    68 
       
    69 	enum TAttributeToken {
       
    70 		// CodePage 00
       
    71 		// -//WAPFORUM//DTD EMN 1.0//EN
       
    72 		EAttributeTokenMailbox 				= 0x05,
       
    73 		EAttributeTokenTimestamp 				= 0x06,
       
    74 	};
       
    75 
       
    76 
       
    77 
       
    78 	
       
    79 
       
    80 private:
       
    81 
       
    82 	CEmn1_0StringDict00(RStringPool* aStringPool);
       
    83 
       
    84 private:
       
    85 
       
    86 /**
       
    87 The StringPool for this string dictionary.
       
    88 We don't own this.
       
    89 */
       
    90 	RStringPool				iStringPool;
       
    91 
       
    92 	Xml::CDictionaryCodePage*	iCodepage00Table;
       
    93 
       
    94 	TInt					iCodePage;
       
    95 
       
    96 	};
       
    97 
       
    98 
       
    99 const TInt iTagCodePage00[] = 
       
   100 	{CEmn1_0StringDict00::ETagTokenEmn,
       
   101 	 0}; // ok to end with zero as this is used by a global token
       
   102 
       
   103 
       
   104 const TInt iAttributeCodePage00[] = 
       
   105 	{CEmn1_0StringDict00::EAttributeTokenMailbox,
       
   106 	 CEmn1_0StringDict00::EAttributeTokenTimestamp,
       
   107 	 0}; // ok to end with zero as this is used by a global token
       
   108 
       
   109 
       
   110 
       
   111 #endif //__EMNSTRINGDICT00_H__