LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::framework::ShellStackGuard Class Reference

This module locks updates of the current configuration in situations when the shell stack must not be modified. More...

#include <ShellStackGuard.hxx>

Inheritance diagram for sd::framework::ShellStackGuard:
[legend]
Collaboration diagram for sd::framework::ShellStackGuard:
[legend]

Public Member Functions

 ShellStackGuard (rtl::Reference< sd::DrawController > const &rxController)
 
virtual ~ShellStackGuard () override
 
virtual void disposing (std::unique_lock< std::mutex > &) override
 
virtual void SAL_CALL notifyConfigurationChange (const css::drawing::framework::ConfigurationChangeEvent &rEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &rEvent) override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< typename... Ifc >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Private Member Functions

 DECL_LINK (TimeoutHandler, Timer *, void)
 
bool IsPrinting () const
 Return <TRUE> when the printer is printing. More...
 

Private Attributes

css::uno::Reference< css::drawing::framework::XConfigurationController > mxConfigurationController
 
ViewShellBasempBase
 
std::unique_ptr< ConfigurationController::LockmpUpdateLock
 
Idle maPrinterPollingIdle
 

Additional Inherited Members

- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

This module locks updates of the current configuration in situations when the shell stack must not be modified.

On every start of a configuration update the ShellStackGuard checks the printer. If it is printing the configuration update is locked. It then polls the printer and unlocks updates when printing finishes.

When in the future there are no resources left that use shells then this module can be removed.

Definition at line 61 of file ShellStackGuard.hxx.

Constructor & Destructor Documentation

◆ ShellStackGuard()

sd::framework::ShellStackGuard::ShellStackGuard ( rtl::Reference< sd::DrawController > const &  rxController)
explicit

◆ ~ShellStackGuard()

sd::framework::ShellStackGuard::~ShellStackGuard ( )
overridevirtual

Definition at line 67 of file ShellStackGuard.cxx.

Member Function Documentation

◆ DECL_LINK()

sd::framework::ShellStackGuard::DECL_LINK ( TimeoutHandler  ,
Timer ,
void   
)
private

◆ disposing() [1/2]

virtual void SAL_CALL sd::framework::ShellStackGuard::disposing ( const css::lang::EventObject &  rEvent)
overridevirtual

◆ disposing() [2/2]

void sd::framework::ShellStackGuard::disposing ( std::unique_lock< std::mutex > &  )
overridevirtual

Reimplemented from comphelper::WeakComponentImplHelperBase.

Definition at line 71 of file ShellStackGuard.cxx.

References mpBase, and mxConfigurationController.

◆ IsPrinting()

bool sd::framework::ShellStackGuard::IsPrinting ( ) const
private

Return <TRUE> when the printer is printing.

Return <FALSE> when the printer is not printing, or there is no printer, or something else went wrong.

Definition at line 130 of file ShellStackGuard.cxx.

References sd::ViewShellBase::GetPrinter(), and mpBase.

Referenced by notifyConfigurationChange().

◆ notifyConfigurationChange()

void SAL_CALL sd::framework::ShellStackGuard::notifyConfigurationChange ( const css::drawing::framework::ConfigurationChangeEvent &  rEvent)
overridevirtual

Member Data Documentation

◆ maPrinterPollingIdle

Idle sd::framework::ShellStackGuard::maPrinterPollingIdle
private

Definition at line 83 of file ShellStackGuard.hxx.

Referenced by notifyConfigurationChange(), and ShellStackGuard().

◆ mpBase

ViewShellBase* sd::framework::ShellStackGuard::mpBase
private

Definition at line 81 of file ShellStackGuard.hxx.

Referenced by disposing(), IsPrinting(), and ShellStackGuard().

◆ mpUpdateLock

std::unique_ptr<ConfigurationController::Lock> sd::framework::ShellStackGuard::mpUpdateLock
private

Definition at line 82 of file ShellStackGuard.hxx.

Referenced by notifyConfigurationChange().

◆ mxConfigurationController

css::uno::Reference<css::drawing::framework::XConfigurationController> sd::framework::ShellStackGuard::mxConfigurationController
private

Definition at line 80 of file ShellStackGuard.hxx.

Referenced by disposing(), notifyConfigurationChange(), and ShellStackGuard().


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