Update ooo320-m1
[ooovba.git] / sd / source / ui / slidesorter / model / SlsPageEnumerationProvider.cxx
blob3c5c727dbf985a822daae9a4d15589e14e44c600
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlsPageEnumerationProvider.cxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #include "precompiled_sd.hxx"
34 #include "model/SlsPageEnumerationProvider.hxx"
35 #include "model/SlsPageEnumeration.hxx"
36 #include "model/SlsPageDescriptor.hxx"
37 #include <boost/function.hpp>
39 namespace sd { namespace slidesorter { namespace model {
42 namespace {
44 class AllPagesPredicate
46 public:
47 bool operator() (const SharedPageDescriptor& rpDescriptor)
49 (void)rpDescriptor;
50 return true;
58 class SelectedPagesPredicate
60 public:
61 bool operator() (const SharedPageDescriptor& rpDescriptor)
63 return rpDescriptor->IsSelected();
70 class VisiblePagesPredicate
72 public:
73 bool operator() (const SharedPageDescriptor& rpDescriptor)
75 return rpDescriptor->IsVisible();
84 PageEnumeration PageEnumerationProvider::CreateAllPagesEnumeration (
85 const SlideSorterModel& rModel)
87 // AllPagesPredicate aPredicate; // spurious warning on unxsoli4 debug=t
88 return PageEnumeration::Create(rModel, AllPagesPredicate());
94 PageEnumeration PageEnumerationProvider::CreateSelectedPagesEnumeration (
95 const SlideSorterModel& rModel)
97 return PageEnumeration::Create(
98 rModel,
99 SelectedPagesPredicate());
105 PageEnumeration PageEnumerationProvider::CreateVisiblePagesEnumeration (
106 const SlideSorterModel& rModel)
108 return PageEnumeration::Create(
109 rModel,
110 VisiblePagesPredicate());
114 } } } // end of namespace ::sd::slidesorter::model