dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dw::core::TextIterator Class Reference

This implementation of dw::core::Iterator can be used by widgets having one text word as contents. More...

#include <iterator.hh>

Inheritance diagram for dw::core::TextIterator:
[legend]
Collaboration diagram for dw::core::TextIterator:
[legend]

Public Member Functions

 TextIterator (Widget *widget, Content::Type mask, bool atEnd, const char *text)
 
int compareTo (lout::object::Comparable *other)
 Compare two objects c1 and c2. More...
 
bool next ()
 Move iterator forward and store content it. More...
 
bool prev ()
 Move iterator backward and store content it. More...
 
void getAllocation (int start, int end, Allocation *allocation)
 Return the shape, which a part of the item, the iterator points on, allocates. More...
 
- Public Member Functions inherited from dw::core::Iterator
bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
WidgetgetWidget ()
 
ContentgetContent ()
 
Content::Type getMask ()
 
virtual void unref ()
 Delete the iterator. More...
 
virtual void highlight (int start, int end, HighlightLayer layer)=0
 Extend highlighted region to contain part of the current content. More...
 
virtual void unhighlight (int direction, HighlightLayer layer)=0
 Shrink highlighted region to no longer contain the current content. More...
 
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. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Private Member Functions

 TextIterator (TextIterator &it)
 

Private Attributes

const char * text
 

Additional Inherited Members

- 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. More...
 
- Static Public Member Functions inherited from lout::object::Comparable
static int compareFun (const void *p1, const void *p2)
 This static method may be used as compare function for qsort(3) and bsearch(3), for an array of Object* (Object*[] or Object**). More...
 
- Protected Member Functions inherited from dw::core::Iterator
 Iterator (Widget *widget, Content::Type mask, bool atEnd)
 
 Iterator (Iterator &it)
 
 ~Iterator ()
 
- Protected Attributes inherited from dw::core::Iterator
Content content
 

Detailed Description

This implementation of dw::core::Iterator can be used by widgets having one text word as contents.

Definition at line 117 of file iterator.hh.

Constructor & Destructor Documentation

◆ TextIterator() [1/2]

dw::core::TextIterator::TextIterator ( TextIterator it)
private

Definition at line 255 of file iterator.cc.

References text.

◆ TextIterator() [2/2]

dw::core::TextIterator::TextIterator ( Widget widget,
Content::Type  mask,
bool  atEnd,
const char *  text 
)

Member Function Documentation

◆ compareTo()

int dw::core::TextIterator::compareTo ( lout::object::Comparable other)
virtual

Compare two objects c1 and c2.

Return a value < 0, when c1 is less than c2, a value > 0, when c1 is greater than c2, or 0, when c1 and c2 are equal.

If c1.equals(c2) (as defined in Object), c1.compareTo(c2) must be 0, but, unlike you may expect, the reversed is not necessarily true. This method returns 0, if, according to the rules for sorting, there is no difference, but there may still be differences (not relevant for sorting), which "equals" will care about.

Implements lout::object::Comparable.

Definition at line 260 of file iterator.cc.

References lout::misc::assertNotReached(), dw::core::Iterator::content, dw::core::Content::END, dw::core::Content::START, dw::core::Content::TEXT, and dw::core::Content::type.

◆ getAllocation()

void dw::core::TextIterator::getAllocation ( int  start,
int  end,
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 310 of file iterator.cc.

References dw::core::Widget::getAllocation(), and dw::core::Iterator::getWidget().

◆ next()

bool dw::core::TextIterator::next ( )
virtual

Move iterator forward and store content it.

Returns true on success.

Implements dw::core::Iterator.

Definition at line 286 of file iterator.cc.

References dw::core::Iterator::content, dw::core::Content::END, dw::core::Content::START, text, dw::core::Content::TEXT, dw::core::Content::text, and dw::core::Content::type.

◆ prev()

bool dw::core::TextIterator::prev ( )
virtual

Move iterator backward and store content it.

Returns true on success.

Implements dw::core::Iterator.

Definition at line 298 of file iterator.cc.

References dw::core::Iterator::content, dw::core::Content::END, dw::core::Content::START, text, dw::core::Content::TEXT, dw::core::Content::text, and dw::core::Content::type.

Member Data Documentation

◆ text

const char* dw::core::TextIterator::text
private

May be NULL, in this case, the next is skipped.

Definition at line 121 of file iterator.hh.

Referenced by next(), prev(), and TextIterator().


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