LibreOffice Module dbaccess (master) 1
Classes | Public Member Functions | Private Attributes | List of all members
dbaui::SelectionNotifier Class Reference
Collaboration diagram for dbaui::SelectionNotifier:
[legend]

Classes

struct  SelectionGuardAccess
 

Public Member Functions

 SelectionNotifier (::osl::Mutex &_rMutex, ::cppu::OWeakObject &_rContext)
 
 SelectionNotifier (const SelectionNotifier &)=delete
 
const SelectionNotifieroperator= (const SelectionNotifier &)=delete
 
void addListener (const Reference< XSelectionChangeListener > &Listener)
 
void removeListener (const Reference< XSelectionChangeListener > &Listener)
 
void disposing ()
 
void enterSelection (SelectionGuardAccess)
 enters a block which modifies the selection of our owner. More...
 
void leaveSelection (SelectionGuardAccess)
 leaves a block which modifies the selection of our owner More...
 

Private Attributes

::comphelper::OInterfaceContainerHelper3< XSelectionChangeListener > m_aSelectionListeners
 
::cppu::OWeakObjectm_rContext
 
sal_Int32 m_nSelectionNestingLevel
 

Detailed Description

Definition at line 158 of file AppController.cxx.

Constructor & Destructor Documentation

◆ SelectionNotifier() [1/2]

dbaui::SelectionNotifier::SelectionNotifier ( ::osl::Mutex &  _rMutex,
::cppu::OWeakObject _rContext 
)
inline

Definition at line 166 of file AppController.cxx.

◆ SelectionNotifier() [2/2]

dbaui::SelectionNotifier::SelectionNotifier ( const SelectionNotifier )
delete

Member Function Documentation

◆ addListener()

void dbaui::SelectionNotifier::addListener ( const Reference< XSelectionChangeListener > &  Listener)
inline

◆ disposing()

void dbaui::SelectionNotifier::disposing ( )
inline

◆ enterSelection()

void dbaui::SelectionNotifier::enterSelection ( SelectionGuardAccess  )
inline

enters a block which modifies the selection of our owner.

Can be called multiple times, the only important thing is to call leaveSelection equally often.

Definition at line 199 of file AppController.cxx.

References m_nSelectionNestingLevel.

◆ leaveSelection()

void dbaui::SelectionNotifier::leaveSelection ( SelectionGuardAccess  )
inline

leaves a block which modifies the selection of our owner

Must be paired with enterSelection calls.

When the last block is left, i.e. the last leaveSelection call is made on the current stack, then our SelectionChangeListeners are notified

Definition at line 211 of file AppController.cxx.

References aEvent, m_aSelectionListeners, m_nSelectionNestingLevel, m_rContext, and comphelper::OInterfaceContainerHelper3< class ListenerT >::notifyEach().

◆ operator=()

const SelectionNotifier & dbaui::SelectionNotifier::operator= ( const SelectionNotifier )
delete

◆ removeListener()

void dbaui::SelectionNotifier::removeListener ( const Reference< XSelectionChangeListener > &  Listener)
inline

Member Data Documentation

◆ m_aSelectionListeners

::comphelper::OInterfaceContainerHelper3<XSelectionChangeListener> dbaui::SelectionNotifier::m_aSelectionListeners
private

Definition at line 161 of file AppController.cxx.

Referenced by addListener(), disposing(), leaveSelection(), and removeListener().

◆ m_nSelectionNestingLevel

sal_Int32 dbaui::SelectionNotifier::m_nSelectionNestingLevel
private

Definition at line 163 of file AppController.cxx.

Referenced by enterSelection(), and leaveSelection().

◆ m_rContext

::cppu::OWeakObject& dbaui::SelectionNotifier::m_rContext
private

Definition at line 162 of file AppController.cxx.

Referenced by disposing(), and leaveSelection().


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