khtml Library API Documentation

dom2_traversalimpl.h

00001 /*
00002  * This file is part of the DOM implementation for KDE.
00003  *
00004  * (C) 1999 Lars Knoll (knoll@kde.org)
00005  * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
00006  * (C) 2001 Peter Kelly (pmk@post.com)
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Library General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Library General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Library General Public License
00019  * along with this library; see the file COPYING.LIB.  If not, write to
00020  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  * Boston, MA 02111-1307, USA.
00022  *
00023  * $Id: dom2_traversalimpl.h,v 1.6 2002/04/11 08:56:40 knoll Exp $
00024  */
00025 
00026 #ifndef _DOM2_TraversalImpl_h_
00027 #define _DOM2_TraversalImpl_h_
00028 
00029 #include "dom/dom_node.h"
00030 #include "dom/dom_misc.h"
00031 #include "misc/shared.h"
00032 #include "dom/dom2_traversal.h"
00033 
00034 namespace DOM {
00035 
00036 class NodeImpl;
00037 class DocumentImpl;
00038 
00039 class NodeIteratorImpl : public khtml::Shared<NodeIteratorImpl>
00040 {
00041 public:
00042     NodeIteratorImpl(NodeImpl *_root, unsigned long _whatToShow, NodeFilter _filter, bool _entityReferenceExpansion);
00043     ~NodeIteratorImpl();
00044 
00045 
00046     NodeImpl *root();
00047     unsigned long whatToShow();
00048     NodeFilter filter();
00049     bool expandEntityReferences();
00050 
00051     NodeImpl *nextNode(int &exceptioncode);
00052     NodeImpl *previousNode(int &exceptioncode);
00053     void detach(int &exceptioncode);
00054 
00055 
00056 
00057 
00063     void notifyBeforeNodeRemoval(NodeImpl *removed);
00064 
00065     short isAccepted(NodeImpl *n);
00066     NodeImpl *getNextNode(NodeImpl *n);
00067     NodeImpl *getPreviousNode(NodeImpl *n);
00068 protected:
00069     NodeImpl *m_root;
00070     long m_whatToShow;
00071     NodeFilter m_filter;
00072     bool m_expandEntityReferences;
00073 
00074     bool m_inFront;
00075     NodeImpl *m_referenceNode;
00076     bool m_detached;
00077     DocumentImpl *m_doc;
00078 };
00079 
00080 class NodeFilterImpl : public khtml::Shared<NodeFilterImpl>
00081 {
00082 public:
00083     NodeFilterImpl();
00084     ~NodeFilterImpl();
00085 
00086     short acceptNode(const Node &n);
00087 
00088     void setCustomNodeFilter(CustomNodeFilter *custom);
00089     CustomNodeFilter *customNodeFilter();
00090 protected:
00091     CustomNodeFilter *m_customNodeFilter;
00092 
00093 };
00094 
00095 class TreeWalkerImpl : public khtml::Shared<TreeWalkerImpl>
00096 {
00097 public:
00098     TreeWalkerImpl();
00099     TreeWalkerImpl(const TreeWalkerImpl &other);
00100     TreeWalkerImpl(Node n, NodeFilter *f=0);
00101     TreeWalkerImpl(Node n, long _whatToShow, NodeFilter *f=0);
00102     TreeWalkerImpl & operator = (const TreeWalkerImpl &other);
00103 
00104 
00105     ~TreeWalkerImpl();
00106 
00107     Node getRoot();
00108 
00109     unsigned long getWhatToShow();
00110 
00111     NodeFilter getFilter();
00112 
00113     bool getExpandEntityReferences();
00114 
00115     Node getCurrentNode();
00116 
00117     void setCurrentNode(const Node _currentNode);
00118 
00119     Node parentNode();
00120 
00121     Node firstChild();
00122 
00123     Node lastChild ();
00124 
00125     Node previousSibling ();
00126 
00127     Node nextSibling();
00128 
00129     Node previousNode();
00130 
00131     Node nextNode();
00132 
00133 
00137     void setWhatToShow(long _whatToShow);
00138     void setFilter(NodeFilter *_filter);
00139     void setExpandEntityReferences(bool value);
00140 
00141     Node getParentNode(Node n);
00142     Node getFirstChild(Node n);
00143     Node getLastChild(Node n);
00144     Node getPreviousSibling(Node n);
00145     Node getNextSibling(Node n);
00146 
00147     short isAccepted(Node n);
00148 
00149 protected:
00155     long m_whatToShow;
00156 
00161     NodeFilter *m_filter;
00162 
00176     bool m_expandEntityReferences;
00177 
00188     Node m_currentNode;
00189 
00190     Node m_rootNode;
00191 };
00192 
00193 
00194 }; // namespace
00195 
00196 #endif
00197 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:35 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001