<HTML> <HEAD> <TITLE>class CustomNodeFilter</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>class CustomNodeFilter</h1> </TD> <TD valign="top" align="right" colspan="1"> CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers. <small><A HREF="#longdesc">More...</A></small></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> <TR><TH>Full name</TH><TD><code><A HREF="DOM.html">DOM</A>::CustomNodeFilter</code></TD></TR> <TR><TH>Definition</TH><TD><code>#include <<A HREF="dom2__traversal_h.html">dom2_traversal.h</A>></code></TD></TR> <TR><TH>Inherits</TH><TD><A HREF="DOM__DomShared.html">DOM::DomShared</A> <small>[public ]</small></TD></TR> <TR><TH><A HREF="full-list-DOM__CustomNodeFilter.html">List of all Methods</A></TH></TR> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <h4>Public Methods</h4><ul><LI> <b><A HREF="#ref1">CustomNodeFilter</A></b> () </LI> <LI>virtual <b><A HREF="#ref2">~CustomNodeFilter</A></b> () </LI> <LI>virtual short <b><A HREF="#ref3">acceptNode</A></b> (const Node &n) </LI> <LI>virtual bool <b><A HREF="#ref4">isNull</A></b> () </LI> <LI>virtual DOMString <b><A HREF="#ref5">customNodeFilterType</A></b> () </LI> </ul><h4>Protected Members</h4><ul><LI>CustomNodeFilterImpl *<b><A HREF="#ref6">impl</A></b></LI> </ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p> CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers. You can create a custom filter by doing the follwing: </p> <p> class MyCustomNodeFilter { ..... virtual short acceptNode (const Node &n); ..... } </p> <p> Then in your program: </p> <p> short MyCustomNodeFilter::acceptNode (const Node &n) { if (condition) return NodeFilter::FILTER_ACCEPT; else .... } </p> <p></p> <p> MyCustomFilter *filter = new MyCustomFilter(); NodeFilter nf = NodeFilter::createCutsom(filter); NodeIterator ni = document.createNodeIterator(document,NodeFilter.SHOW_ALL,nf,false); </p> <p> The default implementation of acceptNode() returns NodeFilter::FILTER_ACCEPT for all nodes. </p> <p> </p> <A NAME="CustomNodeFilter"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>CustomNodeFilter</strong> () <br></td><td align="right"><h3><strong>CustomNodeFilter</strong></h3></td></tr></table><p></p><A NAME="~CustomNodeFilter"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~CustomNodeFilter</strong> () <br></td><td align="right"><h3><strong>~CustomNodeFilter</strong></h3></td></tr></table><p> <small>[virtual]</small></p><A NAME="acceptNode"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> short <strong>acceptNode</strong> (const Node &n) <br></td><td align="right"><h3><strong>acceptNode</strong></h3></td></tr></table><p> <small>[virtual]</small></p><A NAME="isNull"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>isNull</strong> () <br></td><td align="right"><h3><strong>isNull</strong></h3></td></tr></table><p> <small>[virtual]</small></p><A NAME="customNodeFilterType"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td> DOMString <strong>customNodeFilterType</strong> () <br></td><td align="right"><h3><strong>customNodeFilterType</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> not part of the DOM </p> <p> Returns a name specifying the type of custom node filter. Useful for checking if an custom node filter is of a particular sublass. </p> <p> </p> <A NAME="impl"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>CustomNodeFilterImpl * <strong>impl</strong> </td><td align="right"><h3><strong>impl</strong></h3></td></tr></table><p> <small>[protected]</small></p><HR> <table> <tr><td><small>Generated by: qateam on updates.mandrakesoft.com on Mon Dec 30 16:09:31 2002, using kdoc 2.0a53.</small></td></tr> </table> </BODY> </HTML>