LibreOffice Module sw (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sw::DocumentStatisticsManager Class Referencefinal

#include <DocumentStatisticsManager.hxx>

Inheritance diagram for sw::DocumentStatisticsManager:
[legend]
Collaboration diagram for sw::DocumentStatisticsManager:
[legend]

Public Member Functions

 DocumentStatisticsManager (SwDoc &i_rSwdoc)
 
void DocInfoChgd (bool isEnableSetModified) override
 DocInfo has changed (notify via DocShell): make required fields update. More...
 
const SwDocStatGetDocStat () const override
 Document - Statistics. More...
 
void SetDocStatModified (bool bSet)
 
const SwDocStatGetUpdatedDocStat (bool bCompleteAsync, bool bFields) override
 Updates the document statistics if the document has been modified and returns a reference to the result. More...
 
void SetDocStat (const SwDocStat &rStat) override
 Set the document statistics. More...
 
void UpdateDocStat (bool bCompleteAsync, bool bFields) override
 Updates the internal document's statistics. More...
 
virtual ~DocumentStatisticsManager () override
 
virtual void DocInfoChgd (bool isEnableSetModified)=0
 DocInfo has changed (notify via DocShell): make required fields update. More...
 
virtual const SwDocStatGetDocStat () const =0
 Document - Statistics. More...
 
virtual const SwDocStatGetUpdatedDocStat (bool bCompleteAsync, bool bFields)=0
 Updates the document statistics if the document has been modified and returns a reference to the result. More...
 
virtual void SetDocStat (const SwDocStat &rStat)=0
 Set the document statistics. More...
 
virtual void UpdateDocStat (bool bCompleteAsync, bool bFields)=0
 Updates the internal document's statistics. More...
 

Private Member Functions

 DocumentStatisticsManager (DocumentStatisticsManager const &)=delete
 
DocumentStatisticsManageroperator= (DocumentStatisticsManager const &)=delete
 
bool IncrementalDocStatCalculate (tools::Long nChars, bool bFields=true)
 continue computing a chunk of document statistics More...
 
 DECL_LINK (DoIdleStatsUpdate, Timer *, void)
 

Private Attributes

SwDocm_rDoc
 
std::unique_ptr< SwDocStatmpDocStat
 
bool mbInitialized
 
SwDocIdle maStatsUpdateIdle
 

Additional Inherited Members

- Protected Member Functions inherited from IDocumentStatistics
virtual ~IDocumentStatistics ()
 

Detailed Description

Definition at line 32 of file DocumentStatisticsManager.hxx.

Constructor & Destructor Documentation

◆ DocumentStatisticsManager() [1/2]

sw::DocumentStatisticsManager::DocumentStatisticsManager ( SwDoc i_rSwdoc)

◆ ~DocumentStatisticsManager()

sw::DocumentStatisticsManager::~DocumentStatisticsManager ( )
overridevirtual

Definition at line 211 of file DocumentStatisticsManager.cxx.

References maStatsUpdateIdle, and Task::Stop().

◆ DocumentStatisticsManager() [2/2]

sw::DocumentStatisticsManager::DocumentStatisticsManager ( DocumentStatisticsManager const &  )
privatedelete

Member Function Documentation

◆ DECL_LINK()

sw::DocumentStatisticsManager::DECL_LINK ( DoIdleStatsUpdate  ,
Timer ,
void   
)
private

◆ DocInfoChgd()

void sw::DocumentStatisticsManager::DocInfoChgd ( bool  isEnableSetModified)
overridevirtual

◆ GetDocStat()

const SwDocStat & sw::DocumentStatisticsManager::GetDocStat ( ) const
overridevirtual

Document - Statistics.

Returns a reference to the existing document statistics

Implements IDocumentStatistics.

Definition at line 60 of file DocumentStatisticsManager.cxx.

References mpDocStat.

◆ GetUpdatedDocStat()

const SwDocStat & sw::DocumentStatisticsManager::GetUpdatedDocStat ( bool  bCompleteAsync,
bool  bFields 
)
overridevirtual

Updates the document statistics if the document has been modified and returns a reference to the result.

Parameters
bCompleteAsyncif true will return a partial result, and potentially trigger a timeout to complete the work.
bFieldsif stat. fields should be updated

Implements IDocumentStatistics.

Definition at line 70 of file DocumentStatisticsManager.cxx.

References mbInitialized, mpDocStat, and UpdateDocStat().

◆ IncrementalDocStatCalculate()

bool sw::DocumentStatisticsManager::IncrementalDocStatCalculate ( tools::Long  nChars,
bool  bFields = true 
)
private

◆ operator=()

DocumentStatisticsManager & sw::DocumentStatisticsManager::operator= ( DocumentStatisticsManager const &  )
privatedelete

◆ SetDocStat()

void sw::DocumentStatisticsManager::SetDocStat ( const SwDocStat rStat)
overridevirtual

Set the document statistics.

Implements IDocumentStatistics.

Definition at line 79 of file DocumentStatisticsManager.cxx.

References mbInitialized, and mpDocStat.

◆ SetDocStatModified()

void sw::DocumentStatisticsManager::SetDocStatModified ( bool  bSet)

◆ UpdateDocStat()

void sw::DocumentStatisticsManager::UpdateDocStat ( bool  bCompleteAsync,
bool  bFields 
)
overridevirtual

Updates the internal document's statistics.

Parameters
bCompleteAsyncif true it may do part of the work and trigger a timeout to complete it.
bFieldsif stat. fields should be updated

Implements IDocumentStatistics.

Definition at line 85 of file DocumentStatisticsManager.cxx.

References IncrementalDocStatCalculate(), maStatsUpdateIdle, mbInitialized, mpDocStat, Idle::Start(), and Task::Stop().

Referenced by GetUpdatedDocStat().

Member Data Documentation

◆ m_rDoc

SwDoc& sw::DocumentStatisticsManager::m_rDoc
private

Definition at line 49 of file DocumentStatisticsManager.hxx.

Referenced by DocInfoChgd(), and IncrementalDocStatCalculate().

◆ maStatsUpdateIdle

SwDocIdle sw::DocumentStatisticsManager::maStatsUpdateIdle
private

◆ mbInitialized

bool sw::DocumentStatisticsManager::mbInitialized
private

◆ mpDocStat

std::unique_ptr<SwDocStat> sw::DocumentStatisticsManager::mpDocStat
private

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