|
1 // Copyright (c) 2006-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 __SLSTRINGDICT00_H__ |
|
19 #define __SLSTRINGDICT00_H__ |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <stringpool.h> |
|
23 #include <xml/plugins/stringdictionary.h> |
|
24 |
|
25 |
|
26 class CSl1_0StringDict00 : public CBase, public Xml::MStringDictionary |
|
27 /** |
|
28 The Sl1_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 @prototype This is the first drop of this component. |
|
36 */ |
|
37 { |
|
38 public: |
|
39 static Xml::MStringDictionary* NewL(TAny* aStringPool); |
|
40 virtual ~CSl1_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 SL 1.0//EN |
|
66 ETagTokenSl = 0x05 |
|
67 }; |
|
68 |
|
69 |
|
70 enum TAttributeToken { |
|
71 // CodePage 00 |
|
72 // -//WAPFORUM//DTD SL 1.0//EN |
|
73 EAttributeTokenAction1 = 0x05, |
|
74 EAttributeTokenAction2 = 0x06, |
|
75 EAttributeTokenAction3 = 0x07, |
|
76 EAttributeTokenHref1 = 0x08, |
|
77 EAttributeTokenHref2 = 0x09, |
|
78 EAttributeTokenHref3 = 0x0A, |
|
79 EAttributeTokenHref4 = 0x0B, |
|
80 EAttributeTokenHref5 = 0x0C, |
|
81 }; |
|
82 |
|
83 |
|
84 |
|
85 enum TAttributeValueToken { |
|
86 // CodePage 00 |
|
87 // -//WAPFORUM//DTD SL 1.0//EN |
|
88 EAttributeValueTokenAction1 = 0x05, |
|
89 EAttributeValueTokenAction2 = 0x06, |
|
90 EAttributeValueTokenAction3 = 0x07, |
|
91 EAttributeValueTokenHref1 = 0x08, |
|
92 EAttributeValueTokenHref2 = 0x09, |
|
93 EAttributeValueTokenHref3 = 0x0A, |
|
94 EAttributeValueTokenHref4 = 0x0B, |
|
95 EAttributeValueTokenHref5 = 0x0C, |
|
96 EAttributeValueTokenCom = 0x85, |
|
97 EAttributeValueTokenEdu = 0x86, |
|
98 EAttributeValueTokenNet = 0x87, |
|
99 EAttributeValueTokenOrg = 0x88, |
|
100 }; |
|
101 |
|
102 |
|
103 |
|
104 private: |
|
105 |
|
106 CSl1_0StringDict00(RStringPool* aStringPool); |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 The StringPool for this string dictionary. |
|
112 We don't own this. |
|
113 */ |
|
114 RStringPool iStringPool; |
|
115 |
|
116 Xml::CDictionaryCodePage* iCodepage00Table; |
|
117 |
|
118 TInt iCodePage; |
|
119 |
|
120 }; |
|
121 |
|
122 |
|
123 const TInt iTagCodePage00[] = |
|
124 {CSl1_0StringDict00::ETagTokenSl, |
|
125 0}; // ok to end with zero as this is used by a global token |
|
126 |
|
127 |
|
128 const TInt iAttributeCodePage00[] = |
|
129 {CSl1_0StringDict00::EAttributeTokenAction1, |
|
130 CSl1_0StringDict00::EAttributeTokenAction2, |
|
131 CSl1_0StringDict00::EAttributeTokenAction3, |
|
132 CSl1_0StringDict00::EAttributeTokenHref1, |
|
133 CSl1_0StringDict00::EAttributeTokenHref2, |
|
134 CSl1_0StringDict00::EAttributeTokenHref3, |
|
135 CSl1_0StringDict00::EAttributeTokenHref4, |
|
136 CSl1_0StringDict00::EAttributeTokenHref5, |
|
137 0}; // ok to end with zero as this is used by a global token |
|
138 |
|
139 |
|
140 |
|
141 const TInt iAttributeValueCodePage00[] = |
|
142 {CSl1_0StringDict00::EAttributeValueTokenAction1, |
|
143 CSl1_0StringDict00::EAttributeValueTokenAction2, |
|
144 CSl1_0StringDict00::EAttributeValueTokenAction3, |
|
145 CSl1_0StringDict00::EAttributeValueTokenHref1, |
|
146 CSl1_0StringDict00::EAttributeValueTokenHref2, |
|
147 CSl1_0StringDict00::EAttributeValueTokenHref3, |
|
148 CSl1_0StringDict00::EAttributeValueTokenHref4, |
|
149 CSl1_0StringDict00::EAttributeValueTokenHref5, |
|
150 CSl1_0StringDict00::EAttributeValueTokenCom, |
|
151 CSl1_0StringDict00::EAttributeValueTokenEdu, |
|
152 CSl1_0StringDict00::EAttributeValueTokenNet, |
|
153 CSl1_0StringDict00::EAttributeValueTokenOrg, |
|
154 0}; // ok to end with zero as this is used by a global token |
|
155 |
|
156 |
|
157 #endif //__SLSTRINGDICT00_H__ |