Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
dw::Textblock::TextblockIterator Class Reference

#include <textblock.hh>

Public Member Functions

 TextblockIterator (Textblock *textblock, core::Content::Type mask, bool atEnd)
 
lout::object::Objectclone ()
 Return an exact copy of the object.
 
void highlight (int start, int end, core::HighlightLayer layer)
 Extend highlighted region to contain part of the current content.
 
void unhighlight (int direction, core::HighlightLayer layer)
 Shrink highlighted region to no longer contain the current content.
 
void getAllocation (int start, int end, core::Allocation *allocation)
 Return the shape, which a part of the item, the iterator points on, allocates.
 
- Public Member Functions inherited from dw::oof::OOFAwareWidget::OOFAwareWidgetIterator
 OOFAwareWidgetIterator (OOFAwareWidget *widget, core::Content::Type mask, bool atEnd, int numContentsInFlow)
 
void intoStringBuffer (lout::misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
int compareTo (lout::object::Comparable *other)
 Compare two objects, this and other.
 
bool next ()
 Move iterator forward and store content it.
 
bool prev ()
 Move iterator backward and store content it.
 
- Public Member Functions inherited from dw::core::Iterator
bool equals (Object *other)
 Returns, whether two objects are equal.
 
WidgetgetWidget ()
 
ContentgetContent ()
 
Content::Type getMask ()
 
virtual void unref ()
 Delete the iterator.
 
IteratorcloneIterator ()
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly.
 
virtual int hashValue ()
 Return a hash value for the object.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Static Public Member Functions

static TextblockIteratorcreateWordIndexIterator (Textblock *textblock, core::Content::Type mask, int wordIndex)
 
- Static Public Member Functions inherited from dw::core::Iterator
static void scrollTo (Iterator *it1, Iterator *it2, int start, int end, HPosition hpos, VPosition vpos)
 Scrolls the viewport, so that the region between it1 and it2 is seen, according to hpos and vpos.
 

Protected Member Functions

int numContentsInFlow ()
 
void getContentInFlow (int index, core::Content *content)
 
- Protected Member Functions inherited from dw::oof::OOFAwareWidget::OOFAwareWidgetIterator
void setValues (int sectionIndex, int index)
 
void cloneValues (OOFAwareWidgetIterator *other)
 
bool inFlow ()
 
int getInFlowIndex ()
 
void highlightOOF (int start, int end, core::HighlightLayer layer)
 
void unhighlightOOF (int direction, core::HighlightLayer layer)
 
void getAllocationOOF (int start, int end, core::Allocation *allocation)
 
- Protected Member Functions inherited from dw::core::Iterator
 Iterator (Widget *widget, Content::Type mask, bool atEnd)
 
 Iterator (Iterator &it)
 
 ~Iterator ()
 

Additional Inherited Members

- Protected Attributes inherited from dw::core::Iterator
Content content
 

Detailed Description

Definition at line 508 of file textblock.hh.

Constructor & Destructor Documentation

◆ TextblockIterator()

dw::Textblock::TextblockIterator::TextblockIterator ( Textblock textblock,
core::Content::Type  mask,
bool  atEnd 
)

Definition at line 33 of file textblock_iterator.cc.

Member Function Documentation

◆ clone()

object::Object * dw::Textblock::TextblockIterator::clone ( )
virtual

Return an exact copy of the object.

Reimplemented from lout::object::Object.

Definition at line 51 of file textblock_iterator.cc.

◆ createWordIndexIterator()

Textblock::TextblockIterator * dw::Textblock::TextblockIterator::createWordIndexIterator ( Textblock textblock,
core::Content::Type  mask,
int  wordIndex 
)
static

◆ getAllocation()

void dw::Textblock::TextblockIterator::getAllocation ( int  start,
int  end,
core::Allocation allocation 
)
virtual

Return the shape, which a part of the item, the iterator points on, allocates.

The parameters start and end have the same meaning as in DwIterator::highlight().

Implements dw::core::Iterator.

Definition at line 187 of file textblock_iterator.cc.

References dw::core::Widget::allocation, dw::core::Allocation::ascent, dw::core::Requisition::ascent, dw::Textblock::Line::borderAscent, dw::core::Widget::boxOffsetX(), dw::Textblock::Word::content, dw::core::Allocation::descent, dw::core::Requisition::descent, dw::Textblock::Word::effSpace, dw::Textblock::findLineOfWord(), dw::Textblock::Line::firstWord, dw::Textblock::Word::flags, dw::core::Widget::getStyle(), dw::Textblock::index, dw::Textblock::Line::lastWord, dw::Textblock::leftInnerPadding, dw::Textblock::line1OffsetEff, dw::Textblock::lines, dw::Textblock::lineYOffsetCanvas(), dw::core::style::StyleAttrs::margin, lout::misc::max(), lout::misc::min(), dw::Textblock::mustBorderBeRegarded(), dw::Textblock::newLineLeftBorder, dw::Textblock::Word::size, dw::Textblock::Word::style, dw::core::Content::TEXT, dw::core::Content::text, dw::Textblock::Line::textOffset, dw::Textblock::textWidth(), dw::core::style::Box::top, dw::core::Content::type, dw::core::Content::widget, dw::core::Content::WIDGET_IN_FLOW, dw::core::Allocation::width, dw::core::Requisition::width, dw::Textblock::Word::WORD_END, dw::Textblock::Word::WORD_START, dw::Textblock::words, dw::core::Allocation::x, dw::core::Allocation::y, and dw::Textblock::yOffsetOfLineToBeCreated().

◆ getContentInFlow()

void dw::Textblock::TextblockIterator::getContentInFlow ( int  index,
core::Content content 
)
protectedvirtual

◆ highlight()

void dw::Textblock::TextblockIterator::highlight ( int  start,
int  end,
core::HighlightLayer  layer 
)
virtual

Extend highlighted region to contain part of the current content.

For text, start and end define the characters, otherwise, the shape is defined as [0, 1], i.e. for highlighting a whole dw::core::Content, pass 0 and >= 1. To unhighlight see also dw::core::Iterator::unhighlight.

Implements dw::core::Iterator.

Definition at line 59 of file textblock_iterator.cc.

References DBG_IF_RTFL, DBG_OBJ_ARRATTRSET_NUM_O, DBG_OBJ_ENTER_O, DBG_OBJ_LEAVE_O, DBG_OBJ_MSGF_O, lout::misc::StringBuffer::getChars(), dw::Textblock::hlEnd, dw::Textblock::hlStart, dw::Textblock::index, lout::identity::IdentifiableObject::intoStringBuffer(), dw::Textblock::nChar, and dw::Textblock::queueDrawRange().

◆ numContentsInFlow()

int dw::Textblock::TextblockIterator::numContentsInFlow ( )
protectedvirtual

◆ unhighlight()

void dw::Textblock::TextblockIterator::unhighlight ( int  direction,
core::HighlightLayer  layer 
)
virtual

Shrink highlighted region to no longer contain the current content.

The direction parameter indicates whether the highlighted region should be reduced from the start (direction > 0) or from the end (direction < 0). If direction is 0 all content is unhighlighted.

Implements dw::core::Iterator.

Definition at line 123 of file textblock_iterator.cc.

References DBG_IF_RTFL, DBG_OBJ_ARRATTRSET_NUM_O, DBG_OBJ_ENTER_O, DBG_OBJ_LEAVE_O, DBG_OBJ_MSGF_O, lout::misc::StringBuffer::getChars(), dw::Textblock::hlEnd, dw::Textblock::hlStart, dw::Textblock::index, lout::identity::IdentifiableObject::intoStringBuffer(), dw::Textblock::nChar, and dw::Textblock::queueDrawRange().


The documentation for this class was generated from the following files: