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

Iterator for iteration over all objects in a single view. More...

#include <OutlinerIteratorImpl.hxx>

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

Public Member Functions

 ViewIteratorImpl (sal_Int32 nPageIndex, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
 
 ViewIteratorImpl (sal_Int32 nPageIndex, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward, PageKind ePageKind, EditMode eEditMode)
 
virtual ~ViewIteratorImpl () override
 
virtual void GotoNextText () override
 Advance to the next text of the current object or to the next object. More...
 
virtual IteratorImplBaseClone (IteratorImplBase *pObject=nullptr) const override
 Create an exact copy of this object. More...
 
virtual void Reverse () override
 Reverse the direction of iteration. 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...
 

Protected Member Functions

void SetPage (sal_Int32 nPageIndex)
 Set up page pointer and object list iterator for the specified page. More...
 

Private Member Functions

ViewIteratorImploperator= (const ViewIteratorImpl &)=delete
 

Private Attributes

bool mbPageChangeOccurred
 Indicates whether a page changed occurred on switching to current page. More...
 
SdPagempPage
 Pointer to the page associated with the current page index. May be NULL. More...
 
std::optional< SdrObjListItermoObjectIterator
 Iterator of all objects on the current page. More...
 

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 for iteration over all objects in a single view.

On reaching the last object on the last page (or the first object on the first page) the view is not switched. Further calls to the <member>GotoNextObject()</member> method will be ignored.

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

Definition at line 166 of file OutlinerIteratorImpl.hxx.

Constructor & Destructor Documentation

◆ ViewIteratorImpl() [1/2]

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

Definition at line 507 of file OutlinerIterator.cxx.

References mpPage, and SetPage().

Referenced by Clone().

◆ ViewIteratorImpl() [2/2]

sd::outliner::ViewIteratorImpl::ViewIteratorImpl ( sal_Int32  nPageIndex,
SdDrawDocument pDocument,
const std::weak_ptr< ViewShell > &  rpViewShellWeak,
bool  bDirectionIsForward,
PageKind  ePageKind,
EditMode  eEditMode 
)

Definition at line 519 of file OutlinerIterator.cxx.

References mpPage, and SetPage().

◆ ~ViewIteratorImpl()

sd::outliner::ViewIteratorImpl::~ViewIteratorImpl ( )
overridevirtual

Definition at line 533 of file OutlinerIterator.cxx.

Member Function Documentation

◆ Clone()

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

Reimplemented in sd::outliner::DocumentIteratorImpl.

Definition at line 537 of file OutlinerIterator.cxx.

References sd::outliner::IteratorImplBase::Clone(), unotools::WeakReference< class interface_type >::get(), sd::outliner::IteratorImplBase::maPosition, sd::outliner::IteratorImplBase::mbDirectionIsForward, sd::outliner::IteratorPosition::mnPageIndex, moObjectIterator, sd::outliner::IteratorImplBase::mpDocument, mpPage, sd::outliner::IteratorImplBase::mpViewShellWeak, sd::outliner::IteratorPosition::mxObject, pObject, and ViewIteratorImpl().

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

◆ GotoNextText()

void sd::outliner::ViewIteratorImpl::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.

Reimplemented in sd::outliner::DocumentIteratorImpl.

Definition at line 562 of file OutlinerIterator.cxx.

References DynCastSdrTextObj(), unotools::WeakReference< class interface_type >::get(), SdrTextObj::getTextCount(), sd::outliner::IteratorImplBase::maPosition, sd::outliner::IteratorImplBase::mbDirectionIsForward, sd::outliner::IteratorPosition::mnPageIndex, sd::outliner::IteratorPosition::mnText, moObjectIterator, mpPage, sd::outliner::IteratorPosition::mxObject, and SetPage().

Referenced by sd::outliner::DocumentIteratorImpl::GotoNextText().

◆ operator=()

ViewIteratorImpl & sd::outliner::ViewIteratorImpl::operator= ( const ViewIteratorImpl )
privatedelete

◆ Reverse()

void sd::outliner::ViewIteratorImpl::Reverse ( )
overridevirtual

◆ SetPage()

void sd::outliner::ViewIteratorImpl::SetPage ( sal_Int32  nPageIndex)
protected

Member Data Documentation

◆ mbPageChangeOccurred

bool sd::outliner::ViewIteratorImpl::mbPageChangeOccurred
private

Indicates whether a page changed occurred on switching to current page.

Definition at line 198 of file OutlinerIteratorImpl.hxx.

Referenced by SetPage().

◆ moObjectIterator

std::optional<SdrObjListIter> sd::outliner::ViewIteratorImpl::moObjectIterator
private

Iterator of all objects on the current page.

Definition at line 202 of file OutlinerIteratorImpl.hxx.

Referenced by Clone(), GotoNextText(), Reverse(), and SetPage().

◆ mpPage

SdPage* sd::outliner::ViewIteratorImpl::mpPage
private

Pointer to the page associated with the current page index. May be NULL.

Definition at line 200 of file OutlinerIteratorImpl.hxx.

Referenced by Clone(), GotoNextText(), Reverse(), and SetPage().


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