33class PageEnumerationImpl
38 const SlideSorterModel& rModel,
39 PageEnumeration::PagePredicate aPredicate);
40 PageEnumerationImpl(
const PageEnumerationImpl&) =
delete;
41 PageEnumerationImpl& operator=(
const PageEnumerationImpl&) =
delete;
44 virtual ::std::unique_ptr<Enumeration<SharedPageDescriptor> >
Clone()
override;
46 virtual bool HasMoreElements()
const override;
48 virtual void Rewind()
override;
51 const SlideSorterModel&
mrModel;
52 const PageEnumeration::PagePredicate maPredicate;
60 const SlideSorterModel& rModel,
61 PageEnumeration::PagePredicate aPredicate,
67 void AdvanceToNextValidElement();
79 new PageEnumerationImpl(rModel, rPredicate)));
84 : mpImpl(
std::move(pImpl))
107 return ::std::unique_ptr<Enumeration<SharedPageDescriptor> >(
113 return mpImpl->HasMoreElements();
118 return mpImpl->GetNextElement();
130PageEnumerationImpl::PageEnumerationImpl (
131 const SlideSorterModel& rModel,
132 PageEnumeration::PagePredicate aPredicate)
134 maPredicate(
std::move(aPredicate)),
140PageEnumerationImpl::PageEnumerationImpl (
141 const SlideSorterModel& rModel,
145 maPredicate(
std::move(aPredicate)),
150::std::unique_ptr<Enumeration<SharedPageDescriptor> >
153 return ::std::unique_ptr<Enumeration<SharedPageDescriptor> >(
154 new PageEnumerationImpl(mrModel,maPredicate,mnIndex));
157bool PageEnumerationImpl::HasMoreElements()
const
159 return (mnIndex <
mrModel.GetPageCount());
168 AdvanceToNextValidElement();
173void PageEnumerationImpl::Rewind()
177 AdvanceToNextValidElement();
180void PageEnumerationImpl::AdvanceToNextValidElement()
182 while (mnIndex <
mrModel.GetPageCount())
187 if (pDescriptor && maPredicate(pDescriptor))
Public class of page enumerations that delegates its calls to an implementation object that can filte...
virtual SharedPageDescriptor GetNextElement() override
Return the next element of the enumeration.
PageEnumeration & operator=(const PageEnumeration &rEnumeration)
PageEnumeration(const PageEnumeration &rEnumeration)
This copy constructor creates a copy of the given enumeration.
virtual bool HasMoreElements() const override
Return <TRUE> when the enumeration has more elements, i.e.
static PageEnumeration Create(const SlideSorterModel &rModel, const PagePredicate &rPredicate)
virtual ~PageEnumeration() override
virtual void Rewind() override
Rewind the enumeration so that the next call to GetNextElement() will return its first element.
virtual ::std::unique_ptr< Enumeration< SharedPageDescriptor > > Clone() override
Create and return an exact copy of the called object.
::std::function< bool(const SharedPageDescriptor &)> PagePredicate
Create a new page enumeration that enumerates a subset of the pages of the given model.
::std::unique_ptr< Enumeration< SharedPageDescriptor > > mpImpl
Implementation object.
The model of the slide sorter gives access to the slides that are to be displayed in the slide sorter...
std::shared_ptr< PageDescriptor > SharedPageDescriptor
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)