update dev300-m58
[ooovba.git] / sd / source / ui / inc / FormShellManager.hxx
blobd1c99cff44b2a96d96b95447a7a91416b2fa8d08
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: FormShellManager.hxx,v $
10 * $Revision: 1.10.34.1 $
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_FORM_SHELL_MANAGER_HXX
32 #define SD_FORM_SHELL_MANAGER_HXX
34 #include <ViewShellManager.hxx>
36 #include <tools/link.hxx>
37 #include <svtools/lstner.hxx>
39 class VclWindowEvent;
40 class FmFormShell;
42 namespace sd { namespace tools { class EventMultiplexerEvent; } }
44 namespace sd {
46 class PaneManagerEvent;
47 class ViewShell;
48 class ViewShellBase;
50 /** This simple class is responsible for putting the form shell above or
51 below the main view shell on the shell stack maintained by the ObjectBarManager.
53 The form shell is moved above the view shell when the form shell is
54 activated, i.e. the FormControlActivated handler is called.
56 It is moved below the view shell when the main window of the
57 main view shell is focused.
59 The form shell is created and destroyed by the ViewShellManager by using
60 a factory object provided by the FormShellManager.
62 class FormShellManager
63 : public SfxListener
65 public:
66 FormShellManager (ViewShellBase& rBase);
67 virtual ~FormShellManager (void);
69 /** Typically called by a ShellFactory. It tells the
70 FormShellManager which form shell to manage.
71 @param pFormShell
72 This may be <NULL/> to disconnect the ViewShellManager from the
73 form shell.
75 void SetFormShell (FmFormShell* pFormShell);
77 /** Return the form shell last set with SetFormShell().
78 @return
79 The result may be <NULL/> when the SetFormShell() method has not
80 yet been called or was last called with <NULL/>.
82 FmFormShell* GetFormShell (void);
84 private:
85 ViewShellBase& mrBase;
87 /** Ownership of the form shell lies with the ViewShellManager. This
88 reference is kept so that the FormShellManager can detect when a new
89 form shell is passed to SetFormShell().
91 FmFormShell* mpFormShell;
93 /** Remember whether the form shell is currently above or below the main
94 view shell.
96 bool mbFormShellAboveViewShell;
98 /** The factory is remembered so that it removed from the
99 ViewShellManager when the FormShellManager is destroyed.
101 ViewShellManager::SharedShellFactory mpSubShellFactory;
103 bool mbIsMainViewChangePending;
105 ::Window* mpMainViewShellWindow;
107 /** Register at window of center pane and at the form shell that
108 represents the form tool bar. The former informs this manager about
109 the deselection of the form shell. The later informs about its
110 selection.
112 void RegisterAtCenterPane (void);
114 /** Unregister the listeners that were registered in
115 RegisterAtCenterPane().
117 void UnregisterAtCenterPane (void);
119 /** This call back is called by the application window (among others)
120 when the window gets the focus. In this case the form shell is
121 moved to the bottom of the shell stack.
123 DECL_LINK(WindowEventHandler, VclWindowEvent*);
125 /** This call back is called when view in the center pane is replaced.
126 When this happens then we unregister at the window of the old and
127 register at the window of the new shell.
129 DECL_LINK(ConfigurationUpdateHandler, ::sd::tools::EventMultiplexerEvent*);
131 /** This call back is called by the form shell when it gets the focus.
132 In this case the form shell is moved to the top of the shell stack.
134 DECL_LINK(FormControlActivated, FmFormShell*);
136 /** This method is called by the form shell when that is destroyed. It
137 acts as a last resort against referencing a dead form shell. With
138 the factory working properly this method should not be necessary
139 (and may be removed in the future.)
141 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
144 } // end of namespace sd
146 #endif