LibreOffice Module sd (master) 1
|
This iterator can be used to iterate over all <type>SdrObject</type> objects of one of three set denoted by the <type>IteratorType</type>: More...
#include <OutlinerIterator.hxx>
Public Member Functions | |
Iterator () | |
Iterator (const Iterator &rIterator) | |
The copy constructor creates a new iterator by copying the implementation object. More... | |
Iterator (Iterator &&rIterator) noexcept | |
Iterator (std::unique_ptr< IteratorImplBase > pObject) | |
Create a new iterator with the implementation object being the provided one. More... | |
~Iterator () | |
Iterator & | operator= (const Iterator &rIterator) |
Assign the iterator from the given one. More... | |
Iterator & | operator= (Iterator &&rIterator) noexcept |
const IteratorPosition & | operator* () const |
Return the current position of the iterator. More... | |
Iterator & | operator++ () |
The prefix increment operator returns the iterator pointing to the next object. More... | |
bool | operator== (const Iterator &rIterator) const |
Test equality of two iterators. More... | |
bool | operator!= (const Iterator &rIterator) const |
Test whether two iterators point to different objects. More... | |
void | Reverse () |
Reverse the direction of iteration. More... | |
Private Attributes | |
std::unique_ptr< IteratorImplBase > | mxIterator |
The implementation object to which most of the methods are forwarded. More... | |
This iterator can be used to iterate over all <type>SdrObject</type> objects of one of three set denoted by the <type>IteratorType</type>:
Note that the iterator does not change pages or views. It is the task of the user of the iterator to take the information provided by the <type>IteratorPosition</type> as returned by the <member>operator*()</member> method and set view, visible page, and selection/edit mode markers to reflect this position.
A simple forward iteration from the first to the last object would instantiate the iterator with Iterator(pDocument,pViewShell,true,BEGIN)
for some document and view shell. This iterator can then be compared against Iterator(pDocument,pViewShell,true,END)
. On equality the iteration should be stopped without evaluating the iterator: The position of an end iterator is not valid.
Definition at line 74 of file OutlinerIterator.hxx.
sd::outliner::Iterator::Iterator | ( | ) |
Definition at line 55 of file OutlinerIterator.cxx.
sd::outliner::Iterator::Iterator | ( | const Iterator & | rIterator | ) |
The copy constructor creates a new iterator by copying the implementation object.
Definition at line 59 of file OutlinerIterator.cxx.
|
noexcept |
Definition at line 64 of file OutlinerIterator.cxx.
|
explicit |
Create a new iterator with the implementation object being the provided one.
pObject | A copy of this object will become the implementation object. |
Definition at line 69 of file OutlinerIterator.cxx.
References pObject.
sd::outliner::Iterator::~Iterator | ( | ) |
Definition at line 74 of file OutlinerIterator.cxx.
bool sd::outliner::Iterator::operator!= | ( | const Iterator & | rIterator | ) | const |
Test whether two iterators point to different objects.
This is just the negation of the result of the equality operator.
rIterator | The iterator to test inequality with. |
Definition at line 117 of file OutlinerIterator.cxx.
References operator==().
const IteratorPosition & sd::outliner::Iterator::operator* | ( | void | ) | const |
Return the current position of the iterator.
Definition at line 96 of file OutlinerIterator.cxx.
References DBG_ASSERT, and mxIterator.
Iterator & sd::outliner::Iterator::operator++ | ( | void | ) |
The prefix increment operator returns the iterator pointing to the next object.
When in doubt prefer this operator over the postfix increment operator.
Definition at line 102 of file OutlinerIterator.cxx.
References mxIterator.
Assign the iterator from the given one.
The implementation object of this iterator will be a copy of the given iterator.
rIterator | The iterator which to assign from. |
Definition at line 78 of file OutlinerIterator.cxx.
References mxIterator.
Definition at line 90 of file OutlinerIterator.cxx.
bool sd::outliner::Iterator::operator== | ( | const Iterator & | rIterator | ) | const |
Test equality of two iterators.
Two iterators are taken to be equal when they point are of the same type (their implementation objects are instances of the same class) and point to the same object.
rIterator | The iterator to test equality with. |
Definition at line 109 of file OutlinerIterator.cxx.
References mxIterator.
Referenced by operator!=().
void sd::outliner::Iterator::Reverse | ( | ) |
Reverse the direction of iteration.
The position of the iterator is not changed. Thus calling this method twice returns to the old state.
Definition at line 122 of file OutlinerIterator.cxx.
References mxIterator.
Referenced by SdOutliner::Initialize().
|
private |
The implementation object to which most of the methods are forwarded.
Definition at line 140 of file OutlinerIterator.hxx.
Referenced by operator*(), operator++(), operator=(), operator==(), and Reverse().