1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SD_FRAMEWORK_BASIC_PANE_FACTORY_HXX 25cdf0e10cSrcweir #define SD_FRAMEWORK_BASIC_PANE_FACTORY_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "MutexOwner.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XResourceFactory.hpp> 30cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> 31cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationController.hpp> 32cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp> 33cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 34cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 35cdf0e10cSrcweir #include <osl/mutex.hxx> 36cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 37cdf0e10cSrcweir #include <cppuhelper/compbase3.hxx> 38cdf0e10cSrcweir #include "UpdateLockManager.hxx" 39cdf0e10cSrcweir 40cdf0e10cSrcweir 41cdf0e10cSrcweir #include <boost/scoped_ptr.hpp> 42cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 43cdf0e10cSrcweir 44cdf0e10cSrcweir namespace css = ::com::sun::star; 45cdf0e10cSrcweir 46cdf0e10cSrcweir 47cdf0e10cSrcweir namespace { 48cdf0e10cSrcweir 49cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper3 < 50cdf0e10cSrcweir css::lang::XInitialization, 51cdf0e10cSrcweir css::drawing::framework::XResourceFactory, 52cdf0e10cSrcweir css::drawing::framework::XConfigurationChangeListener 53cdf0e10cSrcweir > BasicPaneFactoryInterfaceBase; 54cdf0e10cSrcweir 55cdf0e10cSrcweir } // end of anonymous namespace. 56cdf0e10cSrcweir 57cdf0e10cSrcweir 58cdf0e10cSrcweir namespace sd { 59cdf0e10cSrcweir 60cdf0e10cSrcweir class ViewShellBase; 61cdf0e10cSrcweir } 62cdf0e10cSrcweir 63cdf0e10cSrcweir namespace sd { namespace framework { 64cdf0e10cSrcweir 65cdf0e10cSrcweir /** This factory provides the frequently used standard panes 66cdf0e10cSrcweir private:resource/pane/CenterPane 67cdf0e10cSrcweir private:resource/pane/FullScreenPane 68cdf0e10cSrcweir private:resource/pane/LeftImpressPane 69cdf0e10cSrcweir private:resource/pane/LeftDrawPane 70cdf0e10cSrcweir There are two left panes because this is (seems to be) the only way to 71cdf0e10cSrcweir show different titles for the left pane in Draw and Impress. 72cdf0e10cSrcweir */ 73cdf0e10cSrcweir class BasicPaneFactory 74cdf0e10cSrcweir : private ::cppu::BaseMutex, 75cdf0e10cSrcweir public BasicPaneFactoryInterfaceBase 76cdf0e10cSrcweir { 77cdf0e10cSrcweir public: 78cdf0e10cSrcweir BasicPaneFactory ( 79cdf0e10cSrcweir const css::uno::Reference<css::uno::XComponentContext>& rxContext); 80cdf0e10cSrcweir virtual ~BasicPaneFactory (void); 81cdf0e10cSrcweir 82cdf0e10cSrcweir virtual void SAL_CALL disposing (void); 83cdf0e10cSrcweir 84cdf0e10cSrcweir 85cdf0e10cSrcweir // XInitialization 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual void SAL_CALL initialize( 88cdf0e10cSrcweir const css::uno::Sequence<css::uno::Any>& aArguments) 89cdf0e10cSrcweir throw (css::uno::Exception, css::uno::RuntimeException); 90cdf0e10cSrcweir 91cdf0e10cSrcweir 92cdf0e10cSrcweir // XResourceFactory 93cdf0e10cSrcweir 94cdf0e10cSrcweir virtual css::uno::Reference<css::drawing::framework::XResource> 95cdf0e10cSrcweir SAL_CALL createResource ( 96cdf0e10cSrcweir const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId) 97cdf0e10cSrcweir throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException); 98cdf0e10cSrcweir 99cdf0e10cSrcweir virtual void SAL_CALL 100cdf0e10cSrcweir releaseResource ( 101cdf0e10cSrcweir const css::uno::Reference<css::drawing::framework::XResource>& rxPane) 102cdf0e10cSrcweir throw (css::uno::RuntimeException); 103cdf0e10cSrcweir 104cdf0e10cSrcweir 105cdf0e10cSrcweir // XConfigurationChangeListener 106cdf0e10cSrcweir 107cdf0e10cSrcweir virtual void SAL_CALL notifyConfigurationChange ( 108cdf0e10cSrcweir const css::drawing::framework::ConfigurationChangeEvent& rEvent) 109cdf0e10cSrcweir throw (css::uno::RuntimeException); 110cdf0e10cSrcweir 111cdf0e10cSrcweir 112cdf0e10cSrcweir // lang::XEventListener 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual void SAL_CALL disposing ( 115cdf0e10cSrcweir const css::lang::EventObject& rEventObject) 116cdf0e10cSrcweir throw (css::uno::RuntimeException); 117cdf0e10cSrcweir 118cdf0e10cSrcweir private: 119cdf0e10cSrcweir css::uno::Reference<css::uno::XComponentContext> mxComponentContext; 120cdf0e10cSrcweir css::uno::WeakReference<css::drawing::framework::XConfigurationController> 121cdf0e10cSrcweir mxConfigurationControllerWeak; 122cdf0e10cSrcweir css::uno::WeakReference<css::frame::XController> mxControllerWeak; 123cdf0e10cSrcweir ViewShellBase* mpViewShellBase; 124cdf0e10cSrcweir class PaneDescriptor; 125cdf0e10cSrcweir class PaneContainer; 126cdf0e10cSrcweir ::boost::scoped_ptr<PaneContainer> mpPaneContainer; 127cdf0e10cSrcweir bool mbFirstUpdateSeen; 128cdf0e10cSrcweir ::boost::shared_ptr<UpdateLockManager> mpUpdateLockManager; 129cdf0e10cSrcweir 130cdf0e10cSrcweir /** Create a new instance of FrameWindowPane. 131cdf0e10cSrcweir @param rPaneId 132cdf0e10cSrcweir There is only one frame window so this id is just checked to 133cdf0e10cSrcweir have the correct value. 134cdf0e10cSrcweir */ 135cdf0e10cSrcweir css::uno::Reference<css::drawing::framework::XResource> 136cdf0e10cSrcweir CreateFrameWindowPane ( 137cdf0e10cSrcweir const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId); 138cdf0e10cSrcweir 139cdf0e10cSrcweir /** Create a new pane that represents the center pane in full screen 140cdf0e10cSrcweir mode. 141cdf0e10cSrcweir */ 142cdf0e10cSrcweir css::uno::Reference<css::drawing::framework::XResource> 143cdf0e10cSrcweir CreateFullScreenPane ( 144cdf0e10cSrcweir const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext, 145cdf0e10cSrcweir const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId); 146cdf0e10cSrcweir 147cdf0e10cSrcweir /** Create a new instance of ChildWindowPane. 148cdf0e10cSrcweir @param rPaneId 149cdf0e10cSrcweir The ResourceURL member defines which side pane to create. 150cdf0e10cSrcweir */ 151cdf0e10cSrcweir css::uno::Reference<css::drawing::framework::XResource> 152cdf0e10cSrcweir CreateChildWindowPane ( 153cdf0e10cSrcweir const css::uno::Reference< 154cdf0e10cSrcweir css::drawing::framework::XResourceId>& rxPaneId, 155cdf0e10cSrcweir const PaneDescriptor& rDescriptor); 156cdf0e10cSrcweir 157cdf0e10cSrcweir void ThrowIfDisposed (void) const 158cdf0e10cSrcweir throw (css::lang::DisposedException); 159cdf0e10cSrcweir }; 160cdf0e10cSrcweir 161cdf0e10cSrcweir } } // end of namespace sd::framework 162cdf0e10cSrcweir 163cdf0e10cSrcweir #endif 164