xml/xmlfw/test/rtest/tsrc/t_stringdictionary00.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 
       
    19 #ifndef __T_STRINGDICTIONARY00_H__
       
    20 #define __T_STRINGDICTIONARY00_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <stringpool.h>
       
    24 
       
    25 #include <xml/plugins/stringdictionary.h>
       
    26 
       
    27 
       
    28 class CTestStringDictionary00 : public CBase, public Xml::MStringDictionary
       
    29 /**
       
    30 The TestStringDictionary00 class is a derived class defining the API of a single string dictionary. 
       
    31 
       
    32 Derived classes must add all elements, attributes names, and attribute values that belong
       
    33 to this string dictionary as static string tables to the StringPool. WBXML token mappings between 
       
    34 strings and WBXML tokens should also be maintained.
       
    35 */
       
    36 	{
       
    37 public:
       
    38 
       
    39 	static Xml::MStringDictionary* NewL(TAny* aStringPool);
       
    40 	virtual ~CTestStringDictionary00();
       
    41 
       
    42 	void ConstructL();
       
    43 
       
    44 	void ElementL(TInt aToken, RString& aElement) const;
       
    45 	void AttributeL(TInt aToken, RString& aAttribute) const;
       
    46 	void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const;
       
    47 	void AttributeValueL(TInt aToken, RString& aValue) const;
       
    48 
       
    49 	TBool CompareThisDictionary(const RString& aDictionaryDescription) const;
       
    50 
       
    51 	TInt SwitchCodePage(TInt aCodePage);
       
    52 	void PublicIdentifier(RString& aPubId);
       
    53 	void NamespaceUri(RString& aUri);
       
    54 
       
    55 	// From MStringDictionary
       
    56 	void Release();
       
    57 
       
    58 public:
       
    59 
       
    60 	// CodePage tokens.
       
    61 	//
       
    62 	// Note: There will be correlation between these token values and their
       
    63 	// strings via the CDictionaryCodePage using the RStringPool.
       
    64 
       
    65 	enum TTokenValue {
       
    66 		// CodePage 00
       
    67 		// -//SYNCML//DTD SyncML 1.1//EN
       
    68 		ETokenValueAdd					= 0x05,
       
    69 		ETokenValueAlert				= 0x06,
       
    70 		ETokenValueArchive				= 0x07,
       
    71 		ETokenValueAtomic				= 0x08,
       
    72 		ETokenValueChal					= 0x09,
       
    73 		ETokenValueCmd					= 0x0A,
       
    74 		ETokenValueCmdID				= 0x0B,
       
    75 		ETokenValueCmdRef				= 0x0C,
       
    76 		ETokenValueCopy					= 0x0D,
       
    77 		ETokenValueCred					= 0x0E,
       
    78 		ETokenValueData					= 0x0F,
       
    79 		ETokenValueDelete				= 0x10,
       
    80 		ETokenValueExec					= 0x11,
       
    81 		ETokenValueFinal				= 0x12,
       
    82 		ETokenValueGet					= 0x13,
       
    83 		ETokenValueItem					= 0x14,
       
    84 		ETokenValueLang					= 0x15,
       
    85 		ETokenValueLocName				= 0x16,
       
    86 		ETokenValueLocURI				= 0x17,
       
    87 		ETokenValueMap					= 0x18,
       
    88 		ETokenValueMapItem				= 0x19,
       
    89 		ETokenValueMeta					= 0x1A,
       
    90 		ETokenValueMsgID				= 0x1B,
       
    91 		ETokenValueMsgRef				= 0x1C,
       
    92 		ETokenValueNoResp				= 0x1D,
       
    93 		ETokenValueNoResults			= 0x1E,
       
    94 		ETokenValuePut					= 0x1F,
       
    95 		ETokenValueReplace				= 0x20,
       
    96 		ETokenValueRespURI				= 0x21,
       
    97 		ETokenValueResults				= 0x22,
       
    98 		ETokenValueSearch				= 0x23,
       
    99 		ETokenValueSequence				= 0x24,
       
   100 		ETokenValueSessionID			= 0x25,
       
   101 		ETokenValueSftDel				= 0x26,
       
   102 		ETokenValueSource				= 0x27,
       
   103 		ETokenValueSourceRef			= 0x28,
       
   104 		ETokenValueStatus				= 0x29,
       
   105 		ETokenValueSync					= 0x2A,
       
   106 		ETokenValueSyncBody				= 0x2B,
       
   107 		ETokenValueSyncHdr				= 0x2C,
       
   108 		ETokenValueSyncML				= 0x2D,
       
   109 		ETokenValueTarget				= 0x2E,
       
   110 		ETokenValueTargetRef			= 0x2F,
       
   111 		ETokenValueReservedForFutureUse	= 0x30,
       
   112 		ETokenValueVerDTD				= 0x31,
       
   113 		ETokenValueVerProto				= 0x32,
       
   114 		ETokenValueNumberOfChanges		= 0x33,
       
   115 		ETokenValueMoreData				= 0x34,
       
   116 	};
       
   117 
       
   118 
       
   119 private:
       
   120 
       
   121 	CTestStringDictionary00(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 	TInt					iCodePage;
       
   133 	};
       
   134 
       
   135 
       
   136 const TInt iCodePage00[] = 
       
   137 	{CTestStringDictionary00::ETokenValueAdd,
       
   138 	 CTestStringDictionary00::ETokenValueAlert,
       
   139 	 CTestStringDictionary00::ETokenValueArchive,
       
   140 	 CTestStringDictionary00::ETokenValueAtomic,
       
   141 	 CTestStringDictionary00::ETokenValueChal,
       
   142 	 CTestStringDictionary00::ETokenValueCmd,
       
   143 	 CTestStringDictionary00::ETokenValueCmdID,
       
   144 	 CTestStringDictionary00::ETokenValueCmdRef,
       
   145 	 CTestStringDictionary00::ETokenValueCopy,
       
   146 	 CTestStringDictionary00::ETokenValueCred,
       
   147 	 CTestStringDictionary00::ETokenValueData,
       
   148 	 CTestStringDictionary00::ETokenValueDelete,
       
   149 	 CTestStringDictionary00::ETokenValueExec,
       
   150 	 CTestStringDictionary00::ETokenValueFinal,
       
   151 	 CTestStringDictionary00::ETokenValueGet,
       
   152 	 CTestStringDictionary00::ETokenValueItem,
       
   153 	 CTestStringDictionary00::ETokenValueLang,
       
   154 	 CTestStringDictionary00::ETokenValueLocName,
       
   155 	 CTestStringDictionary00::ETokenValueLocURI,
       
   156 	 CTestStringDictionary00::ETokenValueMap,
       
   157 	 CTestStringDictionary00::ETokenValueMapItem,
       
   158 	 CTestStringDictionary00::ETokenValueMeta,
       
   159 	 CTestStringDictionary00::ETokenValueMsgID,
       
   160 	 CTestStringDictionary00::ETokenValueMsgRef,
       
   161 	 CTestStringDictionary00::ETokenValueNoResp,
       
   162 	 CTestStringDictionary00::ETokenValueNoResults,
       
   163 	 CTestStringDictionary00::ETokenValuePut,
       
   164 	 CTestStringDictionary00::ETokenValueReplace,
       
   165 	 CTestStringDictionary00::ETokenValueRespURI,
       
   166 	 CTestStringDictionary00::ETokenValueResults,
       
   167 	 CTestStringDictionary00::ETokenValueSearch,
       
   168 	 CTestStringDictionary00::ETokenValueSequence,
       
   169 	 CTestStringDictionary00::ETokenValueSessionID,
       
   170 	 CTestStringDictionary00::ETokenValueSftDel,
       
   171 	 CTestStringDictionary00::ETokenValueSource,
       
   172 	 CTestStringDictionary00::ETokenValueSourceRef,
       
   173 	 CTestStringDictionary00::ETokenValueStatus,
       
   174 	 CTestStringDictionary00::ETokenValueSync,
       
   175 	 CTestStringDictionary00::ETokenValueSyncBody,
       
   176 	 CTestStringDictionary00::ETokenValueSyncHdr,
       
   177 	 CTestStringDictionary00::ETokenValueSyncML,
       
   178 	 CTestStringDictionary00::ETokenValueTarget,
       
   179 	 CTestStringDictionary00::ETokenValueTargetRef,
       
   180 	 CTestStringDictionary00::ETokenValueReservedForFutureUse,
       
   181 	 CTestStringDictionary00::ETokenValueVerDTD,
       
   182 	 CTestStringDictionary00::ETokenValueVerProto,
       
   183 	 CTestStringDictionary00::ETokenValueNumberOfChanges,
       
   184 	 CTestStringDictionary00::ETokenValueMoreData,
       
   185 	 0}; // ok to end with zero as this is used by a global token
       
   186 
       
   187 #endif //__T_STRINGDICTIONARY00_H__