Update ooo320-m1
[ooovba.git] / sd / source / ui / framework / factories / BasicToolBarFactory.hxx
blob95f2c103b9e8cac9c2abf472eb38f637b73f742f
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: BasicToolBarFactory.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_BASIC_TOOL_BAR_FACTORY_HXX
33 #define SD_FRAMEWORK_BASIC_TOOL_BAR_FACTORY_HXX
35 #include "MutexOwner.hxx"
37 #include <com/sun/star/lang/XInitialization.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
40 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
41 #include <com/sun/star/drawing/framework/XResourceId.hpp>
42 #include <com/sun/star/frame/XController.hpp>
43 #include <osl/mutex.hxx>
44 #include <cppuhelper/compbase3.hxx>
45 #include <cppuhelper/basemutex.hxx>
48 namespace css = ::com::sun::star;
50 namespace {
52 typedef ::cppu::WeakComponentImplHelper3 <
53 css::drawing::framework::XResourceFactory,
54 css::lang::XInitialization,
55 css::lang::XEventListener
56 > BasicToolBarFactoryInterfaceBase;
58 } // end of anonymous namespace.
60 namespace sd {
61 class ViewShellBase;
64 namespace sd { namespace framework {
66 /** This factory provides some of the frequently used tool bars:
67 private:resource/toolbar/ViewTabBar
69 class BasicToolBarFactory
70 : protected ::cppu::BaseMutex,
71 public BasicToolBarFactoryInterfaceBase
73 public:
74 BasicToolBarFactory (
75 const css::uno::Reference<com::sun::star::uno::XComponentContext>& rxContext);
76 virtual ~BasicToolBarFactory (void);
78 virtual void SAL_CALL disposing (void);
81 // ToolBarFactory
83 virtual css::uno::Reference<com::sun::star::drawing::framework::XResource> SAL_CALL
84 createResource (
85 const css::uno::Reference<
86 css::drawing::framework::XResourceId>& rxToolBarId)
87 throw (css::uno::RuntimeException);
89 virtual void SAL_CALL
90 releaseResource (
91 const css::uno::Reference<com::sun::star::drawing::framework::XResource>&
92 rxToolBar)
93 throw (css::uno::RuntimeException);
96 // XInitialization
98 virtual void SAL_CALL initialize(
99 const css::uno::Sequence<com::sun::star::uno::Any>& aArguments)
100 throw (css::uno::Exception, css::uno::RuntimeException);
103 // lang::XEventListener
105 virtual void SAL_CALL disposing (
106 const css::lang::EventObject& rEventObject)
107 throw (css::uno::RuntimeException);
109 private:
110 css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController;
111 css::uno::Reference<css::frame::XController> mxController;
112 ViewShellBase* mpViewShellBase;
114 void Shutdown (void);
116 void ThrowIfDisposed (void) const
117 throw (css::lang::DisposedException);
120 } } // end of namespace sd::framework
122 #endif