dw::core::EmptyIterator Class Reference

This implementation of dw::core::Iterator can be used by widgets with no contents. More...

#include <iterator.hh>

List of all members.

Public Member Functions

 EmptyIterator (Widget *widget, Content::Type mask, bool atEnd)
lout::object::Objectclone ()
 Return an exact copy of the object.
int compareTo (lout::misc::Comparable *other)
 Compare two objects c1 and c2.
bool next ()
 Move iterator forward and store content it.
bool prev ()
 Move iterator backward and store content it.
void highlight (int start, int end, HighlightLayer layer)
 Extend highlighted region to contain part of the current content.
void unhighlight (int direction, HighlightLayer layer)
 Shrink highlighted region to no longer contain 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.

Private Member Functions

 EmptyIterator (EmptyIterator &it)


Detailed Description

This implementation of dw::core::Iterator can be used by widgets with no contents.

Constructor & Destructor Documentation

dw::core::EmptyIterator::EmptyIterator ( EmptyIterator it  )  [private]

Referenced by clone().

dw::core::EmptyIterator::EmptyIterator ( Widget widget,
Content::Type  mask,
bool  atEnd 
)


Member Function Documentation

object::Object * dw::core::EmptyIterator::clone (  )  [virtual]

Return an exact copy of the object.

Reimplemented from lout::object::Object.

References EmptyIterator().

int dw::core::EmptyIterator::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 dw::core::Iterator::content, dw::core::Content::START, and dw::core::Content::type.

void dw::core::EmptyIterator::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.

void dw::core::EmptyIterator::highlight ( int  start,
int  end,
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.

bool dw::core::EmptyIterator::next (  )  [virtual]

Move iterator forward and store content it.

Returns true on success.

Implements dw::core::Iterator.

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

bool dw::core::EmptyIterator::prev (  )  [virtual]

Move iterator backward and store content it.

Returns true on success.

Implements dw::core::Iterator.

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

void dw::core::EmptyIterator::unhighlight ( int  direction,
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.


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

Generated on Wed Sep 7 02:00:37 2011 for Dillo by  doxygen 1.5.9