|
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 __DRMSTRINGDICT00_H__ |
|
19 #define __DRMSTRINGDICT00_H__ |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <stringpool.h> |
|
23 #include <xml/plugins/stringdictionary.h> |
|
24 |
|
25 |
|
26 class DRMStringDict00 : public CBase, public Xml::MStringDictionary |
|
27 /** |
|
28 The DRMStringDict00 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 ~DRMStringDict00(); |
|
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 // -//OMA//DTD DRMREL 1.0//EN |
|
66 ERights = 0x05, |
|
67 EContext = 0x06, |
|
68 EVersion = 0x07, |
|
69 EUid = 0x08, |
|
70 EAgreement = 0x09, |
|
71 EAsset = 0x0A, |
|
72 EKeyInfo = 0x0B, |
|
73 EKeyValue = 0x0C, |
|
74 EPermission = 0x0D, |
|
75 EPlay = 0x0E, |
|
76 EDisplay = 0x0F, |
|
77 EExecute = 0x10, |
|
78 EPrint = 0x11, |
|
79 EConstraint = 0x12, |
|
80 ECount = 0x13, |
|
81 EDateTime = 0x14, |
|
82 EStart = 0x15, |
|
83 EEnd = 0x16, |
|
84 EInterval = 0x17 |
|
85 }; |
|
86 |
|
87 enum TAttributeToken { |
|
88 // CodePage 00 |
|
89 // -//OMA//DTD DRMREL 1.0//EN |
|
90 EAttributeEx = 0x05, |
|
91 EAttributeDd = 0x06, |
|
92 EAttributeDs = 0x07 |
|
93 }; |
|
94 |
|
95 enum TAttributeValueToken { |
|
96 // CodePage 00 |
|
97 // -//OMA//DTD DRMREL 1.0//EN |
|
98 EAttributeValueEx = 0x85, |
|
99 EAttributeValueDd = 0x86, |
|
100 EAttributeValueDs = 0x87 |
|
101 }; |
|
102 |
|
103 |
|
104 |
|
105 private: |
|
106 |
|
107 DRMStringDict00(RStringPool* aStringPool); |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 The StringPool for this string dictionary. |
|
113 We don't own this. |
|
114 */ |
|
115 RStringPool iStringPool; |
|
116 |
|
117 Xml::CDictionaryCodePage* iCodepage00Table; |
|
118 |
|
119 TInt iCodePage; |
|
120 |
|
121 }; |
|
122 |
|
123 |
|
124 const TInt iTagCodePage00[] = |
|
125 {DRMStringDict00::ERights, |
|
126 DRMStringDict00::EContext, |
|
127 DRMStringDict00::EVersion, |
|
128 DRMStringDict00::EUid, |
|
129 DRMStringDict00::EAgreement, |
|
130 DRMStringDict00::EAsset, |
|
131 DRMStringDict00::EKeyInfo, |
|
132 DRMStringDict00::EKeyValue, |
|
133 DRMStringDict00::EPermission, |
|
134 DRMStringDict00::EPlay, |
|
135 DRMStringDict00::EDisplay, |
|
136 DRMStringDict00::EExecute, |
|
137 DRMStringDict00::EPrint, |
|
138 DRMStringDict00::EConstraint, |
|
139 DRMStringDict00::ECount, |
|
140 DRMStringDict00::EDateTime, |
|
141 DRMStringDict00::EStart, |
|
142 DRMStringDict00::EEnd, |
|
143 DRMStringDict00::EInterval, |
|
144 0}; // ok to end with zero as this is used by a global token |
|
145 |
|
146 |
|
147 const TInt iAttributeCodePage00[] = |
|
148 {DRMStringDict00::EAttributeEx, |
|
149 DRMStringDict00::EAttributeDd, |
|
150 DRMStringDict00::EAttributeDs, |
|
151 0}; // ok to end with zero as this is used by a global token |
|
152 |
|
153 |
|
154 |
|
155 const TInt iAttributeValueCodePage00[] = |
|
156 {DRMStringDict00::EAttributeValueEx, |
|
157 DRMStringDict00::EAttributeValueDd, |
|
158 DRMStringDict00::EAttributeValueDs, |
|
159 0}; // ok to end with zero as this is used by a global token |
|
160 |
|
161 |
|
162 #endif //__DRMSTRINGDICT00_H__ |