1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
27 namespace sd
{ namespace sidebar
{
29 /** Show a list of all available master pages so that the user can assign
32 class AllMasterPagesSelector
33 : public MasterPagesSelector
35 friend class VclPtrInstance
<AllMasterPagesSelector
>;
37 static VclPtr
<vcl::Window
> Create (
39 ViewShellBase
& rViewShellBase
,
40 const css::uno::Reference
<css::ui::XSidebar
>& rxSidebar
);
42 /** Scan the set of templates for the ones whose first master pages are
43 shown by this control and store them in the MasterPageContainer.
45 virtual void Fill (ItemList
& rItemList
) override
;
48 virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent
& rEvent
) override
;
51 /** The list of master pages displayed by this class.
53 class SortedMasterPageDescriptorList
;
54 ::std::unique_ptr
<SortedMasterPageDescriptorList
> mpSortedMasterPages
;
56 AllMasterPagesSelector (
58 SdDrawDocument
& rDocument
,
60 const std::shared_ptr
<MasterPageContainer
>& rpContainer
,
61 const css::uno::Reference
<css::ui::XSidebar
>& rxSidebar
);
62 virtual ~AllMasterPagesSelector() override
;
64 void AddItem (MasterPageContainer::Token aToken
);
66 /** Add all items in the internal master page list into the given list.
68 void UpdatePageSet (ItemList
& rItemList
);
70 /** Update the internal list of master pages that are to show in the
73 void UpdateMasterPageList();
75 using MasterPagesSelector::Fill
;
78 } } // end of namespace sd::sidebar
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */