Update ooo320-m1
[ooovba.git] / sd / source / ui / framework / module / ToolBarModule.hxx
blob36c4a1a7fa2899d8640f9b06cfbf2407cfb15916
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ToolBarModule.hxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_FRAMEWORK_TOOL_BAR_MODULE_HXX
33 #define SD_FRAMEWORK_TOOL_BAR_MODULE_HXX
35 #include "ToolBarManager.hxx"
36 #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
37 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
38 #include <com/sun/star/drawing/framework/XTabBar.hpp>
39 #include <com/sun/star/frame/XController.hpp>
40 #include <osl/mutex.hxx>
41 #include <cppuhelper/basemutex.hxx>
42 #include <cppuhelper/compbase1.hxx>
43 #include <boost/scoped_ptr.hpp>
45 namespace css = ::com::sun::star;
47 namespace sd {
48 class ViewShellBase;
53 namespace sd { namespace framework {
55 namespace {
56 typedef ::cppu::WeakComponentImplHelper1 <
57 ::css::drawing::framework::XConfigurationChangeListener
58 > ToolBarModuleInterfaceBase;
62 /** This module is responsible for locking the ToolBarManager during
63 configuration updates and for triggering ToolBarManager updates.
65 class ToolBarModule
66 : private ::cppu::BaseMutex,
67 public ToolBarModuleInterfaceBase
69 public:
70 /** Create a new module.
71 @param rxController
72 This is the access point to the drawing framework.
74 ToolBarModule (
75 const css::uno::Reference<css::frame::XController>& rxController);
76 virtual ~ToolBarModule (void);
78 virtual void SAL_CALL disposing (void);
81 // XConfigurationChangeListener
83 virtual void SAL_CALL notifyConfigurationChange (
84 const css::drawing::framework::ConfigurationChangeEvent& rEvent)
85 throw (css::uno::RuntimeException);
87 // XEventListener
89 virtual void SAL_CALL disposing (
90 const css::lang::EventObject& rEvent)
91 throw (css::uno::RuntimeException);
93 private:
94 css::uno::Reference<
95 css::drawing::framework::XConfigurationController> mxConfigurationController;
96 ViewShellBase* mpBase;
97 ::boost::scoped_ptr<ToolBarManager::UpdateLock> mpToolBarManagerLock;
98 bool mbMainViewSwitchUpdatePending;
100 void HandleUpdateStart (void);
101 void HandleUpdateEnd (void);
104 } } // end of namespace sd::framework
106 #endif