1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_SIDEBAR_PANELS_RECENT_MASTER_PAGES_SELECTOR_HXX
25 #define SD_SIDEBAR_PANELS_RECENT_MASTER_PAGES_SELECTOR_HXX
26 
27 #include "MasterPagesSelector.hxx"
28 
29 namespace sd { namespace sidebar {
30 
31 
32 /** Show the recently used master pages (that are not currently used).
33 */
34 class RecentMasterPagesSelector
35     : public MasterPagesSelector
36 {
37 public:
38     static MasterPagesSelector* Create (
39         ::Window* pParent,
40         ViewShellBase& rViewShellBase,
41         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
42 
43 protected:
44     DECL_LINK(MasterPageListListener, void*);
45     virtual void Fill (ItemList& rItemList);
46 
47 	using sd::sidebar::MasterPagesSelector::Fill;
48 
49     /** Forward this call to the base class but save and restore the
50         currently selected item.
51         Assign the given master page to the list of pages.
52         @param pMasterPage
53             This master page will usually be a member of the list of all
54             available master pages as provided by the MasterPageContainer.
55         @param rPageList
56             The pages to which to assign the master page.  These pages may
57             be slides or master pages themselves.
58     */
59     virtual void AssignMasterPageToPageList (
60         SdPage* pMasterPage,
61         const ::boost::shared_ptr<std::vector<SdPage*> >& rpPageList);
62 
63     virtual void ProcessPopupMenu (Menu& rMenu);
64 
65 private:
66     RecentMasterPagesSelector (
67         ::Window* pParent,
68         SdDrawDocument& rDocument,
69         ViewShellBase& rBase,
70         const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
71         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
72     virtual ~RecentMasterPagesSelector (void);
73 
74     virtual void LateInit (void);
75 };
76 
77 } } // end of namespace sd::sidebar
78 
79 #endif
80