1c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c45d927aSAndrew Rist  * distributed with this work for additional information
6c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10c45d927aSAndrew Rist  *
11c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12c45d927aSAndrew Rist  *
13c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17c45d927aSAndrew Rist  * specific language governing permissions and limitations
18c45d927aSAndrew Rist  * under the License.
19c45d927aSAndrew Rist  *
20c45d927aSAndrew Rist  *************************************************************/
21c45d927aSAndrew Rist 
227a32b0c8SAndre Fischer #ifndef SD_SIDEBAR_PANELS_ALL_MASTER_PAGES_SELECTOR_HXX
237a32b0c8SAndre Fischer #define SD_SIDEBAR_PANELS_ALL_MASTER_PAGES_SELECTOR_HXX
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include "MasterPagesSelector.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <memory>
28cdf0e10cSrcweir 
297a32b0c8SAndre Fischer namespace sd { namespace sidebar {
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir /** Show a list of all available master pages so that the user can assign
33cdf0e10cSrcweir     them to the document.
34cdf0e10cSrcweir */
35cdf0e10cSrcweir class AllMasterPagesSelector
36cdf0e10cSrcweir     : public MasterPagesSelector
37cdf0e10cSrcweir {
38cdf0e10cSrcweir public:
397a32b0c8SAndre Fischer     static MasterPagesSelector* Create (
407a32b0c8SAndre Fischer         ::Window* pParent,
417a32b0c8SAndre Fischer         ViewShellBase& rViewShellBase,
42*02c50d82SAndre Fischer         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
43*02c50d82SAndre Fischer 
44cdf0e10cSrcweir     /** Scan the set of templates for the ones whose first master pages are
45cdf0e10cSrcweir         shown by this control and store them in the MasterPageContainer.
46cdf0e10cSrcweir     */
47cdf0e10cSrcweir     virtual void Fill (ItemList& rItemList);
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     virtual void GetState (SfxItemSet& rItemSet);
50cdf0e10cSrcweir 
51cdf0e10cSrcweir protected:
52cdf0e10cSrcweir     virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent& rEvent);
53cdf0e10cSrcweir 
54cdf0e10cSrcweir private:
55cdf0e10cSrcweir     /** The list of master pages displayed by this class.
56cdf0e10cSrcweir     */
57cdf0e10cSrcweir     class SortedMasterPageDescriptorList;
58cdf0e10cSrcweir     ::std::auto_ptr<SortedMasterPageDescriptorList> mpSortedMasterPages;
59cdf0e10cSrcweir 
607a32b0c8SAndre Fischer     AllMasterPagesSelector (
617a32b0c8SAndre Fischer         ::Window* pParent,
627a32b0c8SAndre Fischer         SdDrawDocument& rDocument,
637a32b0c8SAndre Fischer         ViewShellBase& rBase,
64*02c50d82SAndre Fischer         const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
65*02c50d82SAndre Fischer         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
667a32b0c8SAndre Fischer     virtual ~AllMasterPagesSelector (void);
677a32b0c8SAndre Fischer 
68cdf0e10cSrcweir     void AddTemplate (const TemplateEntry& rEntry);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     /** This filter returns <TRUE/> when the master page specified by the
71cdf0e10cSrcweir         given file name belongs to the set of Impress master pages.
72cdf0e10cSrcweir     */
73cdf0e10cSrcweir     bool FileFilter (const String& sFileName);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     void AddItem (MasterPageContainer::Token aToken);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     /** Add all items in the internal master page list into the given list.
78cdf0e10cSrcweir     */
79cdf0e10cSrcweir     void UpdatePageSet (ItemList& rItemList);
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     /** Update the internal list of master pages that are to show in the
82cdf0e10cSrcweir         control.
83cdf0e10cSrcweir     */
84cdf0e10cSrcweir     void UpdateMasterPageList (void);
85cdf0e10cSrcweir 
867a32b0c8SAndre Fischer 	using MasterPagesSelector::Fill;
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
897a32b0c8SAndre Fischer } } // end of namespace sd::sidebar
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif
92