bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / sidebar / AllMasterPagesSelector.hxx
blobe63e00c5b76c695fbef0a285753e84fb5c75e420
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) SAL_OVERRIDE;
51 protected:
52 virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent& rEvent) SAL_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 ::boost::shared_ptr<MasterPageContainer>& rpContainer,
65 const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
66 virtual ~AllMasterPagesSelector();
68 void AddTemplate (const TemplateEntry& rEntry);
70 void AddItem (MasterPageContainer::Token aToken);
72 /** Add all items in the internal master page list into the given list.
74 void UpdatePageSet (ItemList& rItemList);
76 /** Update the internal list of master pages that are to show in the
77 control.
79 void UpdateMasterPageList();
81 using MasterPagesSelector::Fill;
84 } } // end of namespace sd::sidebar
86 #endif
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */