LibreOffice Module sd (master) 1
SlsPageEnumerationProvider.cxx
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
23
24namespace sd::slidesorter::model {
25
26namespace {
27
28class AllPagesPredicate
29{
30public:
31 bool operator() (const SharedPageDescriptor&) const
32 {
33 return true;
34 }
35};
36
37class SelectedPagesPredicate
38{
39public:
40 bool operator() (const SharedPageDescriptor& rpDescriptor)
41 {
42 return rpDescriptor->HasState(PageDescriptor::ST_Selected);
43 }
44};
45
46class VisiblePagesPredicate
47{
48public:
49 bool operator() (const SharedPageDescriptor& rpDescriptor)
50 {
51 return rpDescriptor->HasState(PageDescriptor::ST_Visible);
52 }
53};
54
55}
56
58 const SlideSorterModel& rModel)
59{
60 return PageEnumeration::Create(rModel, AllPagesPredicate());
61}
62
64 const SlideSorterModel& rModel)
65{
67 rModel,
68 SelectedPagesPredicate());
69}
70
72 const SlideSorterModel& rModel)
73{
75 rModel,
76 VisiblePagesPredicate());
77}
78
79} // end of namespace ::sd::slidesorter::model
80
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static PageEnumeration CreateAllPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over all slides of the given model.
static PageEnumeration CreateVisiblePagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over the slides (partially) inside the visible area.
static PageEnumeration CreateSelectedPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over the currently selected slides of the given model.
Public class of page enumerations that delegates its calls to an implementation object that can filte...
static PageEnumeration Create(const SlideSorterModel &rModel, const PagePredicate &rPredicate)
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