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_CURRENT_MASTER_PAGES_SELECTOR_HXX
237a32b0c8SAndre Fischer #define SD_SIDEBAR_PANELS_CURRENT_MASTER_PAGES_SELECTOR_HXX
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include "MasterPagesSelector.hxx"
26cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
27cdf0e10cSrcweir 
287a32b0c8SAndre Fischer 
297a32b0c8SAndre Fischer namespace css = ::com::sun::star;
307a32b0c8SAndre Fischer namespace cssu = ::com::sun::star::uno;
317a32b0c8SAndre Fischer 
327a32b0c8SAndre Fischer 
33cdf0e10cSrcweir namespace sd { namespace tools { class EventMultiplexerEvent; } }
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
367a32b0c8SAndre Fischer namespace sd { namespace sidebar {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
39cdf0e10cSrcweir /** Show the master pages currently used by a SdDrawDocument.
40cdf0e10cSrcweir */
41cdf0e10cSrcweir class CurrentMasterPagesSelector
42cdf0e10cSrcweir     : public MasterPagesSelector,
43cdf0e10cSrcweir       public SfxListener
44cdf0e10cSrcweir {
45cdf0e10cSrcweir public:
467a32b0c8SAndre Fischer     static MasterPagesSelector* Create (
477a32b0c8SAndre Fischer         ::Window* pParent,
487a32b0c8SAndre Fischer         ViewShellBase& rViewShellBase,
49*02c50d82SAndre Fischer         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     /** Set the selection so that the master page is selected that is
52cdf0e10cSrcweir         used by the currently selected page of the document in the
53cdf0e10cSrcweir         center pane.
54cdf0e10cSrcweir     */
55cdf0e10cSrcweir     virtual void UpdateSelection (void);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     /** Copy all master pages that are to be shown into the given list.
58cdf0e10cSrcweir     */
59cdf0e10cSrcweir     virtual void Fill (ItemList& rItemList);
60cdf0e10cSrcweir 
617a32b0c8SAndre Fischer 	using MasterPagesSelector::Fill;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir protected:
64cdf0e10cSrcweir     virtual ResId GetContextMenuResId (void) const;
65*02c50d82SAndre Fischer 
66*02c50d82SAndre Fischer     virtual void ProcessPopupMenu (Menu& rMenu);
67*02c50d82SAndre Fischer     virtual void ExecuteCommand (const sal_Int32 nCommandId);
68*02c50d82SAndre Fischer 
69cdf0e10cSrcweir private:
707a32b0c8SAndre Fischer     cssu::Reference<css::lang::XComponent> mxListener;
717a32b0c8SAndre Fischer 
727a32b0c8SAndre Fischer     CurrentMasterPagesSelector (
737a32b0c8SAndre Fischer         ::Window* pParent,
747a32b0c8SAndre Fischer         SdDrawDocument& rDocument,
757a32b0c8SAndre Fischer         ViewShellBase& rBase,
76*02c50d82SAndre Fischer         const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
77*02c50d82SAndre Fischer         const cssu::Reference<css::ui::XSidebar>& rxSidebar);
787a32b0c8SAndre Fischer     virtual ~CurrentMasterPagesSelector (void);
797a32b0c8SAndre Fischer 
807a32b0c8SAndre Fischer     virtual void LateInit (void);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent*);
83cdf0e10cSrcweir     void Notify (SfxBroadcaster&, const SfxHint& rHint);
84cdf0e10cSrcweir };
85cdf0e10cSrcweir 
867a32b0c8SAndre Fischer } } // end of namespace sd::sidebar
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif
89