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