khtml Library API Documentation

khtml::CaretBoxLine Class Reference

Resembles a line consisting of caret boxes. More...

#include <khtml_caret_p.h>

List of all members.

Public Member Functions

CaretBoxIterator begin ()
CaretBoxIterator end ()
CaretBoxIterator preBegin ()
CaretBoxIterator preEnd ()
InlineFlowBox * baseFlowBox () const
RenderBlock * containingBlock () const
RenderBox * enclosingObject () const
bool isOutside () const
bool isOutsideEnd () const

Static Public Member Functions

static CaretBoxLineconstructCaretBoxLine (MassDeleter< CaretBoxLine > *deleter, InlineFlowBox *baseFlowBox, InlineBox *seekBox, bool seekOutside, bool seekOutsideEnd, CaretBoxIterator &iter, RenderObject *seekObject=0)
static CaretBoxLineconstructCaretBoxLine (MassDeleter< CaretBoxLine > *deleter, RenderBox *cb, bool outside, bool outsideEnd, CaretBoxIterator &iter)

Protected Member Functions

 CaretBoxLine (InlineFlowBox *basefb)
void addConvertedInlineBox (InlineBox *, SeekBoxParams &)
void addCreatedInlineBoxEdge (InlineBox *box, const QFontMetrics &fm, bool left, bool rtl)
void addCreatedFlowBoxEdge (InlineFlowBox *flowBox, const QFontMetrics &fm, bool left, bool rtl)
void addCreatedFlowBoxInside (InlineFlowBox *flowBox, const QFontMetrics &fm)

Protected Attributes

CaretBoxDeleter caret_boxes
InlineFlowBox * basefb

Friends

class CaretBoxIterator

Classes

struct  SeekBoxParams
 contains the seek parameters More...


Detailed Description

Resembles a line consisting of caret boxes.

To the contrary of InlineFlowBoxes which are nested as needed to map the DOM to the rendered representation, it is sufficient for caret navigation to provide a linear list of unnested caret boxes.

Example: The document fragment

a c f g will be represented by three caret box lines which each one consists of caret boxes as follows: CaretBoxLine 1: CaretBox(cb=

, _box=0, _outside=true, outside_end=false) CaretBoxLine 2: CaretBox(cb=

, _box=InlineTextBox("a "), _outside=false) CaretBox(cb=

, _box=InlineFlowBox(), _outside=true, outside_end=false) CaretBox(cb=

, _box=InlineFlowBox(), _outside=true, outside_end=false) CaretBox(cb=

, _box=InlineTextBox("c"), _outside=false) CaretBox(cb=

, _box=InlineFlowBox(), _outside=true, outside_end=true) CaretBox(cb=

, _box=InlineTextBox(" f"), _outside=false) CaretBox(cb=

, _box=InlineFlowBox(), _outside=true, outside_end=true) CaretBox(cb=

, _box=InlineTextBox(" g"), _outside=true, outside_end=true) CaretBoxLine 3: CaretBox(cb=

, _box=0, _outside=true, outside_end=true)

Definition at line 299 of file khtml_caret_p.h.


Member Function Documentation

InlineFlowBox* khtml::CaretBoxLine::baseFlowBox  )  const [inline]
 

returns the base inline flow box which the caret boxes of this caret box line have been constructed from.

This is generally a root line box, but may be an inline flow box when the base is restricted to an inline element.

Definition at line 347 of file khtml_caret_p.h.

RenderBlock* khtml::CaretBoxLine::containingBlock  )  const [inline]
 

returns the containing block

Definition at line 350 of file khtml_caret_p.h.

RenderBox* khtml::CaretBoxLine::enclosingObject  )  const [inline]
 

returns the enclosing object

Definition at line 352 of file khtml_caret_p.h.

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

returns whether this caret box line is outside.

Returns:
true if this caret box represents an outside position of this line box' containing block, false otherwise.

Definition at line 358 of file khtml_caret_p.h.

References khtml::CaretBox::isInline(), and khtml::CaretBox::isOutside().

Referenced by khtml::LineIterator::isOutside().

bool khtml::CaretBoxLine::isOutsideEnd  )  const [inline]
 

returns whether this caret box line is at the outside end.

The result cannot be relied upon unless isOutside() returns true.

Definition at line 368 of file khtml_caret_p.h.

Referenced by khtml::LineIterator::isOutsideEnd().

static CaretBoxLine* khtml::CaretBoxLine::constructCaretBoxLine MassDeleter< CaretBoxLine > *  deleter,
InlineFlowBox *  baseFlowBox,
InlineBox *  seekBox,
bool  seekOutside,
bool  seekOutsideEnd,
CaretBoxIterator iter,
RenderObject *  seekObject = 0
[static]
 

constructs a new caret box line out of the given inline flow box

Parameters:
deleter deleter which handles alloc+dealloc of the object
baseFlowBox basic flow box which to create a caret line box from
seekBox seek this box within the constructed line
seekOutside denoting whether position is outside of seekBox
seekOutsideEnd whether at the outside end of seekBox
iter returns an iterator that corresponds to seekBox. If no suitable caret box exists, it will return end()
seekObject seek this render object within the constructed line. It will only be regarded if seekBox is 0. iter will then point to the first caret box whose render object matches.

Referenced by khtml::LineIterator::advance(), khtml::ErgonomicEditableLineIterator::calcAndStoreNewLine(), khtml::LineIterator::nextBlock(), and khtml::LineIterator::prevBlock().

static CaretBoxLine* khtml::CaretBoxLine::constructCaretBoxLine MassDeleter< CaretBoxLine > *  deleter,
RenderBox *  cb,
bool  outside,
bool  outsideEnd,
CaretBoxIterator iter
[static]
 

constructs a new caret box line for the given render block.

Parameters:
deleter deleter which handles alloc+dealloc of the object
cb render block or render replaced
outside true when line is to be constructed outside
outsideEnd true when the ending outside is meant
iter returns the iterator to the caret box representing the given position for cb

void khtml::CaretBoxLine::addConvertedInlineBox InlineBox *  ,
SeekBoxParams
[protected]
 

recursively converts the given inline box into caret boxes and adds them to this caret box line.

It will additionally look for the caret box specified in SeekBoxParams.

Definition at line 663 of file khtml_caret.cpp.

References addCreatedFlowBoxEdge(), addCreatedFlowBoxInside(), addCreatedInlineBoxEdge(), khtml::CaretBoxLine::SeekBoxParams::check(), khtml::CaretBoxLine::SeekBoxParams::equalsBox(), khtml::CaretBoxLine::SeekBoxParams::found, khtml::CaretBoxLine::SeekBoxParams::it, and kdDebug().

void khtml::CaretBoxLine::addCreatedInlineBoxEdge InlineBox *  box,
const QFontMetrics fm,
bool  left,
bool  rtl
[protected]
 

creates and adds the edge of a generic inline box

Parameters:
box inline box
fm font metrics of inline box
left true to add left edge, false to add right edge
rtl true if direction is rtl

Definition at line 797 of file khtml_caret.cpp.

References khtml::CaretBox::_h, khtml::CaretBox::_w, khtml::CaretBox::_x, and khtml::CaretBox::_y.

Referenced by addConvertedInlineBox().

void khtml::CaretBoxLine::addCreatedFlowBoxEdge InlineFlowBox *  flowBox,
const QFontMetrics fm,
bool  left,
bool  rtl
[protected]
 

creates and adds the edge of an inline flow box

Parameters:
flowBox inline flow box
fm font metrics of inline flow box
left true to add left edge, false to add right edge
rtl true if direction is rtl

Definition at line 784 of file khtml_caret.cpp.

References khtml::CaretBox::_h, khtml::CaretBox::_w, khtml::CaretBox::_x, and khtml::CaretBox::_y.

Referenced by addConvertedInlineBox().

void khtml::CaretBoxLine::addCreatedFlowBoxInside InlineFlowBox *  flowBox,
const QFontMetrics fm
[protected]
 

creates and adds the inside of an inline flow box

Parameters:
flowBox inline flow box
fm font metrics of inline flow box

Definition at line 770 of file khtml_caret.cpp.

References khtml::CaretBox::_h, and khtml::CaretBox::_y.

Referenced by addConvertedInlineBox().


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