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