williamr@2
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Plugin interface
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef __STRINGDICTIONARY_H__
|
williamr@2
|
20 |
#define __STRINGDICTIONARY_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
class RString;
|
williamr@2
|
26 |
|
williamr@2
|
27 |
namespace Xml
|
williamr@2
|
28 |
{
|
williamr@2
|
29 |
|
williamr@2
|
30 |
class MStringDictionary
|
williamr@2
|
31 |
/**
|
williamr@2
|
32 |
This interface defines the API of a single string dictionary.
|
williamr@2
|
33 |
This class is not used directly, but via a derived class the user provides.
|
williamr@2
|
34 |
Derived classes must add all elements, attributes names, and attribute values that belong
|
williamr@2
|
35 |
to this string dictionary as static string tables to the StringPool. WBXML token mappings between
|
williamr@2
|
36 |
strings and WBXML tokens should also be maintained.
|
williamr@2
|
37 |
@see RStringPool
|
williamr@2
|
38 |
|
williamr@2
|
39 |
@publishedPartner
|
williamr@2
|
40 |
@released
|
williamr@2
|
41 |
*/
|
williamr@2
|
42 |
{
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
This method allows for the correct destrution of the string dictionary plugin.
|
williamr@2
|
47 |
|
williamr@2
|
48 |
@post the objects memory is cleaned up.
|
williamr@2
|
49 |
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
virtual void Release() = 0;
|
williamr@2
|
52 |
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
This method returns the element string associated with the given token.
|
williamr@2
|
55 |
|
williamr@2
|
56 |
@param aToken the element token.
|
williamr@2
|
57 |
@param aElement On return reflects the string corresponding to the token.
|
williamr@2
|
58 |
@leave KErrXmlUnsupportedElement, if the token doesn't correspond to an element.
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
virtual void ElementL(TInt aToken, RString& aElement) const = 0;
|
williamr@2
|
61 |
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
This method returns the attribute string associated with the given token.
|
williamr@2
|
64 |
|
williamr@2
|
65 |
@param aToken the attribute token.
|
williamr@2
|
66 |
@param aAttribute On return reflects the string corresponding to the token.
|
williamr@2
|
67 |
@leave KErrXmlUnsupportedAttribute, if the token doesn't correspond to an attribute.
|
williamr@2
|
68 |
*/
|
williamr@2
|
69 |
virtual void AttributeL(TInt aToken, RString& aAttribute) const = 0;
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
This method returns the attribute and value string associated with the given token.
|
williamr@2
|
73 |
|
williamr@2
|
74 |
@param aToken the attribute token.
|
williamr@2
|
75 |
@param aAttribute On return reflects the string corresponding to the token.
|
williamr@2
|
76 |
@param aValue On return reflects the string corresponding to the value
|
williamr@2
|
77 |
for this attibute.
|
williamr@2
|
78 |
@leave KErrXmlUnsupportedAttribute, if the token doesn't correspond to an attribute
|
williamr@2
|
79 |
@leave KErrXmlUnsupportedAttributeValue, if the token doesn't correspond to a value
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
virtual void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const = 0;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
This method returns the value string associated with the given token.
|
williamr@2
|
85 |
|
williamr@2
|
86 |
@param aToken the attribute token.
|
williamr@2
|
87 |
@param aValue On return reflects the string corresponding to the value
|
williamr@2
|
88 |
for this attibute.
|
williamr@2
|
89 |
@leave KErrXmlUnsupportedAttributeValue, if the token doesn't correspond to value.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
virtual void AttributeValueL(TInt aToken, RString& aValue) const = 0;
|
williamr@2
|
92 |
|
williamr@2
|
93 |
|
williamr@2
|
94 |
/**
|
williamr@2
|
95 |
This method compares the Dictionary description with that provided.
|
williamr@2
|
96 |
|
williamr@2
|
97 |
@return ETrue if this is the same Dictionary (i.e. a match), EFalse otherwise.
|
williamr@2
|
98 |
|
williamr@2
|
99 |
@param aDictionaryDescription The description we want to compare.
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
virtual TBool CompareThisDictionary(const RString& aDictionaryDescription) const = 0;
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
This method switches the dictionary to use the specified codepage.
|
williamr@2
|
105 |
|
williamr@2
|
106 |
@return The codepage switched to, or KErrXmlMissingStringDictionary if it is not supported.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
@param aCodePage The code page to switch to.
|
williamr@2
|
109 |
*/
|
williamr@2
|
110 |
virtual TInt SwitchCodePage(TInt aCodePage) = 0;
|
williamr@2
|
111 |
|
williamr@2
|
112 |
/**
|
williamr@2
|
113 |
This method obtains the public identifier from the StringTable.
|
williamr@2
|
114 |
Either the formal or non formal public id will do.
|
williamr@2
|
115 |
The stringDictionary .rss files must list both these as wbxml
|
williamr@2
|
116 |
documents have one or the other.
|
williamr@2
|
117 |
|
williamr@2
|
118 |
@param aPubId The public identifier for this string
|
williamr@2
|
119 |
dictionary.
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
|
williamr@2
|
122 |
virtual void PublicIdentifier(RString& aPubId) = 0;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
/**
|
williamr@2
|
125 |
The element types in the Device Information DTD are defined within
|
williamr@2
|
126 |
a namespace associated with the Uri/Urn available from the StringTable.
|
williamr@2
|
127 |
The RString need not be closed, but closing is harmless.
|
williamr@2
|
128 |
|
williamr@2
|
129 |
@param aUri The associated namespace for this string
|
williamr@2
|
130 |
dictionary.
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
|
williamr@2
|
133 |
virtual void NamespaceUri(RString& aUri) = 0;
|
williamr@2
|
134 |
};
|
williamr@2
|
135 |
|
williamr@2
|
136 |
}
|
williamr@2
|
137 |
|
williamr@2
|
138 |
#endif //__STRINGDICTIONARY_H__
|