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

This class wraps the <type>SdOutliner</type> class and represents it as a container of <type>SdrObject</type> objects. More...

#include <OutlinerIterator.hxx>

Collaboration diagram for sd::outliner::OutlinerContainer:
[legend]

Public Member Functions

 OutlinerContainer (SdOutliner *pOutliner)
 Create a new wrapper object for the given outliner. More...
 
Iterator begin ()
 Return an iterator that points to the first object of one of the sets described above. More...
 
Iterator end ()
 Return an iterator that marks the end of the iteration. More...
 
Iterator current ()
 Return an iterator that points to the current object of one of the sets described above. More...
 

Private Member Functions

Iterator CreateIterator (IteratorLocation aLocation)
 Create an iterator. More...
 
 OutlinerContainer (const OutlinerContainer &)=delete
 
OutlinerContaineroperator= (const OutlinerContainer &)=delete
 

Static Private Member Functions

static Iterator CreateSelectionIterator (const ::std::vector<::unotools::WeakReference< SdrObject > > &rObjectList, SdDrawDocument *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, bool bDirectionIsForward, IteratorLocation aLocation)
 Create an iterator that iterates over all currently selected <type>SdrObjects</type> objects of the <member>mpOutliner</member> outliner. More...
 
static Iterator CreateDocumentIterator (SdDrawDocument *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, bool bDirectionIsForward, IteratorLocation aLocation)
 Create an iterator that iterates over all <type>SdrObjects</type> objects of the <member>mpOutliner</member> outliner. More...
 
static sal_Int32 GetPageIndex (SdDrawDocument const *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, PageKind ePageKind, EditMode eEditMode, bool bDirectionIsForward, IteratorLocation aLocation)
 Return the index of a page that contains an object that a new iterator shall point to. More...
 

Private Attributes

SdOutlinermpOutliner
 The wrapped outliner that is represented as object container. More...
 

Detailed Description

This class wraps the <type>SdOutliner</type> class and represents it as a container of <type>SdrObject</type> objects.

Its main purpose is to provide iterators for certain sub-sets of those objects. These sub-sets are a) the set of the currently selected objects, b) all objects in the current view, and c) all objects in all views.

The direction of the returned iterators depends on the underlying <type>SdOutliner</type> object and is usually set in the search dialog.

Definition at line 153 of file OutlinerIterator.hxx.

Constructor & Destructor Documentation

◆ OutlinerContainer() [1/2]

sd::outliner::OutlinerContainer::OutlinerContainer ( SdOutliner pOutliner)

Create a new wrapper object for the given outliner.

Parameters
pOutlinerThe outliner that is represented by the new object as <type>SdrObject</type> container.

Definition at line 130 of file OutlinerIterator.cxx.

◆ OutlinerContainer() [2/2]

sd::outliner::OutlinerContainer::OutlinerContainer ( const OutlinerContainer )
privatedelete

Member Function Documentation

◆ begin()

Iterator sd::outliner::OutlinerContainer::begin ( )

Return an iterator that points to the first object of one of the sets described above.

This takes also into account the direction of iteration.

Returns
The returned iterator points either to the first (forward search) or to the last object (backward search) of the set.

Definition at line 135 of file OutlinerIterator.cxx.

References sd::outliner::BEGIN, and CreateIterator().

Referenced by SdOutliner::EndOfSearch(), SdOutliner::Initialize(), and SdOutliner::SearchAndReplaceAll().

◆ CreateDocumentIterator()

Iterator sd::outliner::OutlinerContainer::CreateDocumentIterator ( SdDrawDocument pDocument,
const std::shared_ptr< ViewShell > &  rpViewShell,
bool  bDirectionIsForward,
IteratorLocation  aLocation 
)
staticprivate

Create an iterator that iterates over all <type>SdrObjects</type> objects of the <member>mpOutliner</member> outliner.

Parameters
pDocumentThe document to which the objects belong.
pViewShellThe view shell which displays the objects.
bDirectionIsForwardThe direction of iteration. It defaults to forward.
aLocationThis specifies at which object the iterator points initially.

Definition at line 211 of file OutlinerIterator.cxx.

References sd::outliner::BEGIN, sd::outliner::CURRENT, sd::outliner::END, GetPageIndex(), Handout, MasterPage, Page, and Standard.

Referenced by CreateIterator().

◆ CreateIterator()

Iterator sd::outliner::OutlinerContainer::CreateIterator ( IteratorLocation  aLocation)
private

Create an iterator.

The object pointed to depends on the search direction retrieved from the outliner object <member>mpOutliner</member> and the given location.

Parameters
aLocationThis specifies whether the returned iterator points to the first, (one past the) last, or current object.
Returns
Returns an iterator as constructed by <member>CreateSelectionIterator()</member>,

Definition at line 150 of file OutlinerIterator.cxx.

References CreateDocumentIterator(), CreateSelectionIterator(), SdOutliner::maMarkListCopy, SdOutliner::mbDirectionIsForward, SdOutliner::mbRestrictSearchToSelection, SdOutliner::mpDrawDocument, mpOutliner, and SdOutliner::mpWeakViewShell.

Referenced by begin(), current(), and end().

◆ CreateSelectionIterator()

Iterator sd::outliner::OutlinerContainer::CreateSelectionIterator ( const ::std::vector<::unotools::WeakReference< SdrObject > > &  rObjectList,
SdDrawDocument pDocument,
const std::shared_ptr< ViewShell > &  rpViewShell,
bool  bDirectionIsForward,
IteratorLocation  aLocation 
)
staticprivate

Create an iterator that iterates over all currently selected <type>SdrObjects</type> objects of the <member>mpOutliner</member> outliner.

Parameters
rObjectListList of currently selected objects. This list is necessary so that the selection can be changed without affecting the iterator.
pDocumentThe document to which the objects belong.
pViewShellThe view shell which displays the objects.
bDirectionIsForwardThe direction of iteration. It defaults to forward.
aLocationThis specifies at which object the iterator points initially.

Definition at line 171 of file OutlinerIterator.cxx.

References sd::outliner::BEGIN, sd::outliner::CURRENT, and sd::outliner::END.

Referenced by CreateIterator().

◆ current()

Iterator sd::outliner::OutlinerContainer::current ( )

Return an iterator that points to the current object of one of the sets described above.

This takes also into account the direction of iteration.

Returns
The returned iterator points either to the first (forward search) or to the last object (backward search) of the set of selected objects or of the current page if the search set spans more than one page.

Definition at line 145 of file OutlinerIterator.cxx.

References CreateIterator(), and sd::outliner::CURRENT.

Referenced by SdOutliner::DetectChange(), SdOutliner::Initialize(), and SdOutliner::SearchAndReplaceOnce().

◆ end()

Iterator sd::outliner::OutlinerContainer::end ( )

Return an iterator that marks the end of the iteration.

This takes also into account the direction of iteration. The object pointed to is not valid.

Returns
The returned iterator points either to that object past the last one (forward search) or to the one in front of the first (backward search).

Definition at line 140 of file OutlinerIterator.cxx.

References CreateIterator(), and sd::outliner::END.

◆ GetPageIndex()

sal_Int32 sd::outliner::OutlinerContainer::GetPageIndex ( SdDrawDocument const *  pDocument,
const std::shared_ptr< ViewShell > &  rpViewShell,
PageKind  ePageKind,
EditMode  eEditMode,
bool  bDirectionIsForward,
IteratorLocation  aLocation 
)
staticprivate

Return the index of a page that contains an object that a new iterator shall point to.

This page index depends primarily on the location, iteration direction, as well as on edit mode and page kind.

Parameters
pDocumentThe document to which the page belongs.
pViewShellThe view shell which displays the page.
ePageKindSpecifies the view the page belongs to.
eEditModeSpecifies whether the page is a master page.
bDirectionIsForwardThe direction of iteration.
aLocationThis specifies at which object the iterator points initially.

Definition at line 275 of file OutlinerIterator.cxx.

References sd::outliner::BEGIN, sd::outliner::CURRENT, sd::outliner::END, SdDrawDocument::GetMasterSdPageCount(), SdrPage::GetPageNum(), SdDrawDocument::GetSdPageCount(), MasterPage, and Page.

Referenced by CreateDocumentIterator().

◆ operator=()

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

Member Data Documentation

◆ mpOutliner

SdOutliner* sd::outliner::OutlinerContainer::mpOutliner
private

The wrapped outliner that is represented as object container.

Definition at line 195 of file OutlinerIterator.hxx.

Referenced by CreateIterator().


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