merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / framework / module / CenterViewFocusModule.hxx
blobc3fcdcacc10c91d62d5cea3452731128b4278209
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: CenterViewFocusModule.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_FRAMEWORK_CENTER_VIEW_FOCUS_MODULE_HXX
32 #define SD_FRAMEWORK_CENTER_VIEW_FOCUS_MODULE_HXX
34 #include "MutexOwner.hxx"
36 #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
37 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
38 #include <com/sun/star/frame/XController.hpp>
39 #include <osl/mutex.hxx>
40 #include <cppuhelper/compbase1.hxx>
43 namespace {
45 typedef ::cppu::WeakComponentImplHelper1 <
46 ::com::sun::star::drawing::framework::XConfigurationChangeListener
47 > CenterViewFocusModuleInterfaceBase;
49 } // end of anonymous namespace.
51 namespace sd {
53 class ViewShellBase;
60 namespace sd { namespace framework {
62 /** This module waits for new views to be created for the center pane and
63 then moves the center view to the top most place on the shell stack. As
64 we are moving away from the shell stack this module may become obsolete
65 or has to be modified.
67 class CenterViewFocusModule
68 : private sd::MutexOwner,
69 public CenterViewFocusModuleInterfaceBase
71 public:
72 CenterViewFocusModule (
73 ::com::sun::star::uno::Reference<com::sun::star::frame::XController>& rxController);
74 virtual ~CenterViewFocusModule (void);
76 virtual void SAL_CALL disposing (void);
79 // XConfigurationChangeListener
81 virtual void SAL_CALL notifyConfigurationChange (
82 const com::sun::star::drawing::framework::ConfigurationChangeEvent& rEvent)
83 throw (com::sun::star::uno::RuntimeException);
85 // XEventListener
87 virtual void SAL_CALL disposing (
88 const com::sun::star::lang::EventObject& rEvent)
89 throw (com::sun::star::uno::RuntimeException);
91 private:
92 class ViewShellContainer;
94 bool mbValid;
95 ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfigurationController>
96 mxConfigurationController;
97 ViewShellBase* mpBase;
98 /** This flag indicates whether in the last configuration change cycle a
99 new view has been created and thus the center view has to be moved
100 to the top of the shell stack.
102 bool mbNewViewCreated;
104 /** At the end of an update of the current configuration this method
105 handles a new view in the center pane by moving the associated view
106 shell to the top of the shell stack.
108 void HandleNewView(
109 const ::com::sun::star::uno::Reference<
110 com::sun::star::drawing::framework::XConfiguration>& rxConfiguration);
113 } } // end of namespace sd::framework
115 #endif