ncdengine/provider/protocol/inc/ncdunknownparser.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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 "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:   CNcdUnknownParser declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ncdsubparser.h"
       
    20 
       
    21 /**
       
    22  * Unkown data parser. It is used to skip over unknown xml elements.
       
    23  * All data to the corresponding end tag is skipped.
       
    24  */
       
    25 class CNcdUnknownParser : public CNcdSubParser
       
    26     {
       
    27 public:
       
    28     static CNcdUnknownParser* NewL( MNcdParserObserverBundle& aObservers, 
       
    29                                     MNcdSubParserObserver& aSubParserObserver,
       
    30                                     TInt aDepth,
       
    31                                     const Xml::RTagInfo& aElement, 
       
    32                                     const Xml::RAttributeArray& aAttributes );
       
    33     virtual ~CNcdUnknownParser();
       
    34 private:
       
    35     CNcdUnknownParser( MNcdParserObserverBundle& aObservers, 
       
    36                        MNcdSubParserObserver& aSubParserObserver,
       
    37                        TInt aDepth );
       
    38     void ConstructL( const Xml::RTagInfo& aElement, 
       
    39                      const Xml::RAttributeArray& aAttributes );
       
    40 protected:
       
    41     virtual void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, 
       
    42                                  TInt aErrorCode) ;
       
    43     virtual void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode );
       
    44     virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode) ;
       
    45 
       
    46 private:
       
    47     /**
       
    48      * The initial depth is required to check whether received end tag is
       
    49      * actually the closing tag for this parser.
       
    50      */
       
    51     TInt iInitialDepth;
       
    52     };