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