LibreOffice Module sd (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sd::ViewShell::Implementation::ToolBarManagerLock Class Reference

This update lock for the ToolBarManager exists in order to avoid problems with tool bars being displayed while the mouse button is pressed. More...

#include <ViewShellImplementation.hxx>

Collaboration diagram for sd::ViewShell::Implementation::ToolBarManagerLock:
[legend]

Classes

class  Deleter
 

Public Member Functions

void Release (bool bForce=false)
 Release the lock. More...
 
 DECL_DLLPRIVATE_LINK (TimeoutCallback, Timer *, void)
 

Static Public Member Functions

static std::shared_ptr< ToolBarManagerLockCreate (const std::shared_ptr< ToolBarManager > &rpManager)
 Create a new instance. More...
 

Private Member Functions

 ToolBarManagerLock (const std::shared_ptr< sd::ToolBarManager > &rpManager)
 
 ~ToolBarManagerLock ()
 

Private Attributes

::std::unique_ptr< ToolBarManager::UpdateLock, o3tl::default_delete< ToolBarManager::UpdateLock > > mpLock
 
Timer maTimer
 The timer is used both as a safe guard to unlock the update lock when Release() is not called explicitly. More...
 
std::shared_ptr< ToolBarManagerLockmpSelf
 The shared_ptr to this allows the ToolBarManagerLock to control its own lifetime. More...
 

Friends

class Deleter
 

Detailed Description

This update lock for the ToolBarManager exists in order to avoid problems with tool bars being displayed while the mouse button is pressed.

With docked tool bars this can lead to a size change of the view. This would change the relative mouse coordinates and thus interpret every mouse click as move command.

Definition at line 57 of file ViewShellImplementation.hxx.

Constructor & Destructor Documentation

◆ ToolBarManagerLock()

sd::ViewShell::Implementation::ToolBarManagerLock::ToolBarManagerLock ( const std::shared_ptr< sd::ToolBarManager > &  rpManager)
private

◆ ~ToolBarManagerLock()

sd::ViewShell::Implementation::ToolBarManagerLock::~ToolBarManagerLock ( )
private

Definition at line 373 of file ViewShellImplementation.cxx.

Member Function Documentation

◆ Create()

std::shared_ptr< ViewShell::Implementation::ToolBarManagerLock > sd::ViewShell::Implementation::ToolBarManagerLock::Create ( const std::shared_ptr< ToolBarManager > &  rpManager)
static

Create a new instance.

This allows the mpSelf member to be set automatically.

Definition at line 327 of file ViewShellImplementation.cxx.

Referenced by sd::ViewShell::MouseButtonDown().

◆ DECL_DLLPRIVATE_LINK()

sd::ViewShell::Implementation::ToolBarManagerLock::DECL_DLLPRIVATE_LINK ( TimeoutCallback  ,
Timer ,
void   
)

◆ Release()

void sd::ViewShell::Implementation::ToolBarManagerLock::Release ( bool  bForce = false)

Release the lock.

When the UI is captured (Application::IsUICaptured() returns <TRUE>) then the lock is released later asynchronously.

Parameters
bForceWhen this flag is <TRUE> then the lock is released even when IsUICaptured() returns <TRUE>.

Definition at line 363 of file ViewShellImplementation.cxx.

References Application::IsUICaptured().

Friends And Related Function Documentation

◆ Deleter

friend class Deleter
friend

Definition at line 94 of file ViewShellImplementation.hxx.

Member Data Documentation

◆ maTimer

Timer sd::ViewShell::Implementation::ToolBarManagerLock::maTimer
private

The timer is used both as a safe guard to unlock the update lock when Release() is not called explicitly.

It is also used to defer the release of the lock to a time when the UI is not captured.

Definition at line 84 of file ViewShellImplementation.hxx.

Referenced by ToolBarManagerLock().

◆ mpLock

::std::unique_ptr<ToolBarManager::UpdateLock, o3tl::default_delete<ToolBarManager::UpdateLock> > sd::ViewShell::Implementation::ToolBarManagerLock::mpLock
private

Definition at line 78 of file ViewShellImplementation.hxx.

◆ mpSelf

std::shared_ptr<ToolBarManagerLock> sd::ViewShell::Implementation::ToolBarManagerLock::mpSelf
private

The shared_ptr to this allows the ToolBarManagerLock to control its own lifetime.

This, of course, does work only when no one holds another shared_ptr longer than only temporary.

Definition at line 89 of file ViewShellImplementation.hxx.


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