LibreOffice Module sd (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::slidesorter::model::PageEnumeration Class Referencefinal

Public class of page enumerations that delegates its calls to an implementation object that can filter pages by using a given predicate. More...

#include <SlsPageEnumeration.hxx>

Inheritance diagram for sd::slidesorter::model::PageEnumeration:
[legend]
Collaboration diagram for sd::slidesorter::model::PageEnumeration:
[legend]

Public Types

typedef ::std::function< bool(const SharedPageDescriptor &)> PagePredicate
 Create a new page enumeration that enumerates a subset of the pages of the given model. More...
 

Public Member Functions

 PageEnumeration (const PageEnumeration &rEnumeration)
 This copy constructor creates a copy of the given enumeration. More...
 
virtual ~PageEnumeration () override
 
virtual ::std::unique_ptr< Enumeration< SharedPageDescriptor > > Clone () override
 Create and return an exact copy of the called object. More...
 
PageEnumerationoperator= (const PageEnumeration &rEnumeration)
 
virtual bool HasMoreElements () const override
 Return <TRUE> when the enumeration has more elements, i.e. More...
 
virtual SharedPageDescriptor GetNextElement () override
 Return the next element of the enumeration. More...
 
virtual void Rewind () override
 Rewind the enumeration so that the next call to GetNextElement() will return its first element. More...
 
- Public Member Functions inherited from sd::slidesorter::model::Enumeration< SharedPageDescriptor >
virtual ~Enumeration ()
 
virtual bool HasMoreElements () const=0
 
virtual SharedPageDescriptor GetNextElement ()=0
 Returns T instead of T& so that it can handle shared pointers. More...
 
virtual void Rewind ()=0
 
virtual ::std::unique_ptr< Enumeration< SharedPageDescriptor > > Clone ()=0
 

Static Public Member Functions

static PageEnumeration Create (const SlideSorterModel &rModel, const PagePredicate &rPredicate)
 

Private Member Functions

 PageEnumeration (::std::unique_ptr< Enumeration< SharedPageDescriptor > > &&pImpl)
 This constructor expects an implementation object that holds the predicate that filters the pages. More...
 

Private Attributes

::std::unique_ptr< Enumeration< SharedPageDescriptor > > mpImpl
 Implementation object. More...
 

Detailed Description

Public class of page enumerations that delegates its calls to an implementation object that can filter pages by using a given predicate.

See also
PageEnumerationProvider The PageEnumerationProvider has methods for creating different types of page enumerations.

Definition at line 39 of file SlsPageEnumeration.hxx.

Member Typedef Documentation

◆ PagePredicate

Create a new page enumeration that enumerates a subset of the pages of the given model.

Parameters
rModelThe new page enumeration enumerates the pages of this model.
rPredicateThis predicate determines which pages to include in the enumeration. Pages for which rPredicate returns <FALSE> are exclude.

Definition at line 51 of file SlsPageEnumeration.hxx.

Constructor & Destructor Documentation

◆ PageEnumeration() [1/2]

sd::slidesorter::model::PageEnumeration::PageEnumeration ( const PageEnumeration rEnumeration)

This copy constructor creates a copy of the given enumeration.

Definition at line 88 of file SlsPageEnumeration.cxx.

References mpImpl.

Referenced by Clone(), and Create().

◆ ~PageEnumeration()

sd::slidesorter::model::PageEnumeration::~PageEnumeration ( )
overridevirtual

Definition at line 94 of file SlsPageEnumeration.cxx.

◆ PageEnumeration() [2/2]

sd::slidesorter::model::PageEnumeration::PageEnumeration ( ::std::unique_ptr< Enumeration< SharedPageDescriptor > > &&  pImpl)
private

This constructor expects an implementation object that holds the predicate that filters the pages.

Definition at line 82 of file SlsPageEnumeration.cxx.

Member Function Documentation

◆ Clone()

std::unique_ptr< Enumeration< SharedPageDescriptor > > sd::slidesorter::model::PageEnumeration::Clone ( )
overridevirtual

Create and return an exact copy of the called object.

Implements sd::slidesorter::model::Enumeration< SharedPageDescriptor >.

Definition at line 105 of file SlsPageEnumeration.cxx.

References PageEnumeration().

◆ Create()

PageEnumeration sd::slidesorter::model::PageEnumeration::Create ( const SlideSorterModel rModel,
const PagePredicate rPredicate 
)
static

◆ GetNextElement()

SharedPageDescriptor sd::slidesorter::model::PageEnumeration::GetNextElement ( )
overridevirtual

Return the next element of the enumeration.

Call the HasMoreElements() before to make sure that there exists at least one more element. Calling this method with HasMoreElements() returning <FALSE> is an error.

Implements sd::slidesorter::model::Enumeration< SharedPageDescriptor >.

Definition at line 116 of file SlsPageEnumeration.cxx.

References mpImpl.

Referenced by sd::slidesorter::controller::SlotManager::ChangeSlideExclusionState(), sd::slidesorter::controller::SlideSorterController::Command(), sd::slidesorter::controller::PageSelector::CountSelectedPages(), sd::slidesorter::controller::Clipboard::CreateSlideTransferable(), sd::slidesorter::controller::SelectionManager::DeleteSelectedPages(), sd::DrawViewShell::DuplicateSelectedSlides(), sd::slidesorter::controller::SlotManager::DuplicateSelectedSlides(), sd::slidesorter::controller::SlotManager::GetClipboardState(), sd::slidesorter::controller::PageSelector::GetCoreSelection(), sd::slidesorter::controller::SelectionManager::GetInsertionPosition(), sd::slidesorter::controller::SlotManager::GetMenuState(), sd::framework::ViewShellWrapper::getSelection(), sd::SdUnoSlideView::getSelection(), sd::slidesorter::controller::SlotManager::GetStatusBarState(), sd::slidesorter::controller::InsertionIndicatorHandler::IsInsertionTrivial(), sd::slidesorter::view::SlideSorterView::Layout(), sd::slidesorter::controller::SelectionFunction::MoveFocus(), sd::slidesorter::controller::SlotManager::RenameSlide(), sd::slidesorter::model::SlideSorterModel::RestoreSelection(), sd::slidesorter::model::SlideSorterModel::SaveCurrentSelection(), sd::slidesorter::controller::PageSelector::SetCoreSelection(), sd::slidesorter::model::SlideSorterModel::SetDocumentSlides(), sd::slidesorter::model::SlideSorterModel::SynchronizeDocumentSelection(), and sd::slidesorter::model::SlideSorterModel::SynchronizeModelSelection().

◆ HasMoreElements()

bool sd::slidesorter::model::PageEnumeration::HasMoreElements ( ) const
overridevirtual

Return <TRUE> when the enumeration has more elements, i.e.

it is save to call GetNextElement() at least one more time.

Implements sd::slidesorter::model::Enumeration< SharedPageDescriptor >.

Definition at line 111 of file SlsPageEnumeration.cxx.

References mpImpl.

Referenced by sd::slidesorter::controller::SlotManager::ChangeSlideExclusionState(), sd::slidesorter::controller::SlideSorterController::Command(), sd::slidesorter::controller::PageSelector::CountSelectedPages(), sd::slidesorter::controller::Clipboard::CreateSlideTransferable(), sd::slidesorter::controller::SelectionManager::DeleteSelectedPages(), sd::DrawViewShell::DuplicateSelectedSlides(), sd::slidesorter::controller::SlotManager::DuplicateSelectedSlides(), sd::slidesorter::controller::SlotManager::GetClipboardState(), sd::slidesorter::controller::PageSelector::GetCoreSelection(), sd::slidesorter::controller::SelectionManager::GetInsertionPosition(), sd::slidesorter::controller::SlotManager::GetMenuState(), sd::framework::ViewShellWrapper::getSelection(), sd::SdUnoSlideView::getSelection(), sd::slidesorter::controller::InsertionIndicatorHandler::IsInsertionTrivial(), sd::slidesorter::view::SlideSorterView::Layout(), sd::slidesorter::controller::SelectionFunction::MoveFocus(), sd::slidesorter::controller::SlotManager::RenameSlide(), sd::slidesorter::model::SlideSorterModel::RestoreSelection(), sd::slidesorter::model::SlideSorterModel::SaveCurrentSelection(), sd::slidesorter::controller::PageSelector::SetCoreSelection(), sd::slidesorter::model::SlideSorterModel::SetDocumentSlides(), sd::slidesorter::model::SlideSorterModel::SynchronizeDocumentSelection(), and sd::slidesorter::model::SlideSorterModel::SynchronizeModelSelection().

◆ operator=()

PageEnumeration & sd::slidesorter::model::PageEnumeration::operator= ( const PageEnumeration rEnumeration)

Definition at line 98 of file SlsPageEnumeration.cxx.

References mpImpl.

◆ Rewind()

void sd::slidesorter::model::PageEnumeration::Rewind ( )
overridevirtual

Rewind the enumeration so that the next call to GetNextElement() will return its first element.

Implements sd::slidesorter::model::Enumeration< SharedPageDescriptor >.

Definition at line 121 of file SlsPageEnumeration.cxx.

References mpImpl.

Referenced by sd::slidesorter::controller::Clipboard::CreateSlideTransferable().

Member Data Documentation

◆ mpImpl

::std::unique_ptr<Enumeration<SharedPageDescriptor> > sd::slidesorter::model::PageEnumeration::mpImpl
private

Implementation object.

Definition at line 85 of file SlsPageEnumeration.hxx.

Referenced by GetNextElement(), HasMoreElements(), operator=(), PageEnumeration(), and Rewind().


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