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

CaretBoxLineoperator * () const
LinearDocumentlinearDocument () const
LineIteratoroperator++ ()
LineIteratoroperator-- ()
bool operator== (const LineIterator &it) const
bool operator!= (const LineIterator &it) const
bool isOutsideEnd ()
bool isOutside () const
void advance (bool toBegin)

Static Public Member Functions

static CaretBoxIteratorcurrentCaretBox ()
static long currentModifiedOffset ()

Protected Member Functions

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

Protected Attributes

LinearDocumentlines
CaretBoxLinecbl

Static Protected Attributes

static CaretBoxIterator currentBox
static long currentOffset

Friends

class CaretBoxIterator
class EditableLineIterator
class EditableCaretBoxIterator
class EditableCharacterIterator
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 497 of file khtml_caret_p.h.


Constructor & Destructor Documentation

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

Default constructor, only for internal use.

Definition at line 511 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 1319 of file khtml_caret.cpp.

References khtml::LinearDocument::baseObject(), khtml::LinearDocument::cblDeleter, and kdDebug().


Member Function Documentation

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

dereferences current caret box line.

Returns:
the caret line box or 0 if end of document

Definition at line 526 of file khtml_caret_p.h.

LinearDocument* khtml::LineIterator::linearDocument  )  const [inline]
 

returns the associated linear document

Definition at line 530 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 536 of file khtml_caret_p.h.

References advance().

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 542 of file khtml_caret_p.h.

References advance().

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 547 of file khtml_caret_p.h.

References cbl, and lines.

Referenced by operator!=().

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

compares two iterators

Definition at line 554 of file khtml_caret_p.h.

References operator==().

bool khtml::LineIterator::isOutsideEnd  )  [inline]
 

Returns whether this line represents the outside end of the containing block.

This result can only be relied on when isOutside is true.

Definition at line 564 of file khtml_caret_p.h.

References khtml::CaretBoxLine::isOutsideEnd().

bool khtml::LineIterator::isOutside  )  const [inline]
 

Tells whether the offset is meant to be outside or inside the containing block.

Definition at line 569 of file khtml_caret_p.h.

References khtml::CaretBoxLine::isOutside().

void khtml::LineIterator::advance bool  toBegin  ) 
 

advances to the line to come.

Parameters:
toBegin true, move to previous line, false, move to next line.

Reimplemented in khtml::EditableLineIterator.

Definition at line 1482 of file khtml_caret.cpp.

References khtml::LinearDocument::cblDeleter, khtml::CaretBoxLine::constructCaretBoxLine(), kdDebug(), nextBlock(), and prevBlock().

Referenced by khtml::EditableLineIterator::advance(), operator++(), and operator--().

static CaretBoxIterator& khtml::LineIterator::currentCaretBox  )  [inline, static]
 

Whenever a new line iterator is created, it gets a caret box created.

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:
an iterator onto the corresponing caret box within the line represented by the last instantiation of a line iterator, or 0 if there was none.

Definition at line 586 of file khtml_caret_p.h.

static long khtml::LineIterator::currentModifiedOffset  )  [inline, static]
 

Whenever a new line iterator is created, it calculates a modified offset that is to be used with respect to the current render object.

This offset can be queried with this function.

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

Returns:
the modified offset.

Definition at line 596 of file khtml_caret_p.h.

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

seeks next block.

Definition at line 1345 of file khtml_caret.cpp.

References khtml::LinearDocument::baseObject(), khtml::LinearDocument::cblDeleter, khtml::CaretBoxLine::constructCaretBoxLine(), and kdDebug().

Referenced by advance().

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

seeks previous block.

Definition at line 1412 of file khtml_caret.cpp.

References khtml::LinearDocument::baseObject(), khtml::LinearDocument::cblDeleter, khtml::CaretBoxLine::constructCaretBoxLine(), and kdDebug().

Referenced by advance().


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.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Jan 15 13:34:55 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003