LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::outliner::SelectionIteratorImpl Class Referencefinal

Iterator all objects that belong to the current mark list a.k.a. More...

#include <OutlinerIteratorImpl.hxx>

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

Public Member Functions

 SelectionIteratorImpl (const ::std::vector< ::unotools::WeakReference< SdrObject > > &rObjectList, sal_Int32 nObjectIndex, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
 
 SelectionIteratorImpl (const SelectionIteratorImpl &rObject)
 
virtual ~SelectionIteratorImpl () override
 
virtual void GotoNextText () override
 Advance to the next text of the current object or to the next object. More...
 
virtual const IteratorPositionGetPosition () override
 Return an object that describes the current object. More...
 
virtual IteratorImplBaseClone (IteratorImplBase *pObject=nullptr) const override
 Create an exact copy of this object. More...
 
virtual bool operator== (const IteratorImplBase &rIterator) const override
 Test the equality of the this object and the given iterator. More...
 
- Public Member Functions inherited from 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. 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...
 

Private Member Functions

virtual bool IsEqualSelection (const IteratorImplBase &rIterator) const override
 Compare the given iterator with this object. More...
 
IteratorImplBaseoperator= (const IteratorImplBase &rIterator)
 

Private Attributes

const ::std::vector<::unotools::WeakReference< SdrObject > > & mrObjectList
 
sal_Int32 mnObjectIndex
 

Additional Inherited Members

- Protected Attributes inherited from sd::outliner::IteratorImplBase
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

Iterator all objects that belong to the current mark list a.k.a.

selection. It is assumed that all marked objects belong to the same page. It is further assumed that the mark list does not change while an iterator is alive. It is therefore the responsibility of an iterator's owner to handle the case of a changed mark list.

For documentation of the methods please refer to the base class <type>IteratorImplBase</type>.

Definition at line 124 of file OutlinerIteratorImpl.hxx.

Constructor & Destructor Documentation

◆ SelectionIteratorImpl() [1/2]

sd::outliner::SelectionIteratorImpl::SelectionIteratorImpl ( const ::std::vector< ::unotools::WeakReference< SdrObject > > &  rObjectList,
sal_Int32  nObjectIndex,
SdDrawDocument pDocument,
const std::weak_ptr< ViewShell > &  rpViewShellWeak,
bool  bDirectionIsForward 
)

Definition at line 413 of file OutlinerIterator.cxx.

Referenced by Clone().

◆ SelectionIteratorImpl() [2/2]

sd::outliner::SelectionIteratorImpl::SelectionIteratorImpl ( const SelectionIteratorImpl rObject)

◆ ~SelectionIteratorImpl()

sd::outliner::SelectionIteratorImpl::~SelectionIteratorImpl ( )
overridevirtual

Definition at line 425 of file OutlinerIterator.cxx.

Member Function Documentation

◆ Clone()

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

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 from sd::outliner::IteratorImplBase.

Definition at line 428 of file OutlinerIterator.cxx.

References sd::outliner::IteratorImplBase::mbDirectionIsForward, mnObjectIndex, sd::outliner::IteratorImplBase::mpDocument, sd::outliner::IteratorImplBase::mpViewShellWeak, mrObjectList, pObject, and SelectionIteratorImpl().

◆ GetPosition()

const IteratorPosition & sd::outliner::SelectionIteratorImpl::GetPosition ( )
overridevirtual

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 from sd::outliner::IteratorImplBase.

Definition at line 485 of file OutlinerIterator.cxx.

References sd::outliner::IteratorImplBase::maPosition, mnObjectIndex, mrObjectList, and sd::outliner::IteratorPosition::mxObject.

◆ GotoNextText()

void sd::outliner::SelectionIteratorImpl::GotoNextText ( )
overridevirtual

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.

Implements sd::outliner::IteratorImplBase.

Definition at line 437 of file OutlinerIterator.cxx.

References DynCastSdrTextObj(), SdrTextObj::getTextCount(), sd::outliner::IteratorImplBase::maPosition, sd::outliner::IteratorImplBase::mbDirectionIsForward, mnObjectIndex, sd::outliner::IteratorPosition::mnText, and mrObjectList.

◆ IsEqualSelection()

bool sd::outliner::SelectionIteratorImpl::IsEqualSelection ( const IteratorImplBase rIterator) const
overrideprivatevirtual

Compare the given iterator with this object.

This method handles only the case that the given iterator is an instance of this class.

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

Reimplemented from sd::outliner::IteratorImplBase.

Definition at line 497 of file OutlinerIterator.cxx.

References mnObjectIndex, and sd::outliner::IteratorImplBase::mpDocument.

◆ operator=()

IteratorImplBase & sd::outliner::SelectionIteratorImpl::operator= ( const IteratorImplBase rIterator)
private

◆ operator==()

bool sd::outliner::SelectionIteratorImpl::operator== ( const IteratorImplBase rIterator) const
overridevirtual

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 from sd::outliner::IteratorImplBase.

Definition at line 492 of file OutlinerIterator.cxx.

References sd::outliner::IteratorImplBase::IsEqualSelection().

Member Data Documentation

◆ mnObjectIndex

sal_Int32 sd::outliner::SelectionIteratorImpl::mnObjectIndex
private

Definition at line 144 of file OutlinerIteratorImpl.hxx.

Referenced by Clone(), GetPosition(), GotoNextText(), and IsEqualSelection().

◆ mrObjectList

const ::std::vector<::unotools::WeakReference<SdrObject> >& sd::outliner::SelectionIteratorImpl::mrObjectList
private

Definition at line 143 of file OutlinerIteratorImpl.hxx.

Referenced by Clone(), GetPosition(), and GotoNextText().


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