1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SD_FRAMEWORK_CENTER_VIEW_FOCUS_MODULE_HXX 25 #define SD_FRAMEWORK_CENTER_VIEW_FOCUS_MODULE_HXX 26 27 #include "MutexOwner.hxx" 28 29 #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> 30 #include <com/sun/star/drawing/framework/XConfigurationController.hpp> 31 #include <com/sun/star/frame/XController.hpp> 32 #include <osl/mutex.hxx> 33 #include <cppuhelper/compbase1.hxx> 34 35 36 namespace { 37 38 typedef ::cppu::WeakComponentImplHelper1 < 39 ::com::sun::star::drawing::framework::XConfigurationChangeListener 40 > CenterViewFocusModuleInterfaceBase; 41 42 } // end of anonymous namespace. 43 44 namespace sd { 45 46 class ViewShellBase; 47 48 } 49 50 51 52 53 namespace sd { namespace framework { 54 55 /** This module waits for new views to be created for the center pane and 56 then moves the center view to the top most place on the shell stack. As 57 we are moving away from the shell stack this module may become obsolete 58 or has to be modified. 59 */ 60 class CenterViewFocusModule 61 : private sd::MutexOwner, 62 public CenterViewFocusModuleInterfaceBase 63 { 64 public: 65 CenterViewFocusModule ( 66 ::com::sun::star::uno::Reference<com::sun::star::frame::XController>& rxController); 67 virtual ~CenterViewFocusModule (void); 68 69 virtual void SAL_CALL disposing (void); 70 71 72 // XConfigurationChangeListener 73 74 virtual void SAL_CALL notifyConfigurationChange ( 75 const com::sun::star::drawing::framework::ConfigurationChangeEvent& rEvent); 76 77 // XEventListener 78 79 virtual void SAL_CALL disposing ( 80 const com::sun::star::lang::EventObject& rEvent); 81 82 private: 83 class ViewShellContainer; 84 85 bool mbValid; 86 ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfigurationController> 87 mxConfigurationController; 88 ViewShellBase* mpBase; 89 /** This flag indicates whether in the last configuration change cycle a 90 new view has been created and thus the center view has to be moved 91 to the top of the shell stack. 92 */ 93 bool mbNewViewCreated; 94 95 /** At the end of an update of the current configuration this method 96 handles a new view in the center pane by moving the associated view 97 shell to the top of the shell stack. 98 */ 99 void HandleNewView( 100 const ::com::sun::star::uno::Reference< 101 com::sun::star::drawing::framework::XConfiguration>& rxConfiguration); 102 }; 103 104 } } // end of namespace sd::framework 105 106 #endif 107