khtml::LinearDocument Class Reference
Represents the whole document in terms of lines. More...
#include <khtml_caret_p.h>
Collaboration diagram for khtml::LinearDocument:

Public Types | |
typedef LineIterator | Iterator |
Public Member Functions | |
LinearDocument (KHTMLPart *part, DOM::NodeImpl *node, long offset) | |
bool | isValid () const |
int | count () const |
Iterator | current () |
const Iterator & | end () const |
Iterator | preEnd () |
Iterator | begin () |
const Iterator & | preBegin () const |
Protected Member Functions | |
void | initPreBeginIterator () |
void | initEndIterator () |
Protected Attributes | |
RenderArena * | arena |
DOM::NodeImpl * | node |
long | offset |
Iterator | _preBegin |
Iterator | _end |
KHTMLPart * | m_part |
Friends | |
class | LineIterator |
class | EditableLineIterator |
class | ErgonomicEditableLineIterator |
class | InlineBoxIterator |
class | EditableInlineBoxIterator |
class | EditableCharacterIterator |
Detailed Description
Represents the whole document in terms of lines.SGML documents are trees. But for navigation, this representation is not practical. Therefore this class serves as a helper to represent the document as a linear list of lines. Its usage somewhat resembles STL semantics like begin and end as well as iterators.
The lines itself are represented as pointers to InlineFlowBox objects.
LinearDocument instances are not meant to be kept over the lifetime of their associated document, but constructed from (node, offset) pairs whenever line traversal is needed. This is because the underlying InlineFlowBox objects may be destroyed and recreated (e. g. by resizing the window, adding/removing elements).
- Author:
- Leo Savernik
- Since:
- 3.2
Definition at line 234 of file khtml_caret_p.h.
Constructor & Destructor Documentation
|
Creates a new instance, and initializes it to the line specified by the parameters below.
Creation will fail if
Definition at line 546 of file khtml_caret.cpp. |
Member Function Documentation
|
Tells whether this list contains any lines.
Definition at line 259 of file khtml_caret_p.h. |
|
Returns the count of lines. Warning: This function is expensive. Call it once and cache the value. FIXME: It's not implemented yet (and maybe never will) Definition at line 564 of file khtml_caret.cpp. |
|
Returns a line iterator containing the current position as its starting value.
Definition at line 570 of file khtml_caret.cpp. |
|
Returns a line iterator pointing right after the end of the document.
Definition at line 282 of file khtml_caret_p.h. Referenced by begin(), khtml::EditableCharacterIterator::EditableCharacterIterator(), khtml::ErgonomicEditableLineIterator::operator++(), khtml::EditableCharacterIterator::operator++(), khtml::LineIterator::operator+=(), and khtml::ErgonomicEditableLineIterator::operator--(). |
|
Returns a line iterator pointing to the very last line of the document.
Definition at line 585 of file khtml_caret.cpp. References preBegin(). |
|
Returns a line iterator pointing to the very first line of the document.
Definition at line 575 of file khtml_caret.cpp. References end(). |
|
Returns a line iterator pointing just before the very first line of the document (this is somewhat an emulation of reverse iterators).
Definition at line 298 of file khtml_caret_p.h. Referenced by khtml::ErgonomicEditableLineIterator::operator++(), khtml::ErgonomicEditableLineIterator::operator--(), khtml::EditableCharacterIterator::operator--(), khtml::LineIterator::operator-=(), and preEnd(). |
The documentation for this class was generated from the following files: