LibreOffice Module sd (master) 1
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
sd::ViewShellManager::Implementation Class Reference
Collaboration diagram for sd::ViewShellManager::Implementation:
[legend]

Classes

class  ShellHash
 
class  UpdateLock
 

Public Member Functions

 Implementation (ViewShellBase &rBase)
 
 ~Implementation () COVERITY_NOEXCEPT_FALSE
 
void AddShellFactory (const SfxShell *pViewShell, const SharedShellFactory &rpFactory)
 
void RemoveShellFactory (const SfxShell *pViewShell, const SharedShellFactory &rpFactory)
 
void ActivateViewShell (ViewShell *pViewShell)
 
void DeactivateViewShell (const ViewShell &rShell)
 
void ActivateShell (SfxShell &rShell)
 
void DeactivateShell (const SfxShell &rShell)
 
void ActivateShell (const ShellDescriptor &rDescriptor)
 
void SetFormShell (const ViewShell *pViewShell, FmFormShell *pFormShell, bool bAbove)
 
void ActivateSubShell (const SfxShell &rParentShell, ShellId nId)
 
void DeactivateSubShell (const SfxShell &rParentShell, ShellId nId)
 
void MoveToTop (const SfxShell &rParentShell)
 
SfxShellGetShell (ShellId nId) const
 
SfxShellGetTopShell () const
 
SfxShellGetTopViewShell () const
 
void Shutdown ()
 
void InvalidateAllSubShells (const SfxShell *pParentShell)
 
void TakeShellsFromStack (const SfxShell *pShell)
 Remove all shells from the SFX stack above and including the given shell. More...
 
void LockUpdate ()
 Prevent updates of the shell stack. More...
 
void UnlockUpdate ()
 Allow updates of the shell stack. More...
 

Private Types

typedef std::unordered_multimap< const SfxShell *, SharedShellFactory, ShellHashFactoryList
 
typedef std::list< ShellDescriptor > ActiveShellList
 List of the active view shells. More...
 
typedef std::list< ShellDescriptor > SubShellSubList
 
typedef std::unordered_map< const SfxShell *, SubShellSubList, ShellHashSubShellList
 
typedef ::std::vector< SfxShell * > ShellStack
 In this member we remember what shells we have pushed on the shell stack. More...
 

Private Member Functions

void UpdateShellStack ()
 Update the SFX shell stack (the portion that is visible to us) so that it matches the internal shell stack. More...
 
void CreateShells ()
 
void CreateTargetStack (ShellStack &rStack) const
 This method rebuilds the stack of shells that are stacked upon the view shell base. More...
 
 DECL_LINK (WindowEventHandler, VclWindowEvent &, void)
 
void DumpShellStack (const ShellStack &rStack)
 
void DumpSfxShellStack ()
 
ShellDescriptor CreateSubShell (SfxShell const *pShell, ShellId nShellId)
 
void DestroyViewShell (ShellDescriptor &rDescriptor)
 

Static Private Member Functions

static void Deactivate (SfxShell *pShell)
 To be called before a shell is taken from the SFX shell stack. More...
 
static void DestroySubShell (const ShellDescriptor &rDescriptor)
 

Private Attributes

ViewShellBasemrBase
 
mutable::osl::Mutex maMutex
 
FactoryList maShellFactories
 
ActiveShellList maActiveViewShells
 
SubShellList maActiveSubShells
 
int mnUpdateLockCount
 
bool mbShellStackIsUpToDate
 The UpdateShellStack() method can be called recursively. More...
 
SfxShellmpFormShell
 
const ViewShellmpFormShellParent
 
bool mbFormShellAboveParent
 
SfxShellmpTopShell
 
SfxShellmpTopViewShell
 

Detailed Description

Definition at line 94 of file ViewShellManager.cxx.

Member Typedef Documentation

◆ ActiveShellList

typedef std::list<ShellDescriptor> sd::ViewShellManager::Implementation::ActiveShellList
private

List of the active view shells.

In order to create gather all shells to put on the shell stack each view shell in this list is asked for its sub-shells (typically toolbars).

Definition at line 164 of file ViewShellManager.cxx.

◆ FactoryList

Definition at line 157 of file ViewShellManager.cxx.

◆ ShellStack

In this member we remember what shells we have pushed on the shell stack.

Definition at line 174 of file ViewShellManager.cxx.

◆ SubShellList

Definition at line 168 of file ViewShellManager.cxx.

◆ SubShellSubList

typedef std::list<ShellDescriptor> sd::ViewShellManager::Implementation::SubShellSubList
private

Definition at line 167 of file ViewShellManager.cxx.

Constructor & Destructor Documentation

◆ Implementation()

sd::ViewShellManager::Implementation::Implementation ( ViewShellBase rBase)

Definition at line 353 of file ViewShellManager.cxx.

◆ ~Implementation()

sd::ViewShellManager::Implementation::~Implementation ( )

Definition at line 365 of file ViewShellManager.cxx.

References sd::ViewShellManager::Shutdown().

Member Function Documentation

◆ ActivateShell() [1/2]

void sd::ViewShellManager::Implementation::ActivateShell ( const ShellDescriptor &  rDescriptor)

Definition at line 475 of file ViewShellManager.cxx.

◆ ActivateShell() [2/2]

void sd::ViewShellManager::Implementation::ActivateShell ( SfxShell rShell)

Definition at line 464 of file ViewShellManager.cxx.

References sd::ViewShellManager::ActivateShell(), and maMutex.

◆ ActivateSubShell()

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

Definition at line 514 of file ViewShellManager.cxx.

References maMutex, and nId.

◆ ActivateViewShell()

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

◆ AddShellFactory()

void sd::ViewShellManager::Implementation::AddShellFactory ( const SfxShell pViewShell,
const SharedShellFactory rpFactory 
)

Definition at line 370 of file ViewShellManager.cxx.

◆ CreateShells()

void sd::ViewShellManager::Implementation::CreateShells ( )
private

Definition at line 859 of file ViewShellManager.cxx.

References maMutex.

◆ CreateSubShell()

ShellDescriptor sd::ViewShellManager::Implementation::CreateSubShell ( SfxShell const *  pShell,
ShellId  nShellId 
)
private

Definition at line 965 of file ViewShellManager.cxx.

References maMutex.

◆ CreateTargetStack()

void sd::ViewShellManager::Implementation::CreateTargetStack ( ShellStack rStack) const
private

This method rebuilds the stack of shells that are stacked upon the view shell base.

Definition at line 885 of file ViewShellManager.cxx.

◆ Deactivate()

void sd::ViewShellManager::Implementation::Deactivate ( SfxShell pShell)
staticprivate

To be called before a shell is taken from the SFX shell stack.

This method deactivates an active text editing to avoid problems with undo managers. Afterwards the Deactivate() of the shell is called.

Definition at line 1102 of file ViewShellManager.cxx.

References SfxShell::Deactivate(), SfxDispatcher::Execute(), SfxViewFrame::GetDispatcher(), sd::ViewShell::GetView(), sd::ViewShell::GetViewFrame(), SdrObjEditView::IsTextEdit(), sd::View::SdrEndTextEdit(), and SdrView::UnmarkAll().

◆ DeactivateShell()

void sd::ViewShellManager::Implementation::DeactivateShell ( const SfxShell rShell)

Definition at line 484 of file ViewShellManager.cxx.

References sd::ViewShellManager::DeactivateSubShell(), and maMutex.

◆ DeactivateSubShell()

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

Definition at line 541 of file ViewShellManager.cxx.

References maMutex, and nId.

◆ DeactivateViewShell()

void sd::ViewShellManager::Implementation::DeactivateViewShell ( const ViewShell rShell)

Definition at line 434 of file ViewShellManager.cxx.

References sd::ViewShellManager::DeactivateSubShell(), and maMutex.

◆ DECL_LINK()

sd::ViewShellManager::Implementation::DECL_LINK ( WindowEventHandler  ,
VclWindowEvent ,
void   
)
private

◆ DestroySubShell()

void sd::ViewShellManager::Implementation::DestroySubShell ( const ShellDescriptor &  rDescriptor)
staticprivate

Definition at line 1022 of file ViewShellManager.cxx.

◆ DestroyViewShell()

void sd::ViewShellManager::Implementation::DestroyViewShell ( ShellDescriptor &  rDescriptor)
private

Definition at line 995 of file ViewShellManager.cxx.

References LINK, and vcl::Window::RemoveEventListener().

◆ DumpSfxShellStack()

void sd::ViewShellManager::Implementation::DumpSfxShellStack ( )
private

Definition at line 1089 of file ViewShellManager.cxx.

References nIndex, and NULL.

◆ DumpShellStack()

void sd::ViewShellManager::Implementation::DumpShellStack ( const ShellStack rStack)
private

Definition at line 1077 of file ViewShellManager.cxx.

References NULL, and SAL_INFO.

◆ GetShell()

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

Definition at line 627 of file ViewShellManager.cxx.

References maMutex, and nId.

◆ GetTopShell()

SfxShell * sd::ViewShellManager::Implementation::GetTopShell ( ) const

Definition at line 660 of file ViewShellManager.cxx.

◆ GetTopViewShell()

SfxShell * sd::ViewShellManager::Implementation::GetTopViewShell ( ) const

Definition at line 666 of file ViewShellManager.cxx.

◆ InvalidateAllSubShells()

void sd::ViewShellManager::Implementation::InvalidateAllSubShells ( const SfxShell pParentShell)

Definition at line 1029 of file ViewShellManager.cxx.

References maMutex.

◆ LockUpdate()

void sd::ViewShellManager::Implementation::LockUpdate ( )

Prevent updates of the shell stack.

While the sub shell manager is locked it will update its internal data structures but not alter the shell stack. Use this method when there are several modifications to the shell stack to prevent multiple rebuilds of the shell stack and resulting broadcasts.

Definition at line 671 of file ViewShellManager.cxx.

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

◆ MoveToTop()

void sd::ViewShellManager::Implementation::MoveToTop ( const SfxShell rParentShell)

Definition at line 573 of file ViewShellManager.cxx.

References maMutex.

◆ RemoveShellFactory()

void sd::ViewShellManager::Implementation::RemoveShellFactory ( const SfxShell pViewShell,
const SharedShellFactory rpFactory 
)

Definition at line 391 of file ViewShellManager.cxx.

◆ SetFormShell()

void sd::ViewShellManager::Implementation::SetFormShell ( const ViewShell pViewShell,
FmFormShell pFormShell,
bool  bAbove 
)

Definition at line 1126 of file ViewShellManager.cxx.

References maMutex.

◆ Shutdown()

void sd::ViewShellManager::Implementation::Shutdown ( )

◆ TakeShellsFromStack()

void sd::ViewShellManager::Implementation::TakeShellsFromStack ( const SfxShell pShell)

Remove all shells from the SFX stack above and including the given shell.

Definition at line 789 of file ViewShellManager.cxx.

References SfxShell::GetUndoManager(), maMutex, nIndex, and SAL_INFO.

◆ UnlockUpdate()

void sd::ViewShellManager::Implementation::UnlockUpdate ( )

Allow updates of the shell stack.

This method has to be called the same number of times as LockUpdate() to really allow a rebuild of the shell stack.

Definition at line 676 of file ViewShellManager.cxx.

References maMutex.

Referenced by sd::ViewShellManager::Implementation::UpdateLock::~UpdateLock().

◆ UpdateShellStack()

void sd::ViewShellManager::Implementation::UpdateShellStack ( )
private

Update the SFX shell stack (the portion that is visible to us) so that it matches the internal shell stack.

This is done in six steps:

  1. Create the missing view shells and sub shells.
  2. Set up the internal shell stack.
  3. Get the SFX shell stack.
  4. Find the lowest shell in which the two stacks differ.
  5. Remove all shells above and including that shell from the SFX stack.
  6. Push all shells of the internal stack on the SFX shell stack that are not already present on the later.

Definition at line 701 of file ViewShellManager.cxx.

References SfxShell::GetUndoManager(), i, maMutex, nIndex, and SAL_INFO.

Member Data Documentation

◆ maActiveSubShells

SubShellList sd::ViewShellManager::Implementation::maActiveSubShells
private

Definition at line 169 of file ViewShellManager.cxx.

◆ maActiveViewShells

ActiveShellList sd::ViewShellManager::Implementation::maActiveViewShells
private

Definition at line 165 of file ViewShellManager.cxx.

◆ maMutex

mutable::osl::Mutex sd::ViewShellManager::Implementation::maMutex
private

Definition at line 153 of file ViewShellManager.cxx.

◆ maShellFactories

FactoryList sd::ViewShellManager::Implementation::maShellFactories
private

Definition at line 158 of file ViewShellManager.cxx.

◆ mbFormShellAboveParent

bool sd::ViewShellManager::Implementation::mbFormShellAboveParent
private

Definition at line 187 of file ViewShellManager.cxx.

◆ mbShellStackIsUpToDate

bool sd::ViewShellManager::Implementation::mbShellStackIsUpToDate
private

The UpdateShellStack() method can be called recursively.

This flag is used to communicate between different levels of invocation: if the stack has been updated in an inner call the outer call can (has to) stop and return immediately.

Definition at line 183 of file ViewShellManager.cxx.

◆ mnUpdateLockCount

int sd::ViewShellManager::Implementation::mnUpdateLockCount
private

Definition at line 176 of file ViewShellManager.cxx.

◆ mpFormShell

SfxShell* sd::ViewShellManager::Implementation::mpFormShell
private

Definition at line 185 of file ViewShellManager.cxx.

◆ mpFormShellParent

const ViewShell* sd::ViewShellManager::Implementation::mpFormShellParent
private

Definition at line 186 of file ViewShellManager.cxx.

◆ mpTopShell

SfxShell* sd::ViewShellManager::Implementation::mpTopShell
private

Definition at line 189 of file ViewShellManager.cxx.

◆ mpTopViewShell

SfxShell* sd::ViewShellManager::Implementation::mpTopViewShell
private

Definition at line 190 of file ViewShellManager.cxx.

◆ mrBase

ViewShellBase& sd::ViewShellManager::Implementation::mrBase
private

Definition at line 152 of file ViewShellManager.cxx.


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