LibreOffice Module sd (master) 1
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sd::ViewShellManager Class Reference

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...
 
SfxShellGetShell (ShellId nId) const
 Return the first, i.e. More...
 
SfxShellGetTopShell () const
 Return the top-most shell on the SFX shell stack regardless of whether that is a view shell or a sub shell. More...
 
SfxShellGetTopViewShell () 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
 

Detailed Description

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.

Member Typedef Documentation

◆ SharedShellFactory

Definition at line 57 of file ViewShellManager.hxx.

Constructor & Destructor Documentation

◆ ViewShellManager()

sd::ViewShellManager::ViewShellManager ( ViewShellBase rBase)

Definition at line 225 of file ViewShellManager.cxx.

References mbValid.

◆ ~ViewShellManager()

sd::ViewShellManager::~ViewShellManager ( )

Before the destructor is called the method Shutdown() has to have been called.

Definition at line 231 of file ViewShellManager.cxx.

Member Function Documentation

◆ ActivateShell()

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().

◆ ActivateSubShell()

void sd::ViewShellManager::ActivateSubShell ( const ViewShell rParentShell,
ShellId  nId 
)

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.

Parameters
rParentShellThe new sub shell will be placed above this view shell.
nIdThis id is used only with the factory registered for the parent view shell.

Definition at line 272 of file ViewShellManager.cxx.

References mbValid, mpImpl, and nId.

◆ ActivateViewShell()

void sd::ViewShellManager::ActivateViewShell ( ViewShell pViewShell)

Activate the given view shell.

Definition at line 251 of file ViewShellManager.cxx.

References mbValid, and mpImpl.

◆ AddSubShellFactory()

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.

References mbValid, and mpImpl.

◆ DeactivateShell()

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().

◆ DeactivateSubShell()

void sd::ViewShellManager::DeactivateSubShell ( const ViewShell rParentShell,
ShellId  nId 
)

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().

◆ 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.

Parameters
pShellThe shell to deactivate.

Definition at line 257 of file ViewShellManager.cxx.

References mbValid, and mpImpl.

Referenced by sd::ViewShellManager::Implementation::Shutdown().

◆ GetShell()

SfxShell * sd::ViewShellManager::GetShell ( ShellId  nId) const

Return the first, i.e.

top most, view shell that has been activated under the given id.

Parameters
nIdThe id of the shell for which to return a pointer.
Returns
When the specified shell is currently not active then NULL is returned.

Definition at line 308 of file ViewShellManager.cxx.

References mbValid, mpImpl, and nId.

◆ GetTopShell()

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.

References mbValid, and mpImpl.

◆ GetTopViewShell()

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.

References mbValid, and mpImpl.

◆ InvalidateAllSubShells()

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.

References mbValid, and mpImpl.

◆ LockUpdate()

void sd::ViewShellManager::LockUpdate ( )
private

Definition at line 341 of file ViewShellManager.cxx.

References mpImpl.

◆ MoveToTop()

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.

Parameters
nIdThe 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().

◆ RemoveSubShellFactory()

void sd::ViewShellManager::RemoveSubShellFactory ( ViewShell const *  pViewShell,
const SharedShellFactory rpFactory 
)

Definition at line 243 of file ViewShellManager.cxx.

References mbValid, and mpImpl.

◆ SetFormShell()

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.

Parameters
pParentShellThe view shell of the form shell.
pFormShellThe form shell.
bAboveWhen <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.

References mbValid, and mpImpl.

◆ Shutdown()

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().

◆ UnlockUpdate()

void sd::ViewShellManager::UnlockUpdate ( )
private

Definition at line 346 of file ViewShellManager.cxx.

References mpImpl.

Friends And Related Function Documentation

◆ UpdateLock

friend class UpdateLock
friend

Definition at line 181 of file ViewShellManager.hxx.

Member Data Documentation

◆ mbValid

bool sd::ViewShellManager::mbValid
private

◆ mpImpl

std::unique_ptr<ViewShellManager::Implementation, o3tl::default_delete<ViewShellManager::Implementation> > sd::ViewShellManager::mpImpl
private

The documentation for this class was generated from the following files: