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

helper class for implementing an XUndoManager More...

#include <undomanagerhelper.hxx>

Public Member Functions

 UndoManagerHelper (IUndoManagerImplementation &i_undoManagerImpl)
 
 ~UndoManagerHelper ()
 
void disposing ()
 
void enterUndoContext (const OUString &i_title, IMutexGuard &i_instanceLock)
 
void enterHiddenUndoContext (IMutexGuard &i_instanceLock)
 
void leaveUndoContext (IMutexGuard &i_instanceLock)
 
void addUndoAction (const css::uno::Reference< css::document::XUndoAction > &i_action, IMutexGuard &i_instanceLock)
 
void undo (IMutexGuard &i_instanceLock)
 
void redo (IMutexGuard &i_instanceLock)
 
bool isUndoPossible () const
 
bool isRedoPossible () const
 
OUString getCurrentUndoActionTitle () const
 
OUString getCurrentRedoActionTitle () const
 
css::uno::Sequence< OUString > getAllUndoActionTitles () const
 
css::uno::Sequence< OUString > getAllRedoActionTitles () const
 
void clear (IMutexGuard &i_instanceLock)
 
void clearRedo (IMutexGuard &i_instanceLock)
 
void reset (IMutexGuard &i_instanceLock)
 
void addUndoManagerListener (const css::uno::Reference< css::document::XUndoManagerListener > &i_listener)
 
void removeUndoManagerListener (const css::uno::Reference< css::document::XUndoManagerListener > &i_listener)
 
void lock ()
 
void unlock ()
 
bool isLocked ()
 
void addModifyListener (const css::uno::Reference< css::util::XModifyListener > &i_listener)
 
void removeModifyListener (const css::uno::Reference< css::util::XModifyListener > &i_listener)
 

Private Attributes

std::unique_ptr< UndoManagerHelper_Implm_xImpl
 

Detailed Description

helper class for implementing an XUndoManager

Several of the methods of the class take an IMutexGuard instance. It is assumed that this guard has a lock on its mutex at the moment the method is entered. The lock will be released before any notifications to the registered XUndoManagerListeners happen.

The following locking strategy is used for this mutex:

The reason for the exception for SfxUndoManager::Undo and SfxUndoManager::Redo is that those are expected to modify the actual document which the UndoManager works for. And as long as our documents are not thread-safe, and as long as we do not re-fit all existing SfxUndoImplementations to not expect the dreaded SolarMutex being locked when they're called, the above behavior is a compromise between "how it should be" and "how it can realistically be".

Definition at line 113 of file undomanagerhelper.hxx.

Constructor & Destructor Documentation

◆ UndoManagerHelper()

framework::UndoManagerHelper::UndoManagerHelper ( IUndoManagerImplementation i_undoManagerImpl)

Definition at line 884 of file undomanagerhelper.cxx.

◆ ~UndoManagerHelper()

framework::UndoManagerHelper::~UndoManagerHelper ( )

Definition at line 889 of file undomanagerhelper.cxx.

Member Function Documentation

◆ addModifyListener()

void framework::UndoManagerHelper::addModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  i_listener)

Definition at line 1080 of file undomanagerhelper.cxx.

References m_xImpl.

◆ addUndoAction()

void framework::UndoManagerHelper::addUndoAction ( const css::uno::Reference< css::document::XUndoAction > &  i_action,
IMutexGuard i_instanceLock 
)

Definition at line 929 of file undomanagerhelper.cxx.

References m_xImpl.

◆ addUndoManagerListener()

void framework::UndoManagerHelper::addUndoManagerListener ( const css::uno::Reference< css::document::XUndoManagerListener > &  i_listener)

Definition at line 1068 of file undomanagerhelper.cxx.

References m_xImpl.

◆ clear()

void framework::UndoManagerHelper::clear ( IMutexGuard i_instanceLock)

Definition at line 1033 of file undomanagerhelper.cxx.

References m_xImpl.

◆ clearRedo()

void framework::UndoManagerHelper::clearRedo ( IMutexGuard i_instanceLock)

Definition at line 1038 of file undomanagerhelper.cxx.

References m_xImpl.

◆ disposing()

void framework::UndoManagerHelper::disposing ( )

Definition at line 893 of file undomanagerhelper.cxx.

References m_xImpl.

◆ enterHiddenUndoContext()

void framework::UndoManagerHelper::enterHiddenUndoContext ( IMutexGuard i_instanceLock)

Definition at line 903 of file undomanagerhelper.cxx.

References m_xImpl.

◆ enterUndoContext()

void framework::UndoManagerHelper::enterUndoContext ( const OUString &  i_title,
IMutexGuard i_instanceLock 
)

Definition at line 898 of file undomanagerhelper.cxx.

References m_xImpl.

◆ getAllRedoActionTitles()

Sequence< OUString > framework::UndoManagerHelper::getAllRedoActionTitles ( ) const

Definition at line 1028 of file undomanagerhelper.cxx.

References m_xImpl.

◆ getAllUndoActionTitles()

Sequence< OUString > framework::UndoManagerHelper::getAllUndoActionTitles ( ) const

Definition at line 1023 of file undomanagerhelper.cxx.

References m_xImpl.

◆ getCurrentRedoActionTitle()

OUString framework::UndoManagerHelper::getCurrentRedoActionTitle ( ) const

Definition at line 1018 of file undomanagerhelper.cxx.

References m_xImpl.

◆ getCurrentUndoActionTitle()

OUString framework::UndoManagerHelper::getCurrentUndoActionTitle ( ) const

Definition at line 1013 of file undomanagerhelper.cxx.

References m_xImpl.

◆ isLocked()

bool framework::UndoManagerHelper::isLocked ( )

Definition at line 1058 of file undomanagerhelper.cxx.

References SfxUndoManager::IsUndoEnabled(), and m_xImpl.

◆ isRedoPossible()

bool framework::UndoManagerHelper::isRedoPossible ( ) const

◆ isUndoPossible()

bool framework::UndoManagerHelper::isUndoPossible ( ) const

◆ leaveUndoContext()

void framework::UndoManagerHelper::leaveUndoContext ( IMutexGuard i_instanceLock)

Definition at line 908 of file undomanagerhelper.cxx.

References m_xImpl.

◆ lock()

void framework::UndoManagerHelper::lock ( )

Definition at line 1048 of file undomanagerhelper.cxx.

References m_xImpl.

◆ redo()

void framework::UndoManagerHelper::redo ( IMutexGuard i_instanceLock)

Definition at line 939 of file undomanagerhelper.cxx.

References m_xImpl.

◆ removeModifyListener()

void framework::UndoManagerHelper::removeModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  i_listener)

Definition at line 1086 of file undomanagerhelper.cxx.

References m_xImpl.

◆ removeUndoManagerListener()

void framework::UndoManagerHelper::removeUndoManagerListener ( const css::uno::Reference< css::document::XUndoManagerListener > &  i_listener)

Definition at line 1074 of file undomanagerhelper.cxx.

References m_xImpl.

◆ reset()

void framework::UndoManagerHelper::reset ( IMutexGuard i_instanceLock)

Definition at line 1043 of file undomanagerhelper.cxx.

References m_xImpl.

◆ undo()

void framework::UndoManagerHelper::undo ( IMutexGuard i_instanceLock)

Definition at line 934 of file undomanagerhelper.cxx.

References m_xImpl.

◆ unlock()

void framework::UndoManagerHelper::unlock ( )

Definition at line 1053 of file undomanagerhelper.cxx.

References m_xImpl.

Member Data Documentation

◆ m_xImpl

std::unique_ptr< UndoManagerHelper_Impl > framework::UndoManagerHelper::m_xImpl
private

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