• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KHTML

DOM::CustomNodeFilter

DOM::CustomNodeFilter Class Reference

CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers. More...

#include <dom2_traversal.h>

Inheritance diagram for DOM::CustomNodeFilter:
DOM::DomShared

List of all members.

Public Member Functions

virtual short acceptNode (const Node &n)
 CustomNodeFilter ()
virtual DOMString customNodeFilterType ()
virtual bool isNull ()
virtual ~CustomNodeFilter ()

Protected Attributes

CustomNodeFilterImpl * impl

Detailed Description

CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers.

You can create a custom filter by doing the following:

class MyCustomNodeFilter { ..... virtual short acceptNode (const Node &n); ..... }

Then in your program:

short MyCustomNodeFilter::acceptNode (const Node &n) { if (condition) return NodeFilter::FILTER_ACCEPT; else .... }

MyCustomFilter *filter = new MyCustomFilter(); NodeFilter nf = NodeFilter::createCustom(filter); NodeIterator ni = document.createNodeIterator(document,NodeFilter.SHOW_ALL,nf,false);

The default implementation of acceptNode() returns NodeFilter::FILTER_ACCEPT for all nodes.

Definition at line 294 of file dom2_traversal.h.


Constructor & Destructor Documentation

CustomNodeFilter::CustomNodeFilter (  ) 

Definition at line 205 of file dom2_traversal.cpp.

CustomNodeFilter::~CustomNodeFilter (  )  [virtual]

Definition at line 210 of file dom2_traversal.cpp.


Member Function Documentation

short CustomNodeFilter::acceptNode ( const Node &  n  )  [virtual]

Definition at line 214 of file dom2_traversal.cpp.

DOMString CustomNodeFilter::customNodeFilterType (  )  [virtual]

For internal use only.

not part of the DOMReturns a name specifying the type of custom node filter. Useful for checking if an custom node filter is of a particular sublass.

Definition at line 224 of file dom2_traversal.cpp.

bool CustomNodeFilter::isNull (  )  [virtual]

Definition at line 219 of file dom2_traversal.cpp.


Member Data Documentation

CustomNodeFilterImpl* DOM::CustomNodeFilter::impl [protected]

For internal use only.

Reserved. Do not use in your subclasses.

Definition at line 316 of file dom2_traversal.h.


The documentation for this class was generated from the following files:
  • dom2_traversal.h
  • dom2_traversal.cpp

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal