LibreOffice Module sc (master) 1
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ScChartListenerCollection Class Referencefinal

#include <chartlis.hxx>

Collaboration diagram for ScChartListenerCollection:
[legend]

Public Types

typedef std::map< OUString, std::unique_ptr< ScChartListener > > ListenersType
 
typedef std::unordered_set< OUString > StringSetType
 

Public Member Functions

 ScChartListenerCollection (ScDocument &rDoc)
 
 ScChartListenerCollection (const ScChartListenerCollection &)
 
 ~ScChartListenerCollection ()
 
void StartAllListeners ()
 
bool insert (ScChartListener *pListener)
 
ScChartListenerfindByName (const OUString &rName)
 
const ScChartListenerfindByName (const OUString &rName) const
 
bool hasListeners () const
 
void removeByName (const OUString &rName)
 
const ListenersTypegetListeners () const
 
ListenersTypegetListeners ()
 
StringSetTypegetNonOleObjectNames ()
 
OUString getUniqueName (std::u16string_view rPrefix) const
 Create a unique name that's not taken by any existing chart listener objects. More...
 
void ChangeListening (const OUString &rName, const ScRangeListRef &rRangeListRef)
 
void FreeUnused ()
 
void FreeUno (const css::uno::Reference< css::chart::XChartDataChangeEventListener > &rListener, const css::uno::Reference< css::chart::XChartData > &rSource)
 
void StartTimer ()
 
void UpdateDirtyCharts ()
 
void SetDirty ()
 
void SetDiffDirty (const ScChartListenerCollection &, bool bSetChartRangeLists)
 
void SetRangeDirty (const ScRange &rRange)
 
void UpdateChartsContainingTab (SCTAB nTab)
 
bool operator== (const ScChartListenerCollection &r) const
 
void StartListeningHiddenRange (const ScRange &rRange, ScChartHiddenRangeListener *pListener)
 Start listening on hide/show change within specified cell range. More...
 
void EndListeningHiddenRange (ScChartHiddenRangeListener *pListener)
 Remove all ranges associated with passed listener instance from the list of hidden range listeners. More...
 

Private Types

enum  UpdateStatus {
  SC_CLCUPDATE_NONE ,
  SC_CLCUPDATE_RUNNING ,
  SC_CLCUPDATE_MODIFIED
}
 

Private Member Functions

 DECL_DLLPRIVATE_LINK (TimerHdl, Timer *, void)
 
ScChartListenerCollectionoperator= (const ScChartListenerCollection &)=delete
 
void Init ()
 

Private Attributes

ListenersType m_Listeners
 
enum ScChartListenerCollection::UpdateStatus meModifiedDuringUpdate
 
std::unordered_multimap< ScChartHiddenRangeListener *, ScRangemaHiddenListeners
 
StringSetType maNonOleObjectNames
 
Idle aIdle
 
ScDocumentrDoc
 

Detailed Description

Definition at line 122 of file chartlis.hxx.

Member Typedef Documentation

◆ ListenersType

Definition at line 125 of file chartlis.hxx.

◆ StringSetType

typedef std::unordered_set<OUString> ScChartListenerCollection::StringSetType

Definition at line 126 of file chartlis.hxx.

Member Enumeration Documentation

◆ UpdateStatus

Enumerator
SC_CLCUPDATE_NONE 
SC_CLCUPDATE_RUNNING 
SC_CLCUPDATE_MODIFIED 

Definition at line 129 of file chartlis.hxx.

Constructor & Destructor Documentation

◆ ScChartListenerCollection() [1/2]

ScChartListenerCollection::ScChartListenerCollection ( ScDocument rDoc)

Definition at line 354 of file chartlis.cxx.

References Init().

◆ ScChartListenerCollection() [2/2]

ScChartListenerCollection::ScChartListenerCollection ( const ScChartListenerCollection rColl)

Definition at line 362 of file chartlis.cxx.

References Init().

◆ ~ScChartListenerCollection()

ScChartListenerCollection::~ScChartListenerCollection ( )

Definition at line 371 of file chartlis.cxx.

References m_Listeners.

Member Function Documentation

◆ ChangeListening()

void ScChartListenerCollection::ChangeListening ( const OUString &  rName,
const ScRangeListRef rRangeListRef 
)

◆ DECL_DLLPRIVATE_LINK()

ScChartListenerCollection::DECL_DLLPRIVATE_LINK ( TimerHdl  ,
Timer ,
void   
)
private

◆ EndListeningHiddenRange()

void ScChartListenerCollection::EndListeningHiddenRange ( ScChartHiddenRangeListener pListener)

Remove all ranges associated with passed listener instance from the list of hidden range listeners.

This does not delete the passed listener instance.

Definition at line 624 of file chartlis.cxx.

References maHiddenListeners.

Referenced by ScChart2DataSequence::RefChanged(), ScChart2DataSequence::removeModifyListener(), and ScChart2DataSequence::~ScChart2DataSequence().

◆ findByName() [1/2]

ScChartListener * ScChartListenerCollection::findByName ( const OUString &  rName)

◆ findByName() [2/2]

const ScChartListener * ScChartListenerCollection::findByName ( const OUString &  rName) const

Definition at line 409 of file chartlis.cxx.

References m_Listeners.

◆ FreeUno()

void ScChartListenerCollection::FreeUno ( const css::uno::Reference< css::chart::XChartDataChangeEventListener > &  rListener,
const css::uno::Reference< css::chart::XChartData > &  rSource 
)

◆ FreeUnused()

void ScChartListenerCollection::FreeUnused ( )

◆ getListeners() [1/2]

ListenersType & ScChartListenerCollection::getListeners ( )
inline

Definition at line 165 of file chartlis.hxx.

◆ getListeners() [2/2]

const ListenersType & ScChartListenerCollection::getListeners ( ) const
inline

Definition at line 164 of file chartlis.hxx.

◆ getNonOleObjectNames()

StringSetType & ScChartListenerCollection::getNonOleObjectNames ( )
inline

Definition at line 166 of file chartlis.hxx.

◆ getUniqueName()

OUString ScChartListenerCollection::getUniqueName ( std::u16string_view  rPrefix) const

Create a unique name that's not taken by any existing chart listener objects.

The name consists of a prefix given followed by a number.

Definition at line 420 of file chartlis.cxx.

References m_Listeners.

Referenced by ScMyOLEFixer::CreateChartListener().

◆ hasListeners()

bool ScChartListenerCollection::hasListeners ( ) const

Definition at line 415 of file chartlis.cxx.

References m_Listeners.

Referenced by ScDocShell::DoRecalc().

◆ Init()

void ScChartListenerCollection::Init ( void  )
private

Definition at line 348 of file chartlis.cxx.

References aIdle, LINK, Timer::SetInvokeHandler(), and Task::SetPriority().

Referenced by ScChartListenerCollection().

◆ insert()

bool ScChartListenerCollection::insert ( ScChartListener pListener)

◆ operator=()

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

References Init().

◆ operator==()

bool ScChartListenerCollection::operator== ( const ScChartListenerCollection r) const

Definition at line 606 of file chartlis.cxx.

References m_Listeners, and rDoc.

◆ removeByName()

void ScChartListenerCollection::removeByName ( const OUString &  rName)

◆ SetDiffDirty()

void ScChartListenerCollection::SetDiffDirty ( const ScChartListenerCollection rCmp,
bool  bSetChartRangeLists 
)

◆ SetDirty()

void ScChartListenerCollection::SetDirty ( )

Definition at line 528 of file chartlis.cxx.

References m_Listeners, and StartTimer().

◆ SetRangeDirty()

void ScChartListenerCollection::SetRangeDirty ( const ScRange rRange)

◆ StartAllListeners()

void ScChartListenerCollection::StartAllListeners ( )

Definition at line 380 of file chartlis.cxx.

References m_Listeners.

◆ StartListeningHiddenRange()

void ScChartListenerCollection::StartListeningHiddenRange ( const ScRange rRange,
ScChartHiddenRangeListener pListener 
)

Start listening on hide/show change within specified cell range.

A single listener may listen on multiple ranges when the caller passes the same pointer multiple times with different ranges.

Note that the caller is responsible for managing the life-cycle of the listener instance.

Definition at line 619 of file chartlis.cxx.

References maHiddenListeners.

Referenced by ScChart2DataSequence::addModifyListener(), and ScChart2DataSequence::RefChanged().

◆ StartTimer()

void ScChartListenerCollection::StartTimer ( )

◆ UpdateChartsContainingTab()

void ScChartListenerCollection::UpdateChartsContainingTab ( SCTAB  nTab)

Definition at line 597 of file chartlis.cxx.

References m_Listeners, ScDocument::MaxCol(), ScDocument::MaxRow(), and rDoc.

◆ UpdateDirtyCharts()

void ScChartListenerCollection::UpdateDirtyCharts ( )

Member Data Documentation

◆ aIdle

Idle ScChartListenerCollection::aIdle
private

Definition at line 140 of file chartlis.hxx.

Referenced by Init(), StartTimer(), and UpdateDirtyCharts().

◆ m_Listeners

ListenersType ScChartListenerCollection::m_Listeners
private

◆ maHiddenListeners

std::unordered_multimap<ScChartHiddenRangeListener*, ScRange> ScChartListenerCollection::maHiddenListeners
private

Definition at line 136 of file chartlis.hxx.

Referenced by EndListeningHiddenRange(), SetRangeDirty(), and StartListeningHiddenRange().

◆ maNonOleObjectNames

StringSetType ScChartListenerCollection::maNonOleObjectNames
private

Definition at line 138 of file chartlis.hxx.

◆ meModifiedDuringUpdate

enum ScChartListenerCollection::UpdateStatus ScChartListenerCollection::meModifiedDuringUpdate
private

◆ rDoc

ScDocument& ScChartListenerCollection::rDoc
private

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