Dillo v3.1.1-98-g318d1f14
|
This implementation of dw::core::Iterator can be used by widgets having one text word as contents. More...
#include <iterator.hh>
Public Member Functions | |
TextIterator (Widget *widget, Content::Type mask, bool atEnd, const char *text) | |
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. | |
void | getAllocation (int start, int end, Allocation *allocation) |
Return the shape, which a part of the item, the iterator points on, allocates. | |
Public Member Functions inherited from dw::core::Iterator | |
bool | equals (Object *other) |
Returns, whether two objects are equal. | |
void | intoStringBuffer (lout::misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. | |
Widget * | getWidget () |
Content * | getContent () |
Content::Type | getMask () |
virtual void | unref () |
Delete the iterator. | |
virtual void | highlight (int start, int end, HighlightLayer layer)=0 |
Extend highlighted region to contain part of the current content. | |
virtual void | unhighlight (int direction, HighlightLayer layer)=0 |
Shrink highlighted region to no longer contain the current content. | |
Iterator * | cloneIterator () |
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. | |
virtual Object * | clone () |
Return an exact copy of 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. | |
Private Member Functions | |
TextIterator (TextIterator &it) | |
Private Attributes | |
const char * | text |
May be NULL, in this case, the next is skipped. | |
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. | |
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 |
This implementation of dw::core::Iterator can be used by widgets having one text word as contents.
Definition at line 118 of file iterator.hh.
|
private |
Definition at line 273 of file iterator.cc.
References text.
dw::core::TextIterator::TextIterator | ( | Widget * | widget, |
Content::Type | mask, | ||
bool | atEnd, | ||
const char * | text | ||
) |
Definition at line 266 of file iterator.cc.
References dw::core::Iterator::content, dw::core::Content::END, dw::core::Iterator::mask, dw::core::Content::START, text, dw::core::Content::TEXT, and dw::core::Content::type.
|
virtual |
Compare two objects, this and other.
Return a value < 0, when this is less than other, a value > 0, when this is greater than other, or 0, when this and other 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 278 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.
|
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 328 of file iterator.cc.
References dw::core::Widget::getAllocation(), and dw::core::Iterator::getWidget().
|
virtual |
Move iterator forward and store content it.
Returns true on success.
Implements dw::core::Iterator.
Definition at line 304 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.
|
virtual |
Move iterator backward and store content it.
Returns true on success.
Implements dw::core::Iterator.
Definition at line 316 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.
|
private |
May be NULL, in this case, the next is skipped.
Definition at line 122 of file iterator.hh.
Referenced by next(), prev(), TextIterator(), and TextIterator().