#include <iterator.hh>
Classes | |
| class | Stack |
Public Member Functions | |
| DeepIterator (Iterator *it) | |
| Create a new deep iterator from an existing dw::core::Iterator. | |
| ~DeepIterator () | |
| lout::object::Object * | clone () |
| Return an exact copy of the object. | |
| DeepIterator * | createVariant (Iterator *it) |
| Iterator * | getTopIterator () |
| Content * | getContent () |
| bool | isEmpty () |
| bool | next () |
| Move iterator forward and store content it. | |
| bool | prev () |
| Move iterator backward and store content it. | |
| DeepIterator * | cloneDeepIterator () |
| int | compareTo (lout::misc::Comparable *other) |
| Compare two objects c1 and c2. | |
| void | highlight (int start, int end, HighlightLayer layer) |
| Highlight a part of the current content. | |
| void | getAllocation (int start, int end, Allocation *allocation) |
| Return the shape, which a part of the item, the iterator points on, allocates. | |
| void | unhighlight (int direction, HighlightLayer layer) |
Static Public Member Functions | |
| static void | scrollTo (DeepIterator *it1, DeepIterator *it2, int start, int end, HPosition hpos, VPosition vpos) |
Private Member Functions | |
| DeepIterator () | |
Static Private Member Functions | |
| static Iterator * | searchDownward (Iterator *it, Content::Type mask, bool fromEnd) |
| static Iterator * | searchSideward (Iterator *it, Content::Type mask, bool fromEnd) |
Private Attributes | |
| Stack | stack |
| Content::Type | mask |
| Content | content |
| bool | hasContents |
This class is similar to dw::core::Iterator, but not created by a widget, but explicitly from another iterator. Deep iterators do not have the limitation, that iteration is only done within a widget, instead, child widgets are iterated through recursively.
| dw::core::DeepIterator::DeepIterator | ( | ) | [inline, private] |
Referenced by clone(), and createVariant().
| dw::core::DeepIterator::DeepIterator | ( | Iterator * | it | ) |
Create a new deep iterator from an existing dw::core::Iterator.
The content of the return value will be the content of it. If within the widget tree, there is no non-widget content, the resulting deep iterator is empty (denoted by dw::core::DeepIterator::stack == NULL).
Notes:
References dw::core::Iterator::cloneIterator(), content, dw::core::Iterator::getContent(), dw::core::Widget::getLevel(), dw::core::Iterator::getMask(), dw::core::Widget::getParent(), dw::core::Iterator::getWidget(), hasContents, dw::core::Widget::iterator(), mask, dw::core::Iterator::next(), lout::container::typed::Vector< T >::put(), searchDownward(), searchSideward(), stack, dw::core::Content::type, dw::core::Iterator::unref(), dw::core::Content::widget, and dw::core::Content::WIDGET.
| dw::core::DeepIterator::~DeepIterator | ( | ) |
| object::Object * dw::core::DeepIterator::clone | ( | ) | [virtual] |
Return an exact copy of the object.
Reimplemented from lout::object::Object.
References dw::core::Iterator::cloneIterator(), content, DeepIterator(), lout::container::typed::Vector< T >::get(), hasContents, mask, lout::container::typed::Vector< T >::put(), lout::container::typed::Vector< T >::size(), and stack.
Referenced by cloneDeepIterator(), and dw::core::Iterator::scrollTo().
| DeepIterator* dw::core::DeepIterator::cloneDeepIterator | ( | ) | [inline] |
References clone().
Referenced by dw::core::SelectionState::buttonPress(), dw::core::CharIterator::clone(), dw::core::SelectionState::copy(), dw::core::CharIterator::highlight(), dw::core::SelectionState::highlight0(), dw::core::SelectionState::switchLinkToSelection(), and dw::core::CharIterator::unhighlight().
| int dw::core::DeepIterator::compareTo | ( | lout::misc::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 also object::Object is implemented, and if c1.equals(c2), 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::misc::Comparable.
References lout::misc::Comparable::compareTo(), lout::container::typed::Vector< T >::get(), dw::core::Iterator::getWidget(), lout::container::typed::Vector< T >::size(), and stack.
Referenced by dw::core::SelectionState::adjustSelection(), dw::core::SelectionState::buttonRelease(), dw::core::CharIterator::compareTo(), dw::core::SelectionState::copy(), dw::core::CharIterator::highlight(), dw::core::SelectionState::highlight0(), dw::core::Iterator::scrollTo(), and dw::core::CharIterator::unhighlight().
| DeepIterator * dw::core::DeepIterator::createVariant | ( | Iterator * | it | ) |
References DeepIterator().
Referenced by dw::core::SelectionState::adjustSelection(), and dw::core::SelectionState::switchLinkToSelection().
| void dw::core::DeepIterator::getAllocation | ( | int | start, | |
| int | end, | |||
| Allocation * | allocation | |||
| ) | [inline] |
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().
References dw::core::Iterator::getAllocation(), dw::core::DeepIterator::Stack::getTop(), and stack.
Referenced by dw::core::Iterator::scrollTo().
| Content* dw::core::DeepIterator::getContent | ( | ) | [inline] |
| Iterator* dw::core::DeepIterator::getTopIterator | ( | ) | [inline] |
References dw::core::DeepIterator::Stack::getTop(), and stack.
Referenced by dw::core::SelectionState::copy(), and dw::core::SelectionState::correctCharPos().
| void dw::core::DeepIterator::highlight | ( | int | start, | |
| int | end, | |||
| HighlightLayer | layer | |||
| ) | [inline] |
Highlight a part of the current content.
Unhighlight the current content by passing -1 as start (see also (dw::core::Iterator::unhighlight). 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.
References dw::core::DeepIterator::Stack::getTop(), dw::core::Iterator::highlight(), and stack.
Referenced by dw::core::SelectionState::adjustSelection(), dw::core::CharIterator::highlight(), and dw::core::SelectionState::highlight0().
| bool dw::core::DeepIterator::isEmpty | ( | ) |
| bool dw::core::DeepIterator::next | ( | ) |
Move iterator forward and store content it.
Returns true on success.
References content, dw::core::Content::END, dw::core::Iterator::getContent(), dw::core::DeepIterator::Stack::getTop(), dw::core::Widget::iterator(), mask, dw::core::Iterator::next(), dw::core::DeepIterator::Stack::pop(), dw::core::DeepIterator::Stack::push(), lout::container::typed::Vector< T >::size(), stack, dw::core::Content::type, dw::core::Content::widget, and dw::core::Content::WIDGET.
Referenced by dw::core::SelectionState::copy(), dw::core::CharIterator::highlight(), dw::core::SelectionState::highlight0(), dw::core::CharIterator::next(), dw::core::Iterator::scrollTo(), and dw::core::CharIterator::unhighlight().
| bool dw::core::DeepIterator::prev | ( | ) |
Move iterator backward and store content it.
Returns true on success.
References content, dw::core::Iterator::getContent(), dw::core::DeepIterator::Stack::getTop(), dw::core::Widget::iterator(), mask, dw::core::DeepIterator::Stack::pop(), dw::core::Iterator::prev(), dw::core::DeepIterator::Stack::push(), lout::container::typed::Vector< T >::size(), stack, dw::core::Content::START, dw::core::Content::type, dw::core::Content::widget, and dw::core::Content::WIDGET.
Referenced by dw::core::CharIterator::prev().
| static void dw::core::DeepIterator::scrollTo | ( | DeepIterator * | it1, | |
| DeepIterator * | it2, | |||
| int | start, | |||
| int | end, | |||
| HPosition | hpos, | |||
| VPosition | vpos | |||
| ) | [inline, static] |
References dw::core::DeepIterator::Stack::getTop(), and stack.
| Iterator * dw::core::DeepIterator::searchDownward | ( | Iterator * | it, | |
| Content::Type | mask, | |||
| bool | fromEnd | |||
| ) | [static, private] |
References dw::core::Iterator::getContent(), dw::core::Widget::iterator(), dw::core::Content::type, dw::core::Iterator::unref(), dw::core::Content::widget, and dw::core::Content::WIDGET.
Referenced by DeepIterator(), and searchSideward().
| Iterator * dw::core::DeepIterator::searchSideward | ( | Iterator * | it, | |
| Content::Type | mask, | |||
| bool | fromEnd | |||
| ) | [static, private] |
References lout::misc::assertNotReached(), dw::core::Iterator::cloneIterator(), dw::core::Iterator::getContent(), dw::core::Widget::getParent(), dw::core::Iterator::getWidget(), dw::core::Widget::iterator(), searchDownward(), dw::core::Content::type, dw::core::Iterator::unref(), and dw::core::Content::WIDGET.
Referenced by DeepIterator().
| void dw::core::DeepIterator::unhighlight | ( | int | direction, | |
| HighlightLayer | layer | |||
| ) | [inline] |
References dw::core::DeepIterator::Stack::getTop(), stack, and dw::core::Iterator::unhighlight().
Referenced by dw::core::SelectionState::highlight0(), and dw::core::CharIterator::unhighlight().
Content dw::core::DeepIterator::content [private] |
Referenced by clone(), DeepIterator(), getContent(), next(), and prev().
bool dw::core::DeepIterator::hasContents [private] |
Referenced by clone(), DeepIterator(), and isEmpty().
Content::Type dw::core::DeepIterator::mask [private] |
Referenced by clone(), DeepIterator(), next(), and prev().
Stack dw::core::DeepIterator::stack [private] |
Referenced by clone(), compareTo(), DeepIterator(), getAllocation(), getTopIterator(), highlight(), next(), prev(), scrollTo(), and unhighlight().
1.5.9