xmlsrv_plat/xml_parser_api/inc/MXMLContentHandler.h
branchRCL_3
changeset 33 604ca70b6235
parent 32 889504eac4fb
child 40 80a0ad972c63
equal deleted inserted replaced
32:889504eac4fb 33:604ca70b6235
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  * DO NOT USE THIS API. DEPRECATED AND REMOVED IN S60 5.0. USE SYMBIAN XML FRAMEWORK INSTEAD.
       
    26  */
       
    27 
       
    28 
       
    29 
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 
       
    35 
       
    36 
       
    37 
       
    38 #ifndef __MXMLCONTENTHANDLER_H
       
    39 #define __MXMLCONTENTHANDLER_H
       
    40 
       
    41 #warning The XML API will be removed wk25. Please see http://wikis.in.nokia.com/Browser/APIMigration for more information
       
    42 
       
    43 
       
    44 //  INCLUDES
       
    45 #include <xml/MXMLAttributes.h>
       
    46 #include <xml/cxml/cxml_nw2cxmltypes.h>
       
    47 
       
    48 // CLASS DECLARATION
       
    49 
       
    50 /**
       
    51 *  Interface for SAX Parser Callback events.
       
    52 *  If an application (client) needs to be informed of basic parsing events, 
       
    53 *  it implements this interface and registers an instance with the SAX parser using the SetContentHandler() method.
       
    54 *  The parser uses the instance to report basic document-related events like the start and end of elements.
       
    55 *
       
    56 *  @lib XMLInterface.dll
       
    57 *  @since ?Series60_version
       
    58 */
       
    59 class MXMLContentHandler
       
    60 {
       
    61 public:
       
    62 /**
       
    63 * Receive notification of the beginning of a document.
       
    64 * @since ?Series60_version
       
    65 * @param none
       
    66 * @return none
       
    67 */		
       
    68     virtual TInt StartDocument() = 0;
       
    69 
       
    70 /**
       
    71 * Receive notification of the end of a document.
       
    72 * @since ?Series60_version
       
    73 * @param none
       
    74 * @return none
       
    75 */
       
    76 	virtual TInt EndDocument() = 0;
       
    77 
       
    78 /**
       
    79 * Receive notification of the beginning of an element.
       
    80 * @since ?Series60_version
       
    81 * @param aURI: The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace
       
    82 *              processing is not being performed.
       
    83 * @param aLocalName: The local name (without prefix), or the empty string if Namespace processing is not being
       
    84 *                    performed.
       
    85 * @param aName: The qualified name, or the empty string if qualified names are not available.
       
    86 * @param aAttributeList: The attributes attached to the element. If there are no attributes, it shall be an 
       
    87 *                        empty Attributes object. 
       
    88 *        
       
    89 * @return 1 if success 0 if failure.
       
    90 */
       
    91 	inline virtual TInt StartElement(TDesC& /*aURI*/, TDesC& /*aLocalName*/, TDesC& /*aName*/, MXMLAttributes* /*aAttributeList*/){return 1;}
       
    92 
       
    93 /**
       
    94 * Receive notification of the end of an element.
       
    95 * @since ?Series60_version
       
    96 * @param aURI: The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace
       
    97 *              processing is not being performed.
       
    98 * @param aLocalName: The local name (without prefix), or the empty string if Namespace processing is not being
       
    99 *                    performed.
       
   100 * @param aName: The qualified name, or the empty string if qualified names are not available.
       
   101 * @return 1 if success 0 if failure.
       
   102 */
       
   103 	inline virtual TInt EndElement(TDesC& /*aURI*/, TDesC& /*aLocalName*/, TDesC& /*aName*/){return 1;}
       
   104 
       
   105 /**
       
   106 * Receive notification of character data inside an element.
       
   107 * @since ?Series60_version
       
   108 * @param aBuff: The characters.
       
   109 * @param aStart: The start position in the character buffer.
       
   110 * @param aLength: The number of characters to use from the character buffer.
       
   111 * @return 1 if success 0 if failure.
       
   112 */
       
   113 	inline virtual TInt Charecters(TDesC& /*aBuf*/, TInt /*aStart*/, TInt /*aLength*/){return 1;}
       
   114 
       
   115 /**
       
   116 * Receive notification of XML comment.
       
   117 * @since ?Series60_version
       
   118 * @param aComment: Buffer containing the comment.
       
   119 * @return 1 if success 0 if failure.
       
   120 */
       
   121 	inline virtual TInt Comment(TDesC& /*aComment*/){return 1;}
       
   122 
       
   123 /**
       
   124 * Receive notification of a processing instruction
       
   125 * @since ?Series60_version
       
   126 * @param aTarget: The processing instruction target.
       
   127 * @param aData: The processing instruction data, or null if none is supplied.
       
   128 * @return 1 if success 0 if failure.
       
   129 */
       
   130     inline virtual TInt ProcessingInstructions(TDesC& /*aTarget*/, TDesC& /*aData*/){return 1;}
       
   131 
       
   132 /**
       
   133 * Receive notification of ignorable whitespace in element content.
       
   134 * @since ?Series60_version
       
   135 * @param aString: The whitespace characters.
       
   136 * @return 1 if success 0 if failure.
       
   137 */
       
   138 	// R&D: Feature: IgnoreWhiteSpace missing from XMLInterface
       
   139 	inline virtual TInt IgnoreWhiteSpace(TDesC& /*aString*/){return 1;}; 
       
   140 
       
   141 /**
       
   142 * Receive notification of beginning of some internal and external XML entities.
       
   143 * @since ?Series60_version
       
   144 * @param aName: The name of the entity.
       
   145 * @return 1 if success 0 if failure.
       
   146 */
       
   147 
       
   148 	inline virtual TInt StartEntity(TDesC& /*aName*/){return 1;};  
       
   149 
       
   150 /**
       
   151 * Receive notification of end of XML entities.
       
   152 * @since ?Series60_version
       
   153 * @param aName: The name of the entity.
       
   154 * @return 1 if success 0 if failure.
       
   155 */
       
   156 
       
   157 	inline virtual TInt EndEntity(TDesC& /*aName*/){return 1;}  
       
   158 
       
   159 /**
       
   160 * Receive notification of a skipped entity.
       
   161 * @since ?Series60_version
       
   162 * @param aName: The name of the skipped entity.
       
   163 * @return 1 if success 0 if failure.
       
   164 */
       
   165 	// R&D: Feature: SkippedEntity missing from XMLInterface
       
   166 	inline virtual TInt SkippedEntity(TDesC& /*aName*/){return 1;} 
       
   167 
       
   168 /**
       
   169 * Receive notification of beginning of CData section.
       
   170 * @since ?Series60_version
       
   171 * @param none
       
   172 * @return 1 if success 0 if failure.
       
   173 */
       
   174 	inline virtual TInt StartCDATA(){return 1;}
       
   175 
       
   176 /**
       
   177 * Receive notification of end of CData section.
       
   178 * @since ?Series60_version
       
   179 * @param aName: none.
       
   180 * @return 1 if success 0 if failure.
       
   181 */
       
   182 	inline virtual TInt EndCDATA(){return 1;}
       
   183 
       
   184 /**
       
   185 * Receive notification of error situation during parsing.
       
   186 * @since ?Series60_version
       
   187 * @param aErrorCode: Error status code.
       
   188 * @param aSeverity: Error Severity.
       
   189 * @return 1 if success 0 if failure.
       
   190 */
       
   191 	inline virtual TInt Error(TInt /*aErrorCode*/, TInt /*aSeverity*/){return 1;}
       
   192     
       
   193 /**
       
   194 * Returns parsed buffer to client.
       
   195 * @since Series60 3.1
       
   196 * @param aBuf Buffer with parsed data.
       
   197 */
       
   198 	inline virtual void DataBuffer(const TDesC16& /*aBuf*/){return;}
       
   199 
       
   200 /**
       
   201 * Returns reader index
       
   202 * @since Series60 3.1
       
   203 * @param aIndex - reader index
       
   204 */
       
   205 	inline virtual void ReaderIndex(NW_Uint32 /*aIndex*/){return;}
       
   206 
       
   207 
       
   208 };
       
   209 
       
   210 
       
   211 #endif      // __MXMLCONTENTHANDLER_H   
       
   212             
       
   213 // End of File