epoc32/include/xml/dom/xmlengnodelist.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/xml/dom/xmlengnodelist.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,131 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:       Node list inline functions
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +#ifndef XMLENGINE_NODELIST_H_INCLUDED
    1.28 +#define XMLENGINE_NODELIST_H_INCLUDED
    1.29 +
    1.30 +#include "xmlengnode.h"
    1.31 +#include "xmlengnodelist_impl.h"
    1.32 +
    1.33 +
    1.34 +
    1.35 +/**
    1.36 + * Template implements list container.
    1.37 + *
    1.38 + * List may contain different types of nodes.
    1.39 + * Node pointer is casted to specify node type when
    1.40 + * is returned by Next() method.
    1.41 + *
    1.42 + * @lib XmlEngineDOM.lib
    1.43 + * @since S60 v3.2
    1.44 + */
    1.45 +template<class T> 
    1.46 +class RXmlEngNodeList
    1.47 +{
    1.48 +public:
    1.49 +    /**
    1.50 +     * Get list length.
    1.51 +     *
    1.52 +     * @since S60 v3.2
    1.53 +     * @return Number of nodes in a node list
    1.54 +     */
    1.55 +	inline TInt Count() const;
    1.56 +
    1.57 +    /**
    1.58 +     * Checks whether next node exists in a node list
    1.59 +     *
    1.60 +     * @since S60 v3.2
    1.61 +     * @return TRUE if next node exists, FALSE otherwise
    1.62 +     */
    1.63 +	inline TBool HasNext() const;
    1.64 +
    1.65 +    /**
    1.66 +     * Retrieves next node from a node list
    1.67 +     *
    1.68 +     * @since S60 v3.2
    1.69 +     * @return Next node 
    1.70 +     */
    1.71 +	inline T Next();
    1.72 +
    1.73 +    /**
    1.74 +     * Closes a node list
    1.75 +     *
    1.76 +     * @since S60 v3.2
    1.77 +     */
    1.78 +	inline void Close();
    1.79 +
    1.80 +private:
    1.81 +    friend class TXmlEngNode;
    1.82 +    friend class TXmlEngElement;
    1.83 +
    1.84 +    /*
    1.85 +     * Opens node.
    1.86 +     *
    1.87 +     * @since S60 v3.2
    1.88 +     * @param aHead node pointer to the node from which the searching 
    1.89 +            of list elements is started
    1.90 +     * @param aType type of list elements
    1.91 +     * @param aName name of list elements 
    1.92 +     * @param aNs namespace of list elements
    1.93 +     *
    1.94 +     * @note If aType is NULL, aName and aNs are ignored
    1.95 +     */
    1.96 +    void OpenL( 
    1.97 +			void* aHead,
    1.98 +			TXmlEngNode::TXmlEngDOMNodeType aType,
    1.99 +			const TDesC8&	aName = KNullDesC8,
   1.100 +			const TDesC8&	aNs = KNullDesC8);
   1.101 +
   1.102 +    /** 
   1.103 +     * Opens node.
   1.104 +     *
   1.105 +     * @since S60 v3.2
   1.106 +     * @param aHead node pointer to the node from which the searching 
   1.107 +            of list elements is started
   1.108 +     * @param aType type of list elements
   1.109 +     */
   1.110 +    void Open( 
   1.111 +			void* aHead,
   1.112 +			TXmlEngNode::TXmlEngDOMNodeType aType);
   1.113 +
   1.114 +    /** List with nodes */
   1.115 +	RXmlEngNodeListImpl iList;
   1.116 +};
   1.117 +
   1.118 +/**
   1.119 + * Template implements list container for nodes.
   1.120 + *
   1.121 + * Specialization for trivial case: list of TXmlEngNode objects
   1.122 + * No "thin wrapper" pattern needed, operate directly on NodeListImpl
   1.123 + *
   1.124 + * @lib XmlEngineDOM.lib
   1.125 + * @since S60 v3.1
   1.126 + */
   1.127 +template<>
   1.128 +class RXmlEngNodeList<TXmlEngNode>: public RXmlEngNodeListImpl {};
   1.129 +
   1.130 +
   1.131 +
   1.132 +#include "xmlengnodelist.inl"
   1.133 +
   1.134 +#endif /* XMLENGINE_NODELIST_H_INCLUDED */