bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / framework / module / CenterViewFocusModule.hxx
blobaf911dbef097c45b9d3119afa84f7faf066c23a1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_CENTERVIEWFOCUSMODULE_HXX
21 #define INCLUDED_SD_SOURCE_UI_FRAMEWORK_MODULE_CENTERVIEWFOCUSMODULE_HXX
23 #include "MutexOwner.hxx"
25 #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
26 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
27 #include <com/sun/star/frame/XController.hpp>
28 #include <osl/mutex.hxx>
29 #include <cppuhelper/compbase1.hxx>
31 namespace {
33 typedef ::cppu::WeakComponentImplHelper1 <
34 ::com::sun::star::drawing::framework::XConfigurationChangeListener
35 > CenterViewFocusModuleInterfaceBase;
37 } // end of anonymous namespace.
39 namespace sd {
41 class ViewShellBase;
45 namespace sd { namespace framework {
47 /** This module waits for new views to be created for the center pane and
48 then moves the center view to the top most place on the shell stack. As
49 we are moving away from the shell stack this module may become obsolete
50 or has to be modified.
52 class CenterViewFocusModule
53 : private sd::MutexOwner,
54 public CenterViewFocusModuleInterfaceBase
56 public:
57 CenterViewFocusModule (
58 ::com::sun::star::uno::Reference<com::sun::star::frame::XController>& rxController);
59 virtual ~CenterViewFocusModule();
61 virtual void SAL_CALL disposing() SAL_OVERRIDE;
63 // XConfigurationChangeListener
65 virtual void SAL_CALL notifyConfigurationChange (
66 const com::sun::star::drawing::framework::ConfigurationChangeEvent& rEvent)
67 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 // XEventListener
71 virtual void SAL_CALL disposing (
72 const com::sun::star::lang::EventObject& rEvent)
73 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 private:
76 class ViewShellContainer;
78 bool mbValid;
79 ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfigurationController>
80 mxConfigurationController;
81 ViewShellBase* mpBase;
82 /** This flag indicates whether in the last configuration change cycle a
83 new view has been created and thus the center view has to be moved
84 to the top of the shell stack.
86 bool mbNewViewCreated;
88 /** At the end of an update of the current configuration this method
89 handles a new view in the center pane by moving the associated view
90 shell to the top of the shell stack.
92 void HandleNewView(
93 const ::com::sun::star::uno::Reference<
94 com::sun::star::drawing::framework::XConfiguration>& rxConfiguration);
97 } } // end of namespace sd::framework
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */