Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / sidebar / AllMasterPagesSelector.hxx
blobb5f2c0c912a281f402b23f62fffb68e7e80107b3
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_UI_SIDEBAR_ALLMASTERPAGESSELECTOR_HXX
21 #define INCLUDED_SD_SOURCE_UI_SIDEBAR_ALLMASTERPAGESSELECTOR_HXX
23 #include "MasterPagesSelector.hxx"
25 #include <memory>
27 namespace sd {
28 class TemplateEntry;
31 namespace sd { namespace sidebar {
33 /** Show a list of all available master pages so that the user can assign
34 them to the document.
36 class AllMasterPagesSelector
37 : public MasterPagesSelector
39 friend class VclPtrInstance<AllMasterPagesSelector>;
40 public:
41 static VclPtr<vcl::Window> Create (
42 vcl::Window* pParent,
43 ViewShellBase& rViewShellBase,
44 const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
46 /** Scan the set of templates for the ones whose first master pages are
47 shown by this control and store them in the MasterPageContainer.
49 virtual void Fill (ItemList& rItemList) override;
51 protected:
52 virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent& rEvent) override;
54 private:
55 /** The list of master pages displayed by this class.
57 class SortedMasterPageDescriptorList;
58 ::std::unique_ptr<SortedMasterPageDescriptorList> mpSortedMasterPages;
60 AllMasterPagesSelector (
61 vcl::Window* pParent,
62 SdDrawDocument& rDocument,
63 ViewShellBase& rBase,
64 const std::shared_ptr<MasterPageContainer>& rpContainer,
65 const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
66 virtual ~AllMasterPagesSelector() override;
68 void AddItem (MasterPageContainer::Token aToken);
70 /** Add all items in the internal master page list into the given list.
72 void UpdatePageSet (ItemList& rItemList);
74 /** Update the internal list of master pages that are to show in the
75 control.
77 void UpdateMasterPageList();
79 using MasterPagesSelector::Fill;
82 } } // end of namespace sd::sidebar
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */