nss: upgrade to release 3.73
[LibreOffice.git] / sd / source / core / PageListWatcher.hxx
blob11ab612e606700bd178125018ee46c12a6a97211
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_SOURCE_CORE_PAGELISTWATCHER_HXX
21 #define INCLUDED_SD_SOURCE_CORE_PAGELISTWATCHER_HXX
23 #include <pres.hxx>
24 #include <sal/types.h>
25 #include <vector>
27 class SdPage;
28 class SdrModel;
30 /** Maintain a map of page indices to page objects for faster access that
31 remains valid during deletions and insertions of pages (#109538#).
33 class ImpPageListWatcher
35 protected:
36 // typedefs for a vector of SdPages
37 typedef ::std::vector< SdPage* > SdPageVector;
39 const SdrModel& mrModel;
41 SdPageVector maPageVectorStandard;
42 SdPageVector maPageVectorNotes;
43 SdPage* mpHandoutPage;
45 bool mbPageListValid;
47 void ImpRecreateSortedPageListOnDemand();
48 virtual sal_uInt32 ImpGetPageCount() const = 0;
50 /** Return the page with the given index.
51 @param nIndex
52 When given an invalid index then NULL is returned.
54 virtual SdPage* ImpGetPage (sal_uInt32 nIndex) const = 0;
56 public:
57 explicit ImpPageListWatcher(const SdrModel& rModel);
58 virtual ~ImpPageListWatcher();
60 void Invalidate() { mbPageListValid = false; }
61 SdPage* GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum);
62 sal_uInt32 GetSdPageCount(PageKind ePgKind);
63 sal_uInt32 GetVisibleSdPageCount() const;
66 class ImpDrawPageListWatcher : public ImpPageListWatcher
68 protected:
69 virtual sal_uInt32 ImpGetPageCount() const override;
70 virtual SdPage* ImpGetPage(sal_uInt32 nIndex) const override;
72 public:
73 explicit ImpDrawPageListWatcher(const SdrModel& rModel);
74 virtual ~ImpDrawPageListWatcher() override;
77 class ImpMasterPageListWatcher : public ImpPageListWatcher
79 protected:
80 virtual sal_uInt32 ImpGetPageCount() const override;
81 virtual SdPage* ImpGetPage(sal_uInt32 nIndex) const override;
83 public:
84 explicit ImpMasterPageListWatcher(const SdrModel& rModel);
85 virtual ~ImpMasterPageListWatcher() override;
88 #endif
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */