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_TOOLPANEL_CONTROLS_CURRENT_MASTER_PAGES_SELECTOR_HXX
25 #define SD_TOOLPANEL_CONTROLS_CURRENT_MASTER_PAGES_SELECTOR_HXX
26 
27 #include "MasterPagesSelector.hxx"
28 #include <com/sun/star/lang/XComponent.hpp>
29 
30 namespace sd { namespace tools { class EventMultiplexerEvent; } }
31 
32 
33 namespace sd { namespace toolpanel { namespace controls {
34 
35 
36 /** Show the master pages currently used by a SdDrawDocument.
37 */
38 class CurrentMasterPagesSelector
39     : public MasterPagesSelector,
40       public SfxListener
41 {
42 public:
43     CurrentMasterPagesSelector (
44         TreeNode* pParent,
45         SdDrawDocument& rDocument,
46         ViewShellBase& rBase,
47         const ::boost::shared_ptr<MasterPageContainer>& rpContainer);
48     virtual ~CurrentMasterPagesSelector (void);
49 
50     virtual void LateInit (void);
51 
52     /** Set the selection so that the master page is selected that is
53         used by the currently selected page of the document in the
54         center pane.
55     */
56     virtual void UpdateSelection (void);
57 
58     /** Copy all master pages that are to be shown into the given list.
59     */
60     virtual void Fill (ItemList& rItemList);
61 
62 	using sd::toolpanel::controls::MasterPagesSelector::Fill;
63 
64 protected:
65     virtual ResId GetContextMenuResId (void) const;
66     virtual void Execute (SfxRequest& rRequest);
67     virtual void GetState (SfxItemSet& rItemSet);
68 
69 private:
70     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
71         mxListener;
72 
73     DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent*);
74     void Notify (SfxBroadcaster&, const SfxHint& rHint);
75 };
76 
77 } } } // end of namespace ::sd::toolpanel::controls
78 
79 #endif
80