khtml Library API Documentation

khtml::EditableCharacterIterator Class Reference

Provides iterating through the document in terms of characters. More...

#include <khtml_caret_p.h>

List of all members.

Public Member Functions

 EditableCharacterIterator ()
 EditableCharacterIterator (LinearDocument *ld)
int chr () const
QChar operator * () const
long offset () const
DOM::NodeImpl * node () const
InlineBox * box () const
EditableCharacterIteratoroperator++ ()
EditableCharacterIteratoroperator-- ()

Protected Member Functions

void initFirstChar ()
void peekNext ()
void peekPrev ()

Protected Attributes

LinearDocumentld
EditableLineIterator _it
EditableInlineBoxIterator ebit
DOM::NodeImpl * _node
long _offset
int _char


Detailed Description

Provides iterating through the document in terms of characters.

Only the editable characters are regarded.

This iterator represents the document, which is structured as a tree itself, as a linear stream of characters.

Definition at line 779 of file khtml_caret_p.h.


Constructor & Destructor Documentation

khtml::EditableCharacterIterator::EditableCharacterIterator  )  [inline]
 

empty constructor.

Only use if you want to assign another constructor as no fields will be initialized.

Definition at line 795 of file khtml_caret_p.h.

khtml::EditableCharacterIterator::EditableCharacterIterator LinearDocument ld  )  [inline]
 

constructs a new iterator from the given linear document.

Parameters:
ld linear representation of document.

Definition at line 801 of file khtml_caret_p.h.

References khtml::LineIterator::currentInlineBox(), khtml::LinearDocument::end(), initFirstChar(), kdDebug(), khtml::LinearDocument::node, and khtml::LinearDocument::offset.


Member Function Documentation

int khtml::EditableCharacterIterator::chr  )  const [inline]
 

returns the current character, or -1 if not on a text node, or beyond the end.

Definition at line 849 of file khtml_caret_p.h.

QChar khtml::EditableCharacterIterator::operator *  )  const [inline]
 

returns the current character as a unicode symbol, substituting a blank for a non-text node.

Definition at line 854 of file khtml_caret_p.h.

Referenced by operator--().

long khtml::EditableCharacterIterator::offset  )  const [inline]
 

returns the current offset

Definition at line 858 of file khtml_caret_p.h.

DOM::NodeImpl* khtml::EditableCharacterIterator::node  )  const [inline]
 

returns the current node.

If it's 0, then there are no more nodes.

Definition at line 863 of file khtml_caret_p.h.

InlineBox* khtml::EditableCharacterIterator::box  )  const [inline]
 

returns the current inline box.

May be 0 if the current element has none, or if the end has been reached. Therefore, do *not* use this to test for the end condition, use node() instead.

Definition at line 870 of file khtml_caret_p.h.

EditableCharacterIterator & khtml::EditableCharacterIterator::operator++  ) 
 

moves to the next editable character.

_peekNext

Definition at line 800 of file khtml_caret.cpp.

Referenced by operator--().

EditableCharacterIterator & khtml::EditableCharacterIterator::operator--  ) 
 

moves to the previous editable character.

Definition at line 886 of file khtml_caret.cpp.

References operator *(), and operator++().

void khtml::EditableCharacterIterator::initFirstChar  )  [protected]
 

initializes the _char member by reading the character at the current offset, peeking ahead as necessary.

Definition at line 787 of file khtml_caret.cpp.

Referenced by EditableCharacterIterator().

void khtml::EditableCharacterIterator::peekNext  )  [inline, protected]
 

reads ahead the next node and updates the data structures accordingly

Definition at line 886 of file khtml_caret_p.h.

void khtml::EditableCharacterIterator::peekPrev  )  [inline, protected]
 

reads ahead the previous node and updates the data structures accordingly

Definition at line 898 of file khtml_caret_p.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:45:10 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003