LibreOffice Module sd (master) 1
SlsPageEnumeration.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
24
25#include <functional>
26#include <memory>
27
29{
30class SlideSorterModel;
31
39class PageEnumeration final : public Enumeration<SharedPageDescriptor>
40{
41public:
51 typedef ::std::function<bool(const SharedPageDescriptor&)> PagePredicate;
52 static PageEnumeration Create(const SlideSorterModel& rModel, const PagePredicate& rPredicate);
53
56 PageEnumeration(const PageEnumeration& rEnumeration);
57
58 virtual ~PageEnumeration() override;
59
62 virtual ::std::unique_ptr<Enumeration<SharedPageDescriptor>> Clone() override;
63
64 PageEnumeration& operator=(const PageEnumeration& rEnumeration);
65
69 virtual bool HasMoreElements() const override;
70
76 virtual SharedPageDescriptor GetNextElement() override;
77
81 virtual void Rewind() override;
82
83private:
85 ::std::unique_ptr<Enumeration<SharedPageDescriptor>> mpImpl;
86
90 PageEnumeration(::std::unique_ptr<Enumeration<SharedPageDescriptor>>&& pImpl);
91};
92
93} // end of namespace ::sd::slidesorter::model
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Interface to generic enumerations.
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 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