LibreOffice Module sd (master) 1
Public Member Functions | Protected Attributes | List of all members
sd::outliner::IteratorImplBase Class Referenceabstract

Base class for the polymorphic implementation class of the <type>Iterator</type> class. More...

#include <OutlinerIteratorImpl.hxx>

Inheritance diagram for sd::outliner::IteratorImplBase:
[legend]
Collaboration diagram for sd::outliner::IteratorImplBase:
[legend]

Public Member Functions

 IteratorImplBase (SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
 The constructor stores the given arguments to be used by the derived classes. More...
 
 IteratorImplBase (SdDrawDocument *pDocument, std::weak_ptr< ViewShell > pViewShellWeak, bool bDirectionIsForward, PageKind ePageKind, EditMode eEditMode)
 
virtual ~IteratorImplBase ()
 
virtual void GotoNextText ()=0
 Advance to the next text of the current object or to the next object. More...
 
virtual const IteratorPositionGetPosition ()
 Return an object that describes the current object. More...
 
virtual IteratorImplBaseClone (IteratorImplBase *pObject=nullptr) const
 Create an exact copy of this object. More...
 
virtual bool operator== (const IteratorImplBase &rIterator) const
 Test the equality of the this object and the given iterator. More...
 
virtual bool IsEqualSelection (const IteratorImplBase &rIterator) const
 This method is used by the equality operator. More...
 
virtual void Reverse ()
 Reverse the direction of iteration. More...
 

Protected Attributes

IteratorPosition maPosition
 The current position as returned by <member>GetPosition()</member>. More...
 
SdDrawDocumentmpDocument
 The document on whose data the iterator operates. More...
 
std::weak_ptr< ViewShellmpViewShellWeak
 Necessary secondary source of information. More...
 
bool mbDirectionIsForward
 Specifies the search direction. More...
 

Detailed Description

Base class for the polymorphic implementation class of the <type>Iterator</type> class.

The iterators based on this class are basically uni directional iterators. Their direction can, however, be reversed at any point of their life time.

Definition at line 40 of file OutlinerIteratorImpl.hxx.

Constructor & Destructor Documentation

◆ IteratorImplBase() [1/2]

sd::outliner::IteratorImplBase::IteratorImplBase ( SdDrawDocument pDocument,
const std::weak_ptr< ViewShell > &  rpViewShellWeak,
bool  bDirectionIsForward 
)

The constructor stores the given arguments to be used by the derived classes.

Parameters
pDocumentThe document provides the information to be iterated on.
pViewShellWeakSome information has to be taken from the view shell.
bDirectionIsForwardThis flag defines the iteration direction. When <TRUE> then the direction is forwards otherwise it is backwards.

Definition at line 339 of file OutlinerIterator.cxx.

References maPosition, sd::outliner::IteratorPosition::meEditMode, sd::outliner::IteratorPosition::mePageKind, mpViewShellWeak, Page, and Standard.

◆ IteratorImplBase() [2/2]

sd::outliner::IteratorImplBase::IteratorImplBase ( SdDrawDocument pDocument,
std::weak_ptr< ViewShell pViewShellWeak,
bool  bDirectionIsForward,
PageKind  ePageKind,
EditMode  eEditMode 
)

◆ ~IteratorImplBase()

sd::outliner::IteratorImplBase::~IteratorImplBase ( )
virtual

Definition at line 373 of file OutlinerIterator.cxx.

Member Function Documentation

◆ Clone()

IteratorImplBase * sd::outliner::IteratorImplBase::Clone ( IteratorImplBase pObject = nullptr) const
virtual

Create an exact copy of this object.

No argument should be specified when called from the outside. It then creates an object first and passes that to the inherited <member>Clone()</member> methods to fill in class specific information.

Returns
Returns a copy of this object. When this method is called with an argument then this value will be returned.

Reimplemented in sd::outliner::SelectionIteratorImpl, sd::outliner::ViewIteratorImpl, and sd::outliner::DocumentIteratorImpl.

Definition at line 394 of file OutlinerIterator.cxx.

References maPosition, mbDirectionIsForward, mpDocument, mpViewShellWeak, and pObject.

Referenced by sd::outliner::ViewIteratorImpl::Clone().

◆ GetPosition()

const IteratorPosition & sd::outliner::IteratorImplBase::GetPosition ( )
virtual

Return an object that describes the current object.

Returns
The returned object describes the current object pointed to by the iterator. See the description of <type>IteratorPosition</type> for details on the available information.

Reimplemented in sd::outliner::SelectionIteratorImpl.

Definition at line 389 of file OutlinerIterator.cxx.

References maPosition.

◆ GotoNextText()

virtual void sd::outliner::IteratorImplBase::GotoNextText ( )
pure virtual

Advance to the next text of the current object or to the next object.

This takes the iteration direction into account. The new object pointed to can be retrieved (among other information) by calling the <member>GetPosition</member> method.

Implemented in sd::outliner::SelectionIteratorImpl, sd::outliner::ViewIteratorImpl, and sd::outliner::DocumentIteratorImpl.

◆ IsEqualSelection()

bool sd::outliner::IteratorImplBase::IsEqualSelection ( const IteratorImplBase rIterator) const
virtual

This method is used by the equality operator.

It is part of a "multimethod" pattern.

Parameters
rIteratorThe iterator to compare to.
Returns
Returns <TRUE> when both iterators point to the same object.

Reimplemented in sd::outliner::SelectionIteratorImpl.

Definition at line 381 of file OutlinerIterator.cxx.

References maPosition.

Referenced by sd::outliner::SelectionIteratorImpl::operator==().

◆ operator==()

bool sd::outliner::IteratorImplBase::operator== ( const IteratorImplBase rIterator) const
virtual

Test the equality of the this object and the given iterator.

Two iterators are taken to be equal when they point to the same object. Iteration direction is not taken into account.

Parameters
rIteratorThe iterator to compare to.
Returns
When both iterators are equal <TRUE> is returned, <FALSE> otherwise.

Reimplemented in sd::outliner::SelectionIteratorImpl.

Definition at line 376 of file OutlinerIterator.cxx.

References maPosition.

◆ Reverse()

void sd::outliner::IteratorImplBase::Reverse ( )
virtual

Reverse the direction of iteration.

The current object stays the same.

Reimplemented in sd::outliner::ViewIteratorImpl.

Definition at line 406 of file OutlinerIterator.cxx.

References mbDirectionIsForward.

Referenced by sd::outliner::ViewIteratorImpl::Reverse().

Member Data Documentation

◆ maPosition

IteratorPosition sd::outliner::IteratorImplBase::maPosition
protected

◆ mbDirectionIsForward

bool sd::outliner::IteratorImplBase::mbDirectionIsForward
protected

◆ mpDocument

SdDrawDocument* sd::outliner::IteratorImplBase::mpDocument
protected

◆ mpViewShellWeak

std::weak_ptr<ViewShell> sd::outliner::IteratorImplBase::mpViewShellWeak
protected

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