#include <iterator.hh>
Public Member Functions | |
| bool | equals (Object *other) |
| Widget * | getWidget () |
| Content * | getContent () |
| Content::Type | getMask () |
| virtual void | unref () |
| Delete the iterator. | |
| virtual bool | next ()=0 |
| Move iterator forward and store content it. | |
| virtual bool | prev ()=0 |
| Move iterator backward and store content it. | |
| 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. | |
| virtual void | getAllocation (int start, int end, Allocation *allocation)=0 |
| Return the shape, which a part of the item, the iterator points on, allocates. | |
| Iterator * | cloneIterator () |
Static Public Member Functions | |
| 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 | |
| Iterator (Widget *widget, Content::Type mask, bool atEnd) | |
| Iterator (Iterator &it) | |
| ~Iterator () | |
Protected Attributes | |
| Content | content |
Private Attributes | |
| Widget * | widget |
| Content::Type | mask |
When using iterators, you should care about the results of dw::core::Widget::hasContents.
| dw::core::Iterator::Iterator | ( | Widget * | widget, | |
| Content::Type | mask, | |||
| bool | atEnd | |||
| ) | [protected] |
| dw::core::Iterator::~Iterator | ( | ) | [protected] |
| Iterator* dw::core::Iterator::cloneIterator | ( | ) | [inline] |
References lout::object::Object::clone().
Referenced by dw::core::DeepIterator::clone(), dw::core::DeepIterator::DeepIterator(), and dw::core::DeepIterator::searchSideward().
| bool dw::core::Iterator::equals | ( | Object * | other | ) |
| virtual void dw::core::Iterator::getAllocation | ( | int | start, | |
| int | end, | |||
| Allocation * | allocation | |||
| ) | [pure 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().
Implemented in dw::core::EmptyIterator, dw::core::TextIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::getAllocation(), and scrollTo().
| Content* dw::core::Iterator::getContent | ( | ) | [inline] |
References content.
Referenced by dw::core::SelectionState::copy(), dw::core::SelectionState::correctCharPos(), dw::core::DeepIterator::DeepIterator(), dw::core::Widget::getWidgetAtPoint(), dw::core::DeepIterator::next(), dw::core::DeepIterator::prev(), dw::core::DeepIterator::searchDownward(), and dw::core::DeepIterator::searchSideward().
| Content::Type dw::core::Iterator::getMask | ( | ) | [inline] |
| Widget* dw::core::Iterator::getWidget | ( | ) | [inline] |
Referenced by dw::core::SelectionState::buttonPress(), dw::core::SelectionState::buttonRelease(), dw::Textblock::TextblockIterator::clone(), dw::Table::TableIterator::clone(), dw::core::DeepIterator::compareTo(), dw::core::DeepIterator::DeepIterator(), equals(), dw::Textblock::TextblockIterator::getAllocation(), dw::core::TextIterator::getAllocation(), dw::Textblock::TextblockIterator::highlight(), dw::Textblock::TextblockIterator::next(), dw::Table::TableIterator::next(), dw::Textblock::TextblockIterator::prev(), dw::Table::TableIterator::prev(), scrollTo(), dw::core::DeepIterator::searchSideward(), and dw::Textblock::TextblockIterator::unhighlight().
| virtual void dw::core::Iterator::highlight | ( | int | start, | |
| int | end, | |||
| HighlightLayer | layer | |||
| ) | [pure 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.
Implemented in dw::core::EmptyIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::highlight().
| virtual bool dw::core::Iterator::next | ( | ) | [pure virtual] |
Move iterator forward and store content it.
Returns true on success.
Implemented in dw::core::EmptyIterator, dw::core::TextIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::DeepIterator(), dw::core::Widget::getWidgetAtPoint(), and dw::core::DeepIterator::next().
| virtual bool dw::core::Iterator::prev | ( | ) | [pure virtual] |
Move iterator backward and store content it.
Returns true on success.
Implemented in dw::core::EmptyIterator, dw::core::TextIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::prev().
| void dw::core::Iterator::scrollTo | ( | Iterator * | it1, | |
| Iterator * | it2, | |||
| int | start, | |||
| int | end, | |||
| HPosition | hpos, | |||
| VPosition | vpos | |||
| ) | [static] |
Scrolls the viewport, so that the region between it1 and it2 is seen, according to hpos and vpos.
The parameters start and end have the same meaning as in dw::core::Iterator::getAllocation, start refers to it1, while end rerers to it2.
If it1 and it2 point to the same location (see code), only it1 is regarded, and both belowstart and belowend refer to it.
References dw::core::Allocation::ascent, dw::core::DeepIterator::clone(), dw::core::DeepIterator::compareTo(), dw::core::Allocation::descent, equals(), dw::core::DeepIterator::getAllocation(), getAllocation(), dw::core::Layout::getHeightViewport(), dw::core::Widget::getLayout(), dw::core::Layout::getUsesViewport(), getWidget(), dw::core::Layout::getWidthViewport(), lout::misc::max(), lout::misc::min(), dw::core::DeepIterator::next(), dw::core::Layout::scrollTo(), dw::core::Allocation::width, dw::core::Allocation::x, and dw::core::Allocation::y.
| virtual void dw::core::Iterator::unhighlight | ( | int | direction, | |
| HighlightLayer | layer | |||
| ) | [pure 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.
Implemented in dw::core::EmptyIterator, dw::Table::TableIterator, and dw::Textblock::TextblockIterator.
Referenced by dw::core::DeepIterator::unhighlight().
| void dw::core::Iterator::unref | ( | ) | [virtual] |
Delete the iterator.
The destructor is hidden, implementations may use optimizations for the allocation. (Will soon be the case for dw::core::EmptyIteratorFactory.)
Referenced by dw::core::CharIterator::CharIterator(), dw::core::DeepIterator::DeepIterator(), dw::core::Widget::getWidgetAtPoint(), dw::core::DeepIterator::Stack::pop(), dw::core::DeepIterator::searchDownward(), dw::core::DeepIterator::searchSideward(), and dw::Textblock::sendSelectionEvent().
Content dw::core::Iterator::content [protected] |
Referenced by dw::core::TextIterator::compareTo(), dw::core::EmptyIterator::compareTo(), dw::core::EmptyIterator::EmptyIterator(), getContent(), Iterator(), dw::Textblock::TextblockIterator::next(), dw::Table::TableIterator::next(), dw::core::TextIterator::next(), dw::core::EmptyIterator::next(), dw::Textblock::TextblockIterator::prev(), dw::Table::TableIterator::prev(), dw::core::TextIterator::prev(), dw::core::EmptyIterator::prev(), dw::Table::TableIterator::TableIterator(), dw::Textblock::TextblockIterator::TextblockIterator(), and dw::core::TextIterator::TextIterator().
Content::Type dw::core::Iterator::mask [private] |
Widget* dw::core::Iterator::widget [private] |
Referenced by Iterator().
1.5.9