1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_TOOLPANEL_CONTROLS_CURRENT_MASTER_PAGES_SELECTOR_HXX
29 #define SD_TOOLPANEL_CONTROLS_CURRENT_MASTER_PAGES_SELECTOR_HXX
30 
31 #include "MasterPagesSelector.hxx"
32 #include <com/sun/star/lang/XComponent.hpp>
33 
34 namespace sd { namespace tools { class EventMultiplexerEvent; } }
35 
36 
37 namespace sd { namespace toolpanel { namespace controls {
38 
39 
40 /** Show the master pages currently used by a SdDrawDocument.
41 */
42 class CurrentMasterPagesSelector
43     : public MasterPagesSelector,
44       public SfxListener
45 {
46 public:
47     CurrentMasterPagesSelector (
48         TreeNode* pParent,
49         SdDrawDocument& rDocument,
50         ViewShellBase& rBase,
51         const ::boost::shared_ptr<MasterPageContainer>& rpContainer);
52     virtual ~CurrentMasterPagesSelector (void);
53 
54     virtual void LateInit (void);
55 
56     /** Set the selection so that the master page is selected that is
57         used by the currently selected page of the document in the
58         center pane.
59     */
60     virtual void UpdateSelection (void);
61 
62     /** Copy all master pages that are to be shown into the given list.
63     */
64     virtual void Fill (ItemList& rItemList);
65 
66 	using sd::toolpanel::controls::MasterPagesSelector::Fill;
67 
68 protected:
69     virtual ResId GetContextMenuResId (void) const;
70     virtual void Execute (SfxRequest& rRequest);
71     virtual void GetState (SfxItemSet& rItemSet);
72 
73 private:
74     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
75         mxListener;
76 
77     DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent*);
78     void Notify (SfxBroadcaster&, const SfxHint& rHint);
79 };
80 
81 } } } // end of namespace ::sd::toolpanel::controls
82 
83 #endif
84