williamr@2: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Plugin interface williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: #ifndef __STRINGDICTIONARY_H__ williamr@2: #define __STRINGDICTIONARY_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: williamr@2: class RString; williamr@2: williamr@2: namespace Xml williamr@2: { williamr@2: williamr@2: class MStringDictionary williamr@2: /** williamr@2: This interface defines the API of a single string dictionary. williamr@2: This class is not used directly, but via a derived class the user provides. williamr@2: Derived classes must add all elements, attributes names, and attribute values that belong williamr@2: to this string dictionary as static string tables to the StringPool. WBXML token mappings between williamr@2: strings and WBXML tokens should also be maintained. williamr@2: @see RStringPool williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: This method allows for the correct destrution of the string dictionary plugin. williamr@2: williamr@2: @post the objects memory is cleaned up. williamr@2: williamr@2: */ williamr@2: virtual void Release() = 0; williamr@2: williamr@2: /** williamr@2: This method returns the element string associated with the given token. williamr@2: williamr@2: @param aToken the element token. williamr@2: @param aElement On return reflects the string corresponding to the token. williamr@2: @leave KErrXmlUnsupportedElement, if the token doesn't correspond to an element. williamr@2: */ williamr@2: virtual void ElementL(TInt aToken, RString& aElement) const = 0; williamr@2: williamr@2: /** williamr@2: This method returns the attribute string associated with the given token. williamr@2: williamr@2: @param aToken the attribute token. williamr@2: @param aAttribute On return reflects the string corresponding to the token. williamr@2: @leave KErrXmlUnsupportedAttribute, if the token doesn't correspond to an attribute. williamr@2: */ williamr@2: virtual void AttributeL(TInt aToken, RString& aAttribute) const = 0; williamr@2: williamr@2: /** williamr@2: This method returns the attribute and value string associated with the given token. williamr@2: williamr@2: @param aToken the attribute token. williamr@2: @param aAttribute On return reflects the string corresponding to the token. williamr@2: @param aValue On return reflects the string corresponding to the value williamr@2: for this attibute. williamr@2: @leave KErrXmlUnsupportedAttribute, if the token doesn't correspond to an attribute williamr@2: @leave KErrXmlUnsupportedAttributeValue, if the token doesn't correspond to a value williamr@2: */ williamr@2: virtual void AttributeValuePairL(TInt aToken, RString& aAttribute, RString& aValue) const = 0; williamr@2: williamr@2: /** williamr@2: This method returns the value string associated with the given token. williamr@2: williamr@2: @param aToken the attribute token. williamr@2: @param aValue On return reflects the string corresponding to the value williamr@2: for this attibute. williamr@2: @leave KErrXmlUnsupportedAttributeValue, if the token doesn't correspond to value. williamr@2: */ williamr@2: virtual void AttributeValueL(TInt aToken, RString& aValue) const = 0; williamr@2: williamr@2: williamr@2: /** williamr@2: This method compares the Dictionary description with that provided. williamr@2: williamr@2: @return ETrue if this is the same Dictionary (i.e. a match), EFalse otherwise. williamr@2: williamr@2: @param aDictionaryDescription The description we want to compare. williamr@2: */ williamr@2: virtual TBool CompareThisDictionary(const RString& aDictionaryDescription) const = 0; williamr@2: williamr@2: /** williamr@2: This method switches the dictionary to use the specified codepage. williamr@2: williamr@2: @return The codepage switched to, or KErrXmlMissingStringDictionary if it is not supported. williamr@2: williamr@2: @param aCodePage The code page to switch to. williamr@2: */ williamr@2: virtual TInt SwitchCodePage(TInt aCodePage) = 0; williamr@2: williamr@2: /** williamr@2: This method obtains the public identifier from the StringTable. williamr@2: Either the formal or non formal public id will do. williamr@2: The stringDictionary .rss files must list both these as wbxml williamr@2: documents have one or the other. williamr@2: williamr@2: @param aPubId The public identifier for this string williamr@2: dictionary. williamr@2: */ williamr@2: williamr@2: virtual void PublicIdentifier(RString& aPubId) = 0; williamr@2: williamr@2: /** williamr@2: The element types in the Device Information DTD are defined within williamr@2: a namespace associated with the Uri/Urn available from the StringTable. williamr@2: The RString need not be closed, but closing is harmless. williamr@2: williamr@2: @param aUri The associated namespace for this string williamr@2: dictionary. williamr@2: */ williamr@2: williamr@2: virtual void NamespaceUri(RString& aUri) = 0; williamr@2: }; williamr@2: williamr@2: } williamr@2: williamr@2: #endif //__STRINGDICTIONARY_H__