fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / inc / FormShellManager.hxx
blobf78a0958d1c59234edeb066b315ea25527436a91
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 SD_FORM_SHELL_MANAGER_HXX
21 #define SD_FORM_SHELL_MANAGER_HXX
23 #include <ViewShellManager.hxx>
25 #include <tools/link.hxx>
26 #include <svl/lstner.hxx>
28 class VclWindowEvent;
29 class FmFormShell;
31 namespace sd { namespace tools { class EventMultiplexerEvent; } }
33 namespace sd {
35 class ViewShellBase;
37 /** This simple class is responsible for putting the form shell above or
38 below the main view shell on the shell stack maintained by the ObjectBarManager.
40 The form shell is moved above the view shell when the form shell is
41 activated, i.e. the FormControlActivated handler is called.
43 It is moved below the view shell when the main window of the
44 main view shell is focused.
46 The form shell is created and destroyed by the ViewShellManager by using
47 a factory object provided by the FormShellManager.
49 class FormShellManager
50 : public SfxListener
52 public:
53 FormShellManager (ViewShellBase& rBase);
54 virtual ~FormShellManager (void);
56 /** Typically called by a ShellFactory. It tells the
57 FormShellManager which form shell to manage.
58 @param pFormShell
59 This may be <NULL/> to disconnect the ViewShellManager from the
60 form shell.
62 void SetFormShell (FmFormShell* pFormShell);
64 /** Return the form shell last set with SetFormShell().
65 @return
66 The result may be <NULL/> when the SetFormShell() method has not
67 yet been called or was last called with <NULL/>.
69 FmFormShell* GetFormShell (void);
71 private:
72 ViewShellBase& mrBase;
74 /** Ownership of the form shell lies with the ViewShellManager. This
75 reference is kept so that the FormShellManager can detect when a new
76 form shell is passed to SetFormShell().
78 FmFormShell* mpFormShell;
80 /** Remember whether the form shell is currently above or below the main
81 view shell.
83 bool mbFormShellAboveViewShell;
85 /** The factory is remembered so that it removed from the
86 ViewShellManager when the FormShellManager is destroyed.
88 ViewShellManager::SharedShellFactory mpSubShellFactory;
90 bool mbIsMainViewChangePending;
92 ::Window* mpMainViewShellWindow;
94 /** Register at window of center pane and at the form shell that
95 represents the form tool bar. The former informs this manager about
96 the deselection of the form shell. The later informs about its
97 selection.
99 void RegisterAtCenterPane (void);
101 /** Unregister the listeners that were registered in
102 RegisterAtCenterPane().
104 void UnregisterAtCenterPane (void);
106 /** This call back is called by the application window (among others)
107 when the window gets the focus. In this case the form shell is
108 moved to the bottom of the shell stack.
110 DECL_LINK(WindowEventHandler, VclWindowEvent*);
112 /** This call back is called when view in the center pane is replaced.
113 When this happens then we unregister at the window of the old and
114 register at the window of the new shell.
116 DECL_LINK(ConfigurationUpdateHandler, ::sd::tools::EventMultiplexerEvent*);
118 /** This call back is called by the form shell when it gets the focus.
119 In this case the form shell is moved to the top of the shell stack.
121 DECL_LINK(FormControlActivated, void *);
123 /** This method is called by the form shell when that is destroyed. It
124 acts as a last resort against referencing a dead form shell. With
125 the factory working properly this method should not be necessary
126 (and may be removed in the future.)
128 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
131 } // end of namespace sd
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */