upnp/upnpstack/serviceframework/inc/upnpsoapcontenthandler.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 CUpnpSoapContentHandler class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __UPNPSOAPCONTENTHANDLER_H__
       
    21 #define __UPNPSOAPCONTENTHANDLER_H__
       
    22 
       
    23 #include <e32def.h>
       
    24 #include "upnpcontenthandler.h"
       
    25 #include "upnpdescriptionproperty.h"
       
    26 #include "upnpsoapliterals.h"
       
    27 
       
    28 using namespace Xml;
       
    29 
       
    30 /**
       
    31 *  This class handles xml tree in action (soap) messages (requests/responses)
       
    32 *  It extends CUpnpContentHandler class
       
    33 *  It is designed to be used by upnp controler that delegates to it events from xml sax parser
       
    34 *
       
    35 */
       
    36 NONSHARABLE_CLASS( CUpnpSoapContentHandler ) : public CUpnpContentHandler
       
    37 {
       
    38 public:
       
    39 
       
    40     /**
       
    41     * Two-phased constructor
       
    42     * @return instance of CUpnpSoapContentHandler class
       
    43     */
       
    44     static CUpnpSoapContentHandler* NewL(
       
    45             CUpnpContentHandlersController& aController,
       
    46             RPointerArray<CUpnpDescriptionProperty>& aParsedValues );
       
    47 
       
    48     /**
       
    49     * Two-phased constructor. Leaves the object on CleanupStack
       
    50     * @return instance of CUpnpSoapContentHandler class
       
    51     */
       
    52     static CUpnpSoapContentHandler* NewLC(
       
    53             CUpnpContentHandlersController& aController,
       
    54             RPointerArray<CUpnpDescriptionProperty>& aParsedValues );
       
    55 
       
    56     /**
       
    57     * Destructor of CUpnpSoapContentHandler class
       
    58     *
       
    59     */
       
    60     virtual ~CUpnpSoapContentHandler();
       
    61 
       
    62 public:	// from CUpnpContentHandler
       
    63 
       
    64     /**
       
    65     * This method is a callback to indicate an element has been parsed.
       
    66     * @param				aElement is a handle to the element's details.
       
    67     * @param				aAttributes contains the attributes for the element.
       
    68     */
       
    69     virtual void OnStartElementL( const RTagInfo& aElement,
       
    70                                   const RAttributeArray& aAttributes );
       
    71 
       
    72     /**
       
    73     * This method is a callback to indicate the end of the element has been reached.
       
    74     * @param              aElement is a handle to the element's details.
       
    75     */
       
    76     virtual void OnEndElementL( const RTagInfo& aElement );
       
    77 
       
    78     /**
       
    79     * This method is a callback that sends the content of the element.
       
    80     * @param              aBytes is the raw content data for the element in one chunk
       
    81     */
       
    82     virtual void OnContentL( const TDesC8& aBytes );
       
    83     
       
    84     /**
       
    85     * This method clears iIsInsideEnvelope flag
       
    86     */
       
    87     virtual void ResetState();
       
    88 
       
    89 protected:
       
    90 
       
    91     /**
       
    92     * Default C++ constructor
       
    93     */
       
    94     CUpnpSoapContentHandler( CUpnpContentHandlersController& aController,
       
    95         RPointerArray<CUpnpDescriptionProperty>& aParsedValues );
       
    96 
       
    97     /**
       
    98      * Second phase constructor
       
    99      */
       
   100     void ConstructL();
       
   101 
       
   102 private:
       
   103 
       
   104     RPointerArray<CUpnpDescriptionProperty>& iParsedValues;
       
   105 
       
   106     TBool iIsInsideEnvelope;
       
   107 
       
   108 };
       
   109 
       
   110 #endif //__UPNPSOAPCONTENTHANDLER_H__