LibreOffice Module framework (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
framework::UndoManagerHelper_Impl Class Reference
Inheritance diagram for framework::UndoManagerHelper_Impl:
[legend]
Collaboration diagram for framework::UndoManagerHelper_Impl:
[legend]

Public Member Functions

::osl::Mutex & getMutex ()
 
 UndoManagerHelper_Impl (IUndoManagerImplementation &i_undoManagerImpl)
 
virtual ~UndoManagerHelper_Impl ()
 
SfxUndoManagergetUndoManager () const
 
Reference< XUndoManager > getXUndoManager () const
 
virtual void actionUndone (const OUString &i_actionComment) override
 
virtual void actionRedone (const OUString &i_actionComment) override
 
virtual void undoActionAdded (const OUString &i_actionComment) override
 
virtual void cleared () override
 
virtual void clearedRedo () override
 
virtual void resetAll () override
 
virtual void listActionEntered (const OUString &i_comment) override
 
virtual void listActionLeft (const OUString &i_comment) override
 
virtual void listActionCancelled () override
 
void disposing ()
 
void enterUndoContext (const OUString &i_title, const bool i_hidden, IMutexGuard &i_instanceLock)
 
void leaveUndoContext (IMutexGuard &i_instanceLock)
 
void addUndoAction (const Reference< XUndoAction > &i_action, IMutexGuard &i_instanceLock)
 
void undo (IMutexGuard &i_instanceLock)
 
void redo (IMutexGuard &i_instanceLock)
 
void clear (IMutexGuard &i_instanceLock)
 
void clearRedo (IMutexGuard &i_instanceLock)
 
void reset (IMutexGuard &i_instanceLock)
 
void lock ()
 
void unlock ()
 
void addUndoManagerListener (const Reference< XUndoManagerListener > &i_listener)
 
void removeUndoManagerListener (const Reference< XUndoManagerListener > &i_listener)
 
void addModifyListener (const Reference< XModifyListener > &i_listener)
 
void removeModifyListener (const Reference< XModifyListener > &i_listener)
 
UndoManagerEvent buildEvent (OUString const &i_title) const
 
void impl_notifyModified ()
 
void notify (OUString const &i_title, void(SAL_CALL XUndoManagerListener::*i_notificationMethod)(const UndoManagerEvent &))
 
void notify (void(SAL_CALL XUndoManagerListener::*i_notificationMethod)(const EventObject &))
 
virtual void actionUndone (const OUString &i_actionComment)=0
 
virtual void actionRedone (const OUString &i_actionComment)=0
 
virtual void undoActionAdded (const OUString &i_actionComment)=0
 
virtual void cleared ()=0
 
virtual void clearedRedo ()=0
 
virtual void resetAll ()=0
 
virtual void listActionEntered (const OUString &i_comment)=0
 
virtual void listActionLeft (const OUString &i_comment)=0
 
virtual void listActionCancelled ()=0
 

Private Member Functions

void impl_processRequest (::std::function< void()> const &i_request, IMutexGuard &i_instanceLock)
 adds a function to be called to the request processor's queue More...
 
void impl_enterUndoContext (const OUString &i_title, const bool i_hidden)
 impl-versions of the XUndoManager API. More...
 
void impl_leaveUndoContext ()
 
void impl_addUndoAction (const Reference< XUndoAction > &i_action)
 
void impl_doUndoRedo (IMutexGuard &i_externalLock, const bool i_undo)
 
void impl_clear ()
 
void impl_clearRedo ()
 
void impl_reset ()
 

Private Attributes

::osl::Mutex m_aMutex
 
std::mutex m_aListenerMutex
 Use different mutex for listeners to prevent ABBA deadlocks. More...
 
std::mutex m_aQueueMutex
 
bool m_bAPIActionRunning
 
bool m_bProcessingEvents
 
sal_Int32 m_nLockCount
 
::comphelper::OInterfaceContainerHelper4< XUndoManagerListener > m_aUndoListeners
 
::comphelper::OInterfaceContainerHelper4< XModifyListener > m_aModifyListeners
 
IUndoManagerImplementationm_rUndoManagerImplementation
 
::std::stack< bool > m_aContextVisibilities
 
bool m_bContextAPIFlagsEverPushed = {false}
 
::std::stack< bool > m_aContextAPIFlags
 
::std::queue< ::rtl::Reference< UndoManagerRequest > > m_aEventQueue
 

Additional Inherited Members

- Protected Member Functions inherited from SfxUndoListener
 ~SfxUndoListener ()
 

Detailed Description

Definition at line 200 of file undomanagerhelper.cxx.

Constructor & Destructor Documentation

◆ UndoManagerHelper_Impl()

framework::UndoManagerHelper_Impl::UndoManagerHelper_Impl ( IUndoManagerImplementation i_undoManagerImpl)
inlineexplicit

Definition at line 225 of file undomanagerhelper.cxx.

◆ ~UndoManagerHelper_Impl()

virtual framework::UndoManagerHelper_Impl::~UndoManagerHelper_Impl ( )
inlinevirtual

Definition at line 234 of file undomanagerhelper.cxx.

Member Function Documentation

◆ actionRedone()

void framework::UndoManagerHelper_Impl::actionRedone ( const OUString &  i_actionComment)
overridevirtual

◆ actionUndone()

void framework::UndoManagerHelper_Impl::actionUndone ( const OUString &  i_actionComment)
overridevirtual

◆ addModifyListener()

void framework::UndoManagerHelper_Impl::addModifyListener ( const Reference< XModifyListener > &  i_listener)
inline

◆ addUndoAction()

void framework::UndoManagerHelper_Impl::addUndoAction ( const Reference< XUndoAction > &  i_action,
IMutexGuard i_instanceLock 
)

Definition at line 397 of file undomanagerhelper.cxx.

◆ addUndoManagerListener()

void framework::UndoManagerHelper_Impl::addUndoManagerListener ( const Reference< XUndoManagerListener > &  i_listener)
inline

◆ buildEvent()

UndoManagerEvent framework::UndoManagerHelper_Impl::buildEvent ( OUString const &  i_title) const

Definition at line 335 of file undomanagerhelper.cxx.

References aEvent.

◆ clear()

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

Definition at line 412 of file undomanagerhelper.cxx.

◆ cleared()

void framework::UndoManagerHelper_Impl::cleared ( )
overridevirtual

Implements SfxUndoListener.

Definition at line 808 of file undomanagerhelper.cxx.

◆ clearedRedo()

void framework::UndoManagerHelper_Impl::clearedRedo ( )
overridevirtual

Implements SfxUndoListener.

Definition at line 816 of file undomanagerhelper.cxx.

◆ clearRedo()

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

Definition at line 420 of file undomanagerhelper.cxx.

◆ disposing()

void framework::UndoManagerHelper_Impl::disposing ( )

◆ enterUndoContext()

void framework::UndoManagerHelper_Impl::enterUndoContext ( const OUString &  i_title,
const bool  i_hidden,
IMutexGuard i_instanceLock 
)

Definition at line 381 of file undomanagerhelper.cxx.

◆ getMutex()

::osl::Mutex & framework::UndoManagerHelper_Impl::getMutex ( )
inline

Definition at line 222 of file undomanagerhelper.cxx.

References m_aMutex.

◆ getUndoManager()

SfxUndoManager & framework::UndoManagerHelper_Impl::getUndoManager ( ) const
inline

◆ getXUndoManager()

Reference< XUndoManager > framework::UndoManagerHelper_Impl::getXUndoManager ( ) const
inline

◆ impl_addUndoAction()

void framework::UndoManagerHelper_Impl::impl_addUndoAction ( const Reference< XUndoAction > &  i_action)
private

◆ impl_clear()

void framework::UndoManagerHelper_Impl::impl_clear ( )
private

◆ impl_clearRedo()

void framework::UndoManagerHelper_Impl::impl_clearRedo ( )
private

◆ impl_doUndoRedo()

void framework::UndoManagerHelper_Impl::impl_doUndoRedo ( IMutexGuard i_externalLock,
const bool  i_undo 
)
private

◆ impl_enterUndoContext()

void framework::UndoManagerHelper_Impl::impl_enterUndoContext ( const OUString &  i_title,
const bool  i_hidden 
)
private

◆ impl_leaveUndoContext()

void framework::UndoManagerHelper_Impl::impl_leaveUndoContext ( )
private

◆ impl_notifyModified()

void framework::UndoManagerHelper_Impl::impl_notifyModified ( )

◆ impl_processRequest()

void framework::UndoManagerHelper_Impl::impl_processRequest ( ::std::function< void()> const &  i_request,
IMutexGuard i_instanceLock 
)
private

adds a function to be called to the request processor's queue

Definition at line 465 of file undomanagerhelper.cxx.

References framework::IMutexGuard::clear().

Referenced by redo(), and undo().

◆ impl_reset()

void framework::UndoManagerHelper_Impl::impl_reset ( )
private

◆ leaveUndoContext()

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

Definition at line 389 of file undomanagerhelper.cxx.

◆ listActionCancelled()

void framework::UndoManagerHelper_Impl::listActionCancelled ( )
overridevirtual

Implements SfxUndoListener.

Definition at line 868 of file undomanagerhelper.cxx.

◆ listActionEntered()

void framework::UndoManagerHelper_Impl::listActionEntered ( const OUString &  i_comment)
overridevirtual

Implements SfxUndoListener.

Definition at line 832 of file undomanagerhelper.cxx.

◆ listActionLeft()

void framework::UndoManagerHelper_Impl::listActionLeft ( const OUString &  i_comment)
overridevirtual

Implements SfxUndoListener.

Definition at line 845 of file undomanagerhelper.cxx.

◆ lock()

void framework::UndoManagerHelper_Impl::lock ( )

Definition at line 436 of file undomanagerhelper.cxx.

References SfxUndoManager::EnableUndo(), and getMutex().

◆ notify() [1/2]

void framework::UndoManagerHelper_Impl::notify ( OUString const &  i_title,
void(SAL_CALL XUndoManagerListener::*)(const UndoManagerEvent &)  i_notificationMethod 
)

◆ notify() [2/2]

void framework::UndoManagerHelper_Impl::notify ( void(SAL_CALL XUndoManagerListener::*)(const EventObject &)  i_notificationMethod)

◆ redo()

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

Definition at line 921 of file undomanagerhelper.cxx.

References impl_doUndoRedo(), and impl_processRequest().

◆ removeModifyListener()

void framework::UndoManagerHelper_Impl::removeModifyListener ( const Reference< XModifyListener > &  i_listener)
inline

◆ removeUndoManagerListener()

void framework::UndoManagerHelper_Impl::removeUndoManagerListener ( const Reference< XUndoManagerListener > &  i_listener)
inline

◆ reset()

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

Definition at line 428 of file undomanagerhelper.cxx.

◆ resetAll()

void framework::UndoManagerHelper_Impl::resetAll ( )
overridevirtual

Implements SfxUndoListener.

Definition at line 824 of file undomanagerhelper.cxx.

◆ undo()

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

Definition at line 913 of file undomanagerhelper.cxx.

References impl_doUndoRedo(), and impl_processRequest().

◆ undoActionAdded()

void framework::UndoManagerHelper_Impl::undoActionAdded ( const OUString &  i_actionComment)
overridevirtual

Implements SfxUndoListener.

Definition at line 800 of file undomanagerhelper.cxx.

◆ unlock()

void framework::UndoManagerHelper_Impl::unlock ( )

Definition at line 449 of file undomanagerhelper.cxx.

References SfxUndoManager::EnableUndo(), and getMutex().

Member Data Documentation

◆ m_aContextAPIFlags

::std::stack< bool > framework::UndoManagerHelper_Impl::m_aContextAPIFlags
private

Definition at line 216 of file undomanagerhelper.cxx.

◆ m_aContextVisibilities

::std::stack< bool > framework::UndoManagerHelper_Impl::m_aContextVisibilities
private

Definition at line 213 of file undomanagerhelper.cxx.

◆ m_aEventQueue

::std::queue< ::rtl::Reference< UndoManagerRequest > > framework::UndoManagerHelper_Impl::m_aEventQueue
private

Definition at line 219 of file undomanagerhelper.cxx.

◆ m_aListenerMutex

std::mutex framework::UndoManagerHelper_Impl::m_aListenerMutex
private

Use different mutex for listeners to prevent ABBA deadlocks.

Definition at line 205 of file undomanagerhelper.cxx.

◆ m_aModifyListeners

::comphelper::OInterfaceContainerHelper4<XModifyListener> framework::UndoManagerHelper_Impl::m_aModifyListeners
private

Definition at line 211 of file undomanagerhelper.cxx.

◆ m_aMutex

::osl::Mutex framework::UndoManagerHelper_Impl::m_aMutex
private

Definition at line 203 of file undomanagerhelper.cxx.

◆ m_aQueueMutex

std::mutex framework::UndoManagerHelper_Impl::m_aQueueMutex
private

Definition at line 206 of file undomanagerhelper.cxx.

◆ m_aUndoListeners

::comphelper::OInterfaceContainerHelper4<XUndoManagerListener> framework::UndoManagerHelper_Impl::m_aUndoListeners
private

Definition at line 210 of file undomanagerhelper.cxx.

◆ m_bAPIActionRunning

bool framework::UndoManagerHelper_Impl::m_bAPIActionRunning
private

Definition at line 207 of file undomanagerhelper.cxx.

◆ m_bContextAPIFlagsEverPushed

bool framework::UndoManagerHelper_Impl::m_bContextAPIFlagsEverPushed = {false}
private

Definition at line 215 of file undomanagerhelper.cxx.

◆ m_bProcessingEvents

bool framework::UndoManagerHelper_Impl::m_bProcessingEvents
private

Definition at line 208 of file undomanagerhelper.cxx.

◆ m_nLockCount

sal_Int32 framework::UndoManagerHelper_Impl::m_nLockCount
private

Definition at line 209 of file undomanagerhelper.cxx.

◆ m_rUndoManagerImplementation

IUndoManagerImplementation& framework::UndoManagerHelper_Impl::m_rUndoManagerImplementation
private

Definition at line 212 of file undomanagerhelper.cxx.


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