LibreOffice Module svl (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SfxListener Class Reference

#include <lstner.hxx>

Inheritance diagram for SfxListener:
[legend]

Public Member Functions

 SfxListener ()
 
 SfxListener (const SfxListener &rCopy)
 
virtual ~SfxListener () COVERITY_NOEXCEPT_FALSE
 
void StartListening (SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
 Registers a specific SfxBroadcaster. More...
 
void EndListening (SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
 
void EndListeningAll ()
 
bool IsListening (SfxBroadcaster &rBroadcaster) const
 
sal_uInt16 GetBroadcasterCount () const
 
SfxBroadcasterGetBroadcasterJOE (sal_uInt16 nNo) const
 
virtual void Notify (SfxBroadcaster &rBC, const SfxHint &rHint)
 
void RemoveBroadcaster_Impl (SfxBroadcaster &rBC)
 
virtual bool IsSdrView () const
 Used to avoid cost of dynamic_cast in SdrViewIter::ImpFindView. More...
 

Private Member Functions

const SfxListeneroperator= (const SfxListener &)=delete
 

Private Attributes

std::vector< SfxBroadcaster * > maBCs
 
std::map< SfxBroadcaster *, std::unique_ptr< sal::BacktraceState > > maCallStacks
 

Detailed Description

Definition at line 43 of file lstner.hxx.

Constructor & Destructor Documentation

◆ SfxListener() [1/2]

SfxListener::SfxListener ( )
inline

Definition at line 56 of file lstner.hxx.

◆ SfxListener() [2/2]

SfxListener::SfxListener ( const SfxListener rCopy)

Definition at line 33 of file lstner.cxx.

References maBCs, maCallStacks, and n.

◆ ~SfxListener()

SfxListener::~SfxListener ( )
virtual

Definition at line 47 of file lstner.cxx.

References maBCs, nPos, and SfxBroadcaster::RemoveListener().

Member Function Documentation

◆ EndListening()

void SfxListener::EndListening ( SfxBroadcaster rBroadcaster,
bool  bRemoveAllDuplicates = false 
)

Definition at line 105 of file lstner.cxx.

References maBCs, maCallStacks, and SfxBroadcaster::RemoveListener().

Referenced by SfxStyleSheet::SetParent().

◆ EndListeningAll()

void SfxListener::EndListeningAll ( )

Definition at line 127 of file lstner.cxx.

References maBCs, and maCallStacks.

◆ GetBroadcasterCount()

sal_uInt16 SfxListener::GetBroadcasterCount ( ) const

Definition at line 144 of file lstner.cxx.

References maBCs.

◆ GetBroadcasterJOE()

SfxBroadcaster * SfxListener::GetBroadcasterJOE ( sal_uInt16  nNo) const

Definition at line 149 of file lstner.cxx.

References maBCs.

◆ IsListening()

bool SfxListener::IsListening ( SfxBroadcaster rBroadcaster) const

Definition at line 139 of file lstner.cxx.

References maBCs.

Referenced by Notify(), and StartListening().

◆ IsSdrView()

virtual bool SfxListener::IsSdrView ( ) const
inlinevirtual

Used to avoid cost of dynamic_cast in SdrViewIter::ImpFindView.

Definition at line 73 of file lstner.hxx.

◆ Notify()

void SfxListener::Notify ( SfxBroadcaster rBC,
const SfxHint rHint 
)
virtual

Reimplemented in SfxStyleSheet.

Definition at line 157 of file lstner.cxx.

References IsListening().

Referenced by SfxBroadcaster::Broadcast(), and SfxBroadcaster::Forward().

◆ operator=()

const SfxListener & SfxListener::operator= ( const SfxListener )
privatedelete

◆ RemoveBroadcaster_Impl()

void SfxListener::RemoveBroadcaster_Impl ( SfxBroadcaster rBC)

Definition at line 60 of file lstner.cxx.

References maBCs, and maCallStacks.

Referenced by SfxBroadcaster::~SfxBroadcaster().

◆ StartListening()

void SfxListener::StartListening ( SfxBroadcaster rBroadcaster,
DuplicateHandling  eDuplicateHanding = DuplicateHandling::Unexpected 
)

Registers a specific SfxBroadcaster.

Some code uses duplicates as a kind of ref-counting thing i.e. they add and remove listeners on different code paths, and they only really stop listening when the last EndListening() is called.

Definition at line 79 of file lstner.cxx.

References SfxBroadcaster::AddListener(), IsListening(), maBCs, maCallStacks, Prevent, SAL_WARN, and Unexpected.

Referenced by SfxStyleSheet::SetParent(), and SfxBroadcaster::SfxBroadcaster().

Member Data Documentation

◆ maBCs

std::vector<SfxBroadcaster*> SfxListener::maBCs
private

◆ maCallStacks

std::map<SfxBroadcaster*, std::unique_ptr<sal::BacktraceState> > SfxListener::maCallStacks
private

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