LibreOffice Module sd (master) 1
|
The ViewShellManager has the responsibility to manage the view shells and sub shells on the SFX shell stack. More...
#include <ViewShellManager.hxx>
Classes | |
class | Implementation |
class | UpdateLock |
Use this class to safely lock updates of the view shell stack. More... | |
Public Types | |
typedef std::shared_ptr< ShellFactory< SfxShell > > | SharedShellFactory |
Public Member Functions | |
ViewShellManager (ViewShellBase &rBase) | |
~ViewShellManager () | |
Before the destructor is called the method Shutdown() has to have been called. More... | |
void | Shutdown () |
Tell a ViewShellManager object to prepare to be deleted, i.e. More... | |
void | AddSubShellFactory (ViewShell const *pViewShell, const SharedShellFactory &rpFactory) |
Set the factory for sub shells of the specified view shell. More... | |
void | RemoveSubShellFactory (ViewShell const *pViewShell, const SharedShellFactory &rpFactory) |
void | ActivateViewShell (ViewShell *pViewShell) |
Activate the given view shell. More... | |
void | ActivateShell (SfxShell *pShell) |
Activate the given shell which is not a view shell. More... | |
void | DeactivateViewShell (const ViewShell *pShell) |
Deactivate the specified shell, i.e. More... | |
void | DeactivateShell (const SfxShell *pShell) |
Deactivate the specified shell. More... | |
void | SetFormShell (const ViewShell *pParentShell, FmFormShell *pFormShell, bool bAbove) |
Associate the form shell with a view shell and their relative position. More... | |
void | ActivateSubShell (const ViewShell &rParentShell, ShellId nId) |
Activate the specified shell as sub shell for the given view shell. More... | |
void | DeactivateSubShell (const ViewShell &rParentShell, ShellId nId) |
Deactivate the specified sub shell. More... | |
void | InvalidateAllSubShells (ViewShell const *pViewShell) |
Send all sub shells of the specified view shell an Invalidate() call. More... | |
void | MoveToTop (const ViewShell &rShell) |
Move the specified view shell to the top most position on the stack of view shells in relation to the other view shells. More... | |
SfxShell * | GetShell (ShellId nId) const |
Return the first, i.e. More... | |
SfxShell * | GetTopShell () const |
Return the top-most shell on the SFX shell stack regardless of whether that is a view shell or a sub shell. More... | |
SfxShell * | GetTopViewShell () const |
Return the top-most active view shell on the internal shell stack. More... | |
Private Member Functions | |
void | LockUpdate () |
void | UnlockUpdate () |
Private Attributes | |
std::unique_ptr< ViewShellManager::Implementation, o3tl::default_delete< ViewShellManager::Implementation > > | mpImpl |
bool | mbValid |
Friends | |
class | UpdateLock |
The ViewShellManager has the responsibility to manage the view shells and sub shells on the SFX shell stack.
They form a two level hierarchy (the underlying ViewShellBase, the only true SfxViewShell descendant, forms a third level.) On the first level there are the view shells (what formerly was called view shell, anyway; nowadays they are derived from SfxShell) and shells for panes. On the second level there are sub shells (also derived from SfxShell) that usually are tool bars.
On the SFX shell stack the regular sub shells are placed above their view shells. The FormShell is a special case. With the SetFormShell() method it can be placed directly above or below one of the view shells.
Shells managed by this class are created by factories or are given directly to Activate... methods. For the sub shells there is one factory for every view shell. Factories are added or removed via the (Add|Remove)SubShellFactory() methods. The FormShell is managed with the factory of its view shell.
Definition at line 54 of file ViewShellManager.hxx.
typedef std::shared_ptr<ShellFactory<SfxShell> > sd::ViewShellManager::SharedShellFactory |
Definition at line 57 of file ViewShellManager.hxx.
sd::ViewShellManager::ViewShellManager | ( | ViewShellBase & | rBase | ) |
Definition at line 225 of file ViewShellManager.cxx.
References mbValid.
sd::ViewShellManager::~ViewShellManager | ( | ) |
Before the destructor is called the method Shutdown() has to have been called.
Definition at line 231 of file ViewShellManager.cxx.
void sd::ViewShellManager::ActivateShell | ( | SfxShell * | pShell | ) |
Activate the given shell which is not a view shell.
For view shells use the ActivateViewShell() method.
Definition at line 290 of file ViewShellManager.cxx.
References mbValid, and mpImpl.
Referenced by sd::ViewShellManager::Implementation::ActivateShell(), and sd::ViewShellManager::Implementation::ActivateViewShell().
Activate the specified shell as sub shell for the given view shell.
The sub shell factory associated with the view shell is used to create the sub shell.
rParentShell | The new sub shell will be placed above this view shell. |
nId | This id is used only with the factory registered for the parent view shell. |
Definition at line 272 of file ViewShellManager.cxx.
void sd::ViewShellManager::ActivateViewShell | ( | ViewShell * | pViewShell | ) |
Activate the given view shell.
Definition at line 251 of file ViewShellManager.cxx.
void sd::ViewShellManager::AddSubShellFactory | ( | ViewShell const * | pViewShell, |
const SharedShellFactory & | rpFactory | ||
) |
Set the factory for sub shells of the specified view shell.
Definition at line 235 of file ViewShellManager.cxx.
void sd::ViewShellManager::DeactivateShell | ( | const SfxShell * | pShell | ) |
Deactivate the specified shell.
The shell is not destroyed.
Definition at line 296 of file ViewShellManager.cxx.
References mbValid, and mpImpl.
Referenced by sd::ViewShellManager::Implementation::Shutdown().
Deactivate the specified sub shell.
Definition at line 278 of file ViewShellManager.cxx.
References mbValid, mpImpl, and nId.
Referenced by sd::ViewShellManager::Implementation::DeactivateShell(), and sd::ViewShellManager::Implementation::DeactivateViewShell().
void sd::ViewShellManager::DeactivateViewShell | ( | const ViewShell * | pShell | ) |
Deactivate the specified shell, i.e.
take it and all of its object bars from the shell stack.
pShell | The shell to deactivate. |
Definition at line 257 of file ViewShellManager.cxx.
References mbValid, and mpImpl.
Referenced by sd::ViewShellManager::Implementation::Shutdown().
Return the first, i.e.
top most, view shell that has been activated under the given id.
nId | The id of the shell for which to return a pointer. |
Definition at line 308 of file ViewShellManager.cxx.
SfxShell * sd::ViewShellManager::GetTopShell | ( | ) | const |
Return the top-most shell on the SFX shell stack regardless of whether that is a view shell or a sub shell.
Definition at line 316 of file ViewShellManager.cxx.
SfxShell * sd::ViewShellManager::GetTopViewShell | ( | ) | const |
Return the top-most active view shell on the internal shell stack.
Definition at line 324 of file ViewShellManager.cxx.
void sd::ViewShellManager::InvalidateAllSubShells | ( | ViewShell const * | pViewShell | ) |
Send all sub shells of the specified view shell an Invalidate() call.
This does not modify the shell stack.
Definition at line 284 of file ViewShellManager.cxx.
|
private |
Definition at line 341 of file ViewShellManager.cxx.
References mpImpl.
void sd::ViewShellManager::MoveToTop | ( | const ViewShell & | rShell | ) |
Move the specified view shell to the top most position on the stack of view shells in relation to the other view shells.
After this the only shells that are higher on the stack are its object bars.
Call this method after a focus change to bring a view mode view shell and is associated tool bar shells to the top of the stack.
The mbKeepMainViewShellOnTop flag is not obeyed.
nId | The id of the shell to move to the top. |
Definition at line 302 of file ViewShellManager.cxx.
References mbValid, and mpImpl.
Referenced by sd::IMPL_LINK().
void sd::ViewShellManager::RemoveSubShellFactory | ( | ViewShell const * | pViewShell, |
const SharedShellFactory & | rpFactory | ||
) |
Definition at line 243 of file ViewShellManager.cxx.
void sd::ViewShellManager::SetFormShell | ( | const ViewShell * | pParentShell, |
FmFormShell * | pFormShell, | ||
bool | bAbove | ||
) |
Associate the form shell with a view shell and their relative position.
This method does not change the shell stack, it just stores the given values for the next shell stack update.
pParentShell | The view shell of the form shell. |
pFormShell | The form shell. |
bAbove | When <TRUE> then the form shell will be placed directly above pViewShell on the SFX shell stack. Otherwise the form shell is placed directly below the view shell. |
Definition at line 263 of file ViewShellManager.cxx.
void sd::ViewShellManager::Shutdown | ( | ) |
Tell a ViewShellManager object to prepare to be deleted, i.e.
to destroy all of its resources and to ignore all following calls. Use this when the owner of the view shell manager is about being destroyed but the view shell manager itself can not yet be deleted.
Definition at line 332 of file ViewShellManager.cxx.
References mbValid, and mpImpl.
Referenced by sd::ViewShellManager::Implementation::~Implementation().
|
private |
Definition at line 346 of file ViewShellManager.cxx.
References mpImpl.
|
friend |
Definition at line 181 of file ViewShellManager.hxx.
|
private |
Definition at line 188 of file ViewShellManager.hxx.
Referenced by ActivateShell(), ActivateSubShell(), ActivateViewShell(), AddSubShellFactory(), DeactivateShell(), DeactivateSubShell(), DeactivateViewShell(), GetShell(), GetTopShell(), GetTopViewShell(), InvalidateAllSubShells(), MoveToTop(), RemoveSubShellFactory(), SetFormShell(), and Shutdown().
|
private |
Definition at line 187 of file ViewShellManager.hxx.
Referenced by ActivateShell(), ActivateSubShell(), ActivateViewShell(), AddSubShellFactory(), DeactivateShell(), DeactivateSubShell(), DeactivateViewShell(), GetShell(), GetTopShell(), GetTopViewShell(), InvalidateAllSubShells(), LockUpdate(), MoveToTop(), RemoveSubShellFactory(), SetFormShell(), Shutdown(), and UnlockUpdate().