|
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 __SYNCMLSTRINGDICTIONARY01_V1_2_H__ |
|
20 #define __SYNCMLSTRINGDICTIONARY01_V1_2_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <stringpool.h> |
|
24 |
|
25 #include <xml/plugins/stringdictionary.h> |
|
26 |
|
27 class CSyncml1_2StringDictionary01 : public CBase, public Xml::MStringDictionary |
|
28 /** |
|
29 The Syncml1_2StringDictionary01 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 |
|
40 static Xml::MStringDictionary* NewL(TAny* aStringPool); |
|
41 virtual ~CSyncml1_2StringDictionary01(); |
|
42 |
|
43 void ConstructL(); |
|
44 |
|
45 void ElementL(TInt aToken, RString& aElement) const; |
|
46 void AttributeL(TInt aToken, RString& aAttribute) const; |
|
47 void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const; |
|
48 void AttributeValueL(TInt aToken, RString& aValue) const; |
|
49 |
|
50 TBool CompareThisDictionary(const RString& aDictionaryDescription) const; |
|
51 |
|
52 TInt SwitchCodePage(TInt aCodePage); |
|
53 void PublicIdentifier(RString& aPubId); |
|
54 void NamespaceUri(RString& aUri); |
|
55 |
|
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 01 |
|
67 // -//SYNCML//DTD MetInf 1.2//EN |
|
68 ETokenValueAnchor = 0x05, |
|
69 ETokenValueEMI = 0x06, |
|
70 ETokenValueFormat = 0x07, |
|
71 ETokenValueFreeID = 0x08, |
|
72 ETokenValueFreeMem = 0x09, |
|
73 ETokenValueLast = 0x0A, |
|
74 ETokenValueMark = 0x0B, |
|
75 ETokenValueMaxMsgSize = 0x0C, |
|
76 ETokenValueMem = 0x0D, |
|
77 ETokenValueMetInf = 0x0E, |
|
78 ETokenValueNext = 0x0F, |
|
79 ETokenValueNextNonce = 0x10, |
|
80 ETokenValueSharedMem = 0x11, |
|
81 ETokenValueSize = 0x12, |
|
82 ETokenValueType = 0x13, |
|
83 ETokenValueVersion = 0x14, |
|
84 ETokenValueMaxObjSize = 0x15, |
|
85 ETokenValueFieldLevel = 0x16, |
|
86 }; |
|
87 |
|
88 |
|
89 private: |
|
90 |
|
91 CSyncml1_2StringDictionary01(RStringPool* aStringPool); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 The StringPool for this string dictionary. |
|
97 We don't own this. |
|
98 */ |
|
99 RStringPool iStringPool; |
|
100 |
|
101 Xml::CDictionaryCodePage* iCodepage01Table; |
|
102 |
|
103 TInt iCodePage; |
|
104 |
|
105 }; |
|
106 |
|
107 |
|
108 const TInt iCodePage01[] = |
|
109 {CSyncml1_2StringDictionary01::ETokenValueAnchor, |
|
110 CSyncml1_2StringDictionary01::ETokenValueEMI, |
|
111 CSyncml1_2StringDictionary01::ETokenValueFormat, |
|
112 CSyncml1_2StringDictionary01::ETokenValueFreeID, |
|
113 CSyncml1_2StringDictionary01::ETokenValueFreeMem, |
|
114 CSyncml1_2StringDictionary01::ETokenValueLast, |
|
115 CSyncml1_2StringDictionary01::ETokenValueMark, |
|
116 CSyncml1_2StringDictionary01::ETokenValueMaxMsgSize, |
|
117 CSyncml1_2StringDictionary01::ETokenValueMem, |
|
118 CSyncml1_2StringDictionary01::ETokenValueMetInf, |
|
119 CSyncml1_2StringDictionary01::ETokenValueNext, |
|
120 CSyncml1_2StringDictionary01::ETokenValueNextNonce, |
|
121 CSyncml1_2StringDictionary01::ETokenValueSharedMem, |
|
122 CSyncml1_2StringDictionary01::ETokenValueSize, |
|
123 CSyncml1_2StringDictionary01::ETokenValueType, |
|
124 CSyncml1_2StringDictionary01::ETokenValueVersion, |
|
125 CSyncml1_2StringDictionary01::ETokenValueMaxObjSize, |
|
126 CSyncml1_2StringDictionary01::ETokenValueFieldLevel, |
|
127 0}; // ok to end with zero as this is used by a global token |
|
128 |
|
129 #endif //__SYNCMLSTRINGDICTIONARY01_V1_2_H__ |