• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
  • LineIterator
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
khtml::LineIterator Class Reference

#include <khtml_caret_p.h>

Inheritance diagram for khtml::LineIterator:
Inheritance graph
[legend]

Public Member Functions

void advance (bool toBegin)
 
bool isOutside () const
 
bool isOutsideEnd ()
 
LinearDocument * linearDocument () const
 
bool operator!= (const LineIterator &it) const
 
CaretBoxLine * operator* () const
 
LineIterator & operator++ ()
 
LineIterator & operator-- ()
 
bool operator== (const LineIterator &it) const
 

Static Public Member Functions

static CaretBoxIterator & currentCaretBox ()
 
static long currentModifiedOffset ()
 

Protected Member Functions

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

Protected Attributes

CaretBoxLine * cbl
 
LinearDocument * lines
 

Static Protected Attributes

static CaretBoxIterator currentBox
 
static long currentOffset
 

Detailed Description

Iterates through the lines of a document.

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

Author
Leo Savernik

Definition at line 487 of file khtml_caret_p.h.

Constructor & Destructor Documentation

khtml::LineIterator::LineIterator ( )
inlineprotected

Default constructor, only for internal use.

Definition at line 501 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.

Member Function Documentation

void khtml::LineIterator::advance ( bool  toBegin)

advances to the line to come.

Parameters
toBegintrue, move to previous line, false, move to next line.

Definition at line 1482 of file khtml_caret.cpp.

static CaretBoxIterator& khtml::LineIterator::currentCaretBox ( )
inlinestatic

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

static long khtml::LineIterator::currentModifiedOffset ( )
inlinestatic

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

bool khtml::LineIterator::isOutside ( ) const
inline

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

Definition at line 559 of file khtml_caret_p.h.

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

LinearDocument* khtml::LineIterator::linearDocument ( ) const
inline

returns the associated linear document

Definition at line 520 of file khtml_caret_p.h.

void khtml::LineIterator::nextBlock ( )
protected

seeks next block.

Definition at line 1345 of file khtml_caret.cpp.

bool khtml::LineIterator::operator!= ( const LineIterator &  it) const
inline

compares two iterators

Definition at line 544 of file khtml_caret_p.h.

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

LineIterator& khtml::LineIterator::operator++ ( )
inline

seek next line

Guaranteed to crash if beyond beginning/end of document.

Definition at line 526 of file khtml_caret_p.h.

LineIterator& khtml::LineIterator::operator-- ( )
inline

seek previous line.

Guaranteed to crash if beyond beginning/end of document.

Definition at line 532 of file khtml_caret_p.h.

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

void khtml::LineIterator::prevBlock ( )
protected

seeks previous block.

Definition at line 1412 of file khtml_caret.cpp.

Member Data Documentation

CaretBoxLine* khtml::LineIterator::cbl
protected

Definition at line 491 of file khtml_caret_p.h.

CaretBoxIterator khtml::LineIterator::currentBox
staticprotected

Definition at line 493 of file khtml_caret_p.h.

long khtml::LineIterator::currentOffset
staticprotected

Definition at line 494 of file khtml_caret_p.h.

LinearDocument* khtml::LineIterator::lines
protected

Definition at line 490 of file khtml_caret_p.h.


The documentation for this class was generated from the following files:
  • khtml_caret_p.h
  • khtml_caret.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal