upnp/upnpstack/serviceframework/inc/upnpscpdcontenthandler.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2007 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:  Declares the CUpnpScpdContentHandler class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UPNPSCPDCONTENTHANDLER_H__
       
    20 #define __UPNPSCPDCONTENTHANDLER_H__
       
    21 
       
    22 #include <babitflags.h>
       
    23 #include "upnpcontenthandler.h"
       
    24 
       
    25 class CUpnpService;
       
    26 
       
    27 using namespace Xml;
       
    28 
       
    29 /**
       
    30  *  This class handles xml service scpd subtree descriptions.
       
    31  *  It extends CUpnpContentHandler class, thus it is subsequent implementation of MContentHandler interface
       
    32  *  It is designed to be used by upnp controler that delegates to it events from xml sax parser   
       
    33  *
       
    34  *  @since Series60 3.2
       
    35  */
       
    36 NONSHARABLE_CLASS( CUpnpScpdContentHandler ) : public CUpnpContentHandler
       
    37     {
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Two-phased constructor
       
    42      * @since Series60 3.2 
       
    43      * @return instance of CUpnpScpdContentHandler class
       
    44      */
       
    45     static CUpnpScpdContentHandler* NewL(
       
    46             CUpnpContentHandlersController& aController, 
       
    47             CUpnpService& aResultService );
       
    48 
       
    49     /**
       
    50      * Two-phased constructor. Leaves the object on CleanupStack
       
    51      * @since Series60 3.2 
       
    52      * @return instance of CUpnpScpdContentHandler class
       
    53      */
       
    54     static CUpnpScpdContentHandler* NewLC(
       
    55             CUpnpContentHandlersController& aController, 
       
    56             CUpnpService& aResultService );
       
    57 
       
    58     /**
       
    59      * Destructor of CUpnpScpdContentHandler class
       
    60      * @since Series60 3.2     
       
    61      */
       
    62     virtual ~CUpnpScpdContentHandler();
       
    63 
       
    64 public: // from MContentHandler
       
    65 
       
    66     /**
       
    67      * This method is a callback to indicate an element has been parsed.
       
    68      * @param				aElement is a handle to the element's details.
       
    69      * @param				aAttributes contains the attributes for the element.
       
    70      */
       
    71     virtual void OnStartElementL( const RTagInfo& aElement, 
       
    72         const RAttributeArray& aAttributes );
       
    73 
       
    74     /**
       
    75      * This method is a callback to indicate the end of the element has been reached.
       
    76      * @param              aElement is a handle to the element's details.
       
    77      */
       
    78     virtual void OnEndElementL( const RTagInfo& aElement );
       
    79 
       
    80     /**
       
    81      * This method is a callback that sends the content of the element.
       
    82      * @param              aBytes is the raw content data for the element in one chunk
       
    83      */
       
    84     virtual void OnContentL( const TDesC8& aBytes );
       
    85 
       
    86 protected:
       
    87 
       
    88     /**
       
    89      * Default C++ constructor 
       
    90      * @since Series60 3.2     
       
    91      */
       
    92     CUpnpScpdContentHandler( CUpnpContentHandlersController& aController, 
       
    93         CUpnpService& aResultService );
       
    94 
       
    95 private:
       
    96     CUpnpService& iResultService;
       
    97     TBitFlags8 iFoundTags;
       
    98     };
       
    99 
       
   100 #endif //__UPNPSCPDCONTENTHANDLER_H__