epoc32/include/xmlengnodelist.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 xmlengnodelist.h
     1 /*
       
     2 * Copyright (c) 2006-2006 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:       Node list inline functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef XMLENGINE_NODELIST_H_INCLUDED
       
    25 #define XMLENGINE_NODELIST_H_INCLUDED
       
    26 
       
    27 #include "xmlengnode.h"
       
    28 #include "xmlengnodelist_impl.h"
       
    29 
       
    30 
       
    31 
       
    32 /**
       
    33  * Template implements list container.
       
    34  *
       
    35  * List may contain different types of nodes.
       
    36  * Node pointer is casted to specify node type when
       
    37  * is returned by Next() method.
       
    38  *
       
    39  * @lib XmlEngineDOM.lib
       
    40  * @since S60 v3.2
       
    41  */
       
    42 template<class T> 
       
    43 class RXmlEngNodeList
       
    44 {
       
    45 public:
       
    46     /**
       
    47      * Get list length.
       
    48      *
       
    49      * @since S60 v3.2
       
    50      * @return Number of nodes in a node list
       
    51      */
       
    52 	inline TInt Count() const;
       
    53 
       
    54     /**
       
    55      * Checks whether next node exists in a node list
       
    56      *
       
    57      * @since S60 v3.2
       
    58      * @return TRUE if next node exists, FALSE otherwise
       
    59      */
       
    60 	inline TBool HasNext() const;
       
    61 
       
    62     /**
       
    63      * Retrieves next node from a node list
       
    64      *
       
    65      * @since S60 v3.2
       
    66      * @return Next node 
       
    67      */
       
    68 	inline T Next();
       
    69 
       
    70     /**
       
    71      * Closes a node list
       
    72      *
       
    73      * @since S60 v3.2
       
    74      */
       
    75 	inline void Close();
       
    76 
       
    77 private:
       
    78     friend class TXmlEngNode;
       
    79     friend class TXmlEngElement;
       
    80 
       
    81     /*
       
    82      * Opens node.
       
    83      *
       
    84      * @since S60 v3.2
       
    85      * @param aHead node pointer to the node from which the searching 
       
    86             of list elements is started
       
    87      * @param aType type of list elements
       
    88      * @param aName name of list elements 
       
    89      * @param aNs namespace of list elements
       
    90      *
       
    91      * @note If aType is NULL, aName and aNs are ignored
       
    92      */
       
    93     void OpenL( 
       
    94 			void* aHead,
       
    95 			TXmlEngNode::TXmlEngDOMNodeType aType,
       
    96 			const TDesC8&	aName = KNullDesC8,
       
    97 			const TDesC8&	aNs = KNullDesC8);
       
    98 
       
    99     /** 
       
   100      * Opens node.
       
   101      *
       
   102      * @since S60 v3.2
       
   103      * @param aHead node pointer to the node from which the searching 
       
   104             of list elements is started
       
   105      * @param aType type of list elements
       
   106      */
       
   107     void Open( 
       
   108 			void* aHead,
       
   109 			TXmlEngNode::TXmlEngDOMNodeType aType);
       
   110 
       
   111     /** List with nodes */
       
   112 	RXmlEngNodeListImpl iList;
       
   113 };
       
   114 
       
   115 /**
       
   116  * Template implements list container for nodes.
       
   117  *
       
   118  * Specialization for trivial case: list of TXmlEngNode objects
       
   119  * No "thin wrapper" pattern needed, operate directly on NodeListImpl
       
   120  *
       
   121  * @lib XmlEngineDOM.lib
       
   122  * @since S60 v3.1
       
   123  */
       
   124 template<>
       
   125 class RXmlEngNodeList<TXmlEngNode>: public RXmlEngNodeListImpl {};
       
   126 
       
   127 
       
   128 
       
   129 #include "xmlengnodelist.inl"
       
   130 
       
   131 #endif /* XMLENGINE_NODELIST_H_INCLUDED */