khtml Library API Documentation

khtml::LineIterator Class Reference

Iterates through the lines of a document. More...

#include <khtml_caret_p.h>

Inheritance diagram for khtml::LineIterator:

khtml::EditableLineIterator khtml::ErgonomicEditableLineIterator List of all members.

Public Member Functions

InlineFlowBox * operator * () const
LineIteratoroperator++ ()
LineIterator operator++ (int)
LineIteratoroperator-- ()
LineIterator operator-- (int)
LineIterator operator+ (int summand) const
LineIterator operator- (int summand) const
LineIteratoroperator+= (int summand)
LineIteratoroperator-= (int summand)
bool operator== (const LineIterator &it) const
bool operator!= (const LineIterator &it) const

Static Public Member Functions

InlineBox * currentInlineBox ()

Protected Member Functions

 LineIterator ()
 LineIterator (LinearDocument *l, DOM::NodeImpl *node, long offset)
void nextBlock ()
void prevBlock ()

Protected Attributes

LinearDocumentlines
RenderFlow * cb
InlineFlowBox * flowBox

Static Protected Attributes

InlineBox * currentBox

Friends

class InlineBoxIterator
class EditableInlineBoxIterator
class LinearDocument

Detailed Description

Iterates through the lines of a document.

The line iterator becomes invalid when the associated LinearDocument object is destroyed.

Since:
3.2

Definition at line 85 of file khtml_caret_p.h.


Constructor & Destructor Documentation

khtml::LineIterator::LineIterator  )  [inline, protected]
 

Default constructor, only for internal use.

Definition at line 99 of file khtml_caret_p.h.

khtml::LineIterator::LineIterator LinearDocument l,
DOM::NodeImpl *  node,
long  offset
[protected]
 

Initializes a new iterator.

Note: This constructor neither cares about the correctness of node nor about offset. It is the responsibility of the caller to ensure that both point to valid places.

Definition at line 609 of file khtml_caret.cpp.


Member Function Documentation

InlineFlowBox* khtml::LineIterator::operator *  )  const [inline]
 

dereferences current line.

Note: The returned inline flow box may be empty. This does not indicate the end of the document, but merely that the current paragraph does not contain any lines.

Definition at line 117 of file khtml_caret_p.h.

LineIterator & khtml::LineIterator::operator++  )  [inline]
 

seek next line

Guaranteed to crash if beyond beginning/end of document.

Reimplemented in khtml::EditableLineIterator, and khtml::ErgonomicEditableLineIterator.

Definition at line 674 of file khtml_caret.cpp.

LineIterator khtml::LineIterator::operator++ int   )  [inline]
 

seek next line.

Guaranteed to crash if beyond beginning/end of document.

Note: The postfix operator is slow. Use the prefix operator whenever possible.

Definition at line 685 of file khtml_caret.cpp.

LineIterator & khtml::LineIterator::operator--  )  [inline]
 

seek previous line.

Guaranteed to crash if beyond beginning/end of document.

Reimplemented in khtml::EditableLineIterator, and khtml::ErgonomicEditableLineIterator.

Definition at line 735 of file khtml_caret.cpp.

LineIterator khtml::LineIterator::operator-- int   )  [inline]
 

seek previous line.

Guaranteed to crash if beyond beginning/end of document.

Note: The postfix operator is slow. Use the prefix operator whenever possible.

Definition at line 746 of file khtml_caret.cpp.

LineIterator khtml::LineIterator::operator+ int  summand  )  const
 

does pointer arithmetic.

This function is O(1) for values of +/-1, O(n) otherwise.

Parameters:
summand add these many lines

LineIterator khtml::LineIterator::operator- int  summand  )  const
 

does pointer arithmetic.

This function is O(1) for values of +/-1, O(n) otherwise.

Parameters:
summand add these many lines

LineIterator & khtml::LineIterator::operator+= int  summand  ) 
 

does pointer arithmetic and assignment.

This function is O(1) for values of +/-1, O(n) otherwise.

Parameters:
summand add these many lines

Definition at line 767 of file khtml_caret.cpp.

LineIterator & khtml::LineIterator::operator-= int  summand  ) 
 

does pointer arithmetic and assignment.

This function is O(1) for values of +/-1, O(n) otherwise.

Parameters:
summand add these many lines

Definition at line 776 of file khtml_caret.cpp.

References kdDebug().

bool khtml::LineIterator::operator== const LineIterator it  )  const [inline]
 

compares two iterators.

The comparator actually works only for comparing arbitrary iterators to begin() and end().

Definition at line 176 of file khtml_caret_p.h.

References cb, flowBox, and lines.

Referenced by operator!=().

bool khtml::LineIterator::operator!= const LineIterator it  )  const [inline]
 

compares two iterators

Definition at line 184 of file khtml_caret_p.h.

References operator==().

InlineBox* khtml::LineIterator::currentInlineBox  )  [inline, static]
 

Whenever a new line iterator is created, it gets the inline box it points to.

For memory reasons, it's saved in a static instance, thus making this function not thread-safe.

This value can only be trusted immediately after having instantiated a line iterator or one of its derivatives.

Returns:
the corresponing inline box within the line represented by the last instantiation of a line iterator, or 0 if there was none.

Definition at line 198 of file khtml_caret_p.h.

Referenced by khtml::EditableCharacterIterator::EditableCharacterIterator().

void khtml::LineIterator::nextBlock  )  [protected]
 

seeks next block.

Definition at line 622 of file khtml_caret.cpp.

void khtml::LineIterator::prevBlock  )  [protected]
 

seeks previous block.

Definition at line 692 of file khtml_caret.cpp.

References kdDebug().


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 May 5 07:22:23 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003