.TH "DOM::NodeFilter" kde3 "11 Jun 2005" "Version Version 3.4.1" "khtml Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DOM::NodeFilter \- Filters are objects that know how to 'filter out' nodes.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <dom2_traversal.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBAcceptCode\fP { \fBFILTER_ACCEPT\fP =  1, \fBFILTER_REJECT\fP =  2, \fBFILTER_SKIP\fP =  3 }"
.br
.ti -1c
.RI "enum \fBShowCode\fP { \fBSHOW_ALL\fP =  0xFFFFFFFF, \fBSHOW_ELEMENT\fP =  0x00000001, \fBSHOW_ATTRIBUTE\fP =  0x00000002, \fBSHOW_TEXT\fP =  0x00000004, \fBSHOW_CDATA_SECTION\fP =  0x00000008, \fBSHOW_ENTITY_REFERENCE\fP =  0x00000010, \fBSHOW_ENTITY\fP =  0x00000020, \fBSHOW_PROCESSING_INSTRUCTION\fP =  0x00000040, \fBSHOW_COMMENT\fP =  0x00000080, \fBSHOW_DOCUMENT\fP =  0x00000100, \fBSHOW_DOCUMENT_TYPE\fP =  0x00000200, \fBSHOW_DOCUMENT_FRAGMENT\fP =  0x00000400, \fBSHOW_NOTATION\fP =  0x00000800 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBNodeFilter\fP (const \fBNodeFilter\fP &other)"
.br
.ti -1c
.RI "\fBNodeFilter\fP (NodeFilterImpl *i)"
.br
.ti -1c
.RI "virtual \fBNodeFilter\fP & \fBoperator=\fP (const \fBNodeFilter\fP &other)"
.br
.ti -1c
.RI "virtual short \fBacceptNode\fP (const \fBNode\fP &n)"
.br
.ti -1c
.RI "virtual NodeFilterImpl * \fBhandle\fP () const "
.br
.ti -1c
.RI "virtual bool \fBisNull\fP () const "
.br
.ti -1c
.RI "void \fBsetCustomNodeFilter\fP (\fBCustomNodeFilter\fP *custom)"
.br
.ti -1c
.RI "\fBCustomNodeFilter\fP * \fBcustomNodeFilter\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBNodeFilter\fP \fBcreateCustom\fP (\fBCustomNodeFilter\fP *custom)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "NodeFilterImpl * \fBimpl\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBNodeIterator\fP"
.br
.ti -1c
.RI "class \fBNodeIteratorImpl\fP"
.br
.ti -1c
.RI "class \fBTreeWalker\fP"
.br
.ti -1c
.RI "class \fBTreeWalkerImpl\fP"
.br
.ti -1c
.RI "class \fBNodeFilterImpl\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Filters are objects that know how to 'filter out' nodes. 

If an Iterator or \fC\fBTreeWalker\fP\fP is given a filter, before it returns the next node, it applies the filter. If the filter says to accept the node, the Iterator returns it; otherwise, the Iterator looks for the next node and pretends that the node that was rejected was not there.
.PP
The \fBDOM\fP does not provide any filters. Filter is just an interface that users can implement to provide their own filters.
.PP
Filters do not need to know how to iterate, nor do they need to know anything about the data structure that is being iterated. This makes it very easy to write filters, since the only thing they have to know how to do is evaluate a single node. One filter may be used with a number of different kinds of Iterators, encouraging code reuse.
.PP
To create your own custom \fBNodeFilter\fP, define a subclass of \fBCustomNodeFilter\fP which overrides the \fBacceptNode()\fP method and assign an instance of it to the \fBNodeFilter\fP. For more details see the \fBCustomNodeFilter\fP class 
.PP
Definition at line 184 of file dom2_traversal.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBDOM::NodeFilter::AcceptCode\fP"
.PP
The following constants are returned by the \fBacceptNode()\fP method:. 
.PP
Definition at line 204 of file dom2_traversal.h.
.SS "enum \fBDOM::NodeFilter::ShowCode\fP"
.PP
These are the available values for the whatToShow parameter. 
.PP
They are the same as the set of possible types for \fBNode\fP, and their values are derived by using a bit position corresponding to the value of NodeType for the equivalent node type. 
.PP
Definition at line 217 of file dom2_traversal.h.
.SH "Member Function Documentation"
.PP 
.SS "short NodeFilter::acceptNode (const \fBNode\fP & n)\fC [virtual]\fP"
.PP
Test whether a specified node is visible in the logical view of a \fBTreeWalker\fP or \fBNodeIterator\fP. 
.PP
This function will be called by the implementation of \fBTreeWalker\fP and \fBNodeIterator\fP; it is not intended to be called directly from user code.
.PP
\fBParameters:\fP
.RS 4
\fIn\fP The node to check to see if it passes the filter or not.
.RE
.PP
\fBReturns:\fP
.RS 4
a constant to determine whether the node is accepted, rejected, or skipped, as defined \fCabove \fP . 
.RE
.PP

.PP
Definition at line 165 of file dom2_traversal.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for khtml Library from the source code.
