upnp/upnpstack/serviceframework/inc/upnpservicestatetablecontenthandler.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 CUpnpServiceStateTableContentHandler class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UPNPSERVICESTATETABLECONTENTHANDLER_H__
       
    20 #define __UPNPSERVICESTATETABLECONTENTHANDLER_H__
       
    21 
       
    22 #include "upnpcontenthandler.h"
       
    23 
       
    24 class CUpnpService;
       
    25 class CUpnpStateVariable;
       
    26 
       
    27 using namespace Xml;
       
    28 
       
    29 /**
       
    30  *  This class handles service state table subtree of service descriptions
       
    31  *  It extends CUpnpContentHandler class, thus it is subsequent implementation of 
       
    32  *  MContentHandler interface.
       
    33  *  It is designed to be used by upnp controler that delegates to it events from 
       
    34  *  xml sax parser   
       
    35  *
       
    36  *  @since Series60 2.6
       
    37  */
       
    38 NONSHARABLE_CLASS(CUpnpServiceStateTableContentHandler) : 
       
    39     public CUpnpContentHandler
       
    40     {
       
    41 public:
       
    42 
       
    43     /**
       
    44      * Two-phased constructor
       
    45      * @since Series60 3.2 
       
    46      * @return instance of CUpnpServiceStateTableContentHandler class
       
    47      */
       
    48     static CUpnpServiceStateTableContentHandler* NewL(
       
    49             CUpnpContentHandlersController& aController, 
       
    50             CUpnpService& aResultService );
       
    51 
       
    52     /**
       
    53      * Two-phased constructor. Leaves the object on CleanupStack
       
    54      * @since Series60 3.2 
       
    55      * @return instance of CUpnpServiceStateTableContentHandler class
       
    56      */
       
    57     static CUpnpServiceStateTableContentHandler* NewLC(
       
    58             CUpnpContentHandlersController& aController, 
       
    59             CUpnpService& aResultService );
       
    60 
       
    61     /**
       
    62      * Destructor of CUpnpServiceStateTableContentHandler class
       
    63      * @since Series60 3.2     
       
    64      */
       
    65     virtual ~CUpnpServiceStateTableContentHandler();
       
    66 
       
    67 public: // from MContentHandler
       
    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      * @since Series60 3.2     
       
    94      */
       
    95     CUpnpServiceStateTableContentHandler( CUpnpContentHandlersController& aController,
       
    96             CUpnpService& aResultService );
       
    97 
       
    98     /**
       
    99      * Parse attributes, and set correct eventable values to aResultStateVariable.
       
   100      * @param aResultStateVariable result to change eventable values in
       
   101      * @param aAttributes attributes we analyze
       
   102      */
       
   103     void ParseAttributesL( CUpnpStateVariable& aResultStateVariable,
       
   104             const RAttributeArray& aAttributes );
       
   105 
       
   106 private:
       
   107     CUpnpService& iResultService;
       
   108     TBool iStateVariableFound;
       
   109 
       
   110     };
       
   111 
       
   112 #endif //__UPNPSERVICESTATETABLECONTENTHANDLER_H__