LibreOffice Module sw (master) 1
|
#include <DocumentStatisticsManager.hxx>
Public Member Functions | |
DocumentStatisticsManager (SwDoc &i_rSwdoc) | |
void | DocInfoChgd (bool isEnableSetModified) override |
DocInfo has changed (notify via DocShell): make required fields update. More... | |
const SwDocStat & | GetDocStat () const override |
Document - Statistics. More... | |
void | SetDocStatModified (bool bSet) |
const SwDocStat & | GetUpdatedDocStat (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 SwDocStat & | GetDocStat () const =0 |
Document - Statistics. More... | |
virtual const SwDocStat & | GetUpdatedDocStat (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 | |
DocumentStatisticsManager & | operator= (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 | |
SwDoc & | m_rDoc |
std::unique_ptr< SwDocStat > | mpDocStat |
bool | mbInitialized |
SwDocIdle | maStatsUpdateIdle |
Additional Inherited Members | |
Protected Member Functions inherited from IDocumentStatistics | |
virtual | ~IDocumentStatistics () |
Definition at line 32 of file DocumentStatisticsManager.hxx.
sw::DocumentStatisticsManager::DocumentStatisticsManager | ( | SwDoc & | i_rSwdoc | ) |
Definition at line 40 of file DocumentStatisticsManager.cxx.
References LINK, maStatsUpdateIdle, mbInitialized, Timer::SetInvokeHandler(), and Task::SetPriority().
|
overridevirtual |
Definition at line 211 of file DocumentStatisticsManager.cxx.
References maStatsUpdateIdle, and Task::Stop().
|
privatedelete |
|
private |
|
overridevirtual |
DocInfo has changed (notify via DocShell): make required fields update.
Implements IDocumentStatistics.
Definition at line 50 of file DocumentStatisticsManager.cxx.
References DocInfo, SwDoc::getIDocumentFieldsAccess(), SwDoc::getIDocumentState(), IDocumentFieldsAccess::GetSysFieldType(), m_rDoc, IDocumentState::SetModified(), TemplateName, and SwFieldType::UpdateFields().
|
overridevirtual |
Document - Statistics.
Returns a reference to the existing document statistics
Implements IDocumentStatistics.
Definition at line 60 of file DocumentStatisticsManager.cxx.
References mpDocStat.
|
overridevirtual |
Updates the document statistics if the document has been modified and returns a reference to the result.
bCompleteAsync | if true will return a partial result, and potentially trigger a timeout to complete the work. |
bFields | if stat. fields should be updated |
Implements IDocumentStatistics.
Definition at line 70 of file DocumentStatisticsManager.cxx.
References mbInitialized, mpDocStat, and UpdateDocStat().
|
private |
continue computing a chunk of document statistics
nChars | number of characters to count before exiting |
bFields | if stat. fields should be updated |
returns false when there is no more to calculate
Definition at line 103 of file DocumentStatisticsManager.cxx.
References SwNodes::Count(), SwTextNode::CountWords(), DocStat, SwFieldType::GatherFields(), IDocumentLayoutAccess::GetCurrentLayout(), SwDoc::GetDocShell(), SwDoc::getIDocumentFieldsAccess(), SwDoc::getIDocumentLayoutAccess(), SwDoc::getIDocumentState(), SfxObjectShell::GetModel(), SwDoc::GetNodes(), SwNode::GetNodeType(), SwRootFrame::GetPageNum(), IDocumentFieldsAccess::GetSysFieldType(), SwTextNode::GetText(), Grf, i, IDocumentState::IsModified(), SwDocShell::LockAllViews(), m_rDoc, mbInitialized, mpDocStat, n, Ole, Postit, IDocumentState::ResetModified(), Section, SetDocStatModified(), Table, Text, and SwFieldType::UpdateFields().
Referenced by UpdateDocStat().
|
privatedelete |
|
overridevirtual |
Set the document statistics.
Implements IDocumentStatistics.
Definition at line 79 of file DocumentStatisticsManager.cxx.
References mbInitialized, and mpDocStat.
void sw::DocumentStatisticsManager::SetDocStatModified | ( | bool | bSet | ) |
Definition at line 65 of file DocumentStatisticsManager.cxx.
References mpDocStat.
Referenced by IncrementalDocStatCalculate(), sw::DocumentStateManager::ResetModified(), and sw::DocumentStateManager::SetModified().
|
overridevirtual |
Updates the internal document's statistics.
bCompleteAsync | if true it may do part of the work and trigger a timeout to complete it. |
bFields | if 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().
|
private |
Definition at line 49 of file DocumentStatisticsManager.hxx.
Referenced by DocInfoChgd(), and IncrementalDocStatCalculate().
|
private |
Definition at line 64 of file DocumentStatisticsManager.hxx.
Referenced by DocumentStatisticsManager(), UpdateDocStat(), and ~DocumentStatisticsManager().
|
private |
Definition at line 63 of file DocumentStatisticsManager.hxx.
Referenced by GetUpdatedDocStat(), IncrementalDocStatCalculate(), SetDocStat(), and UpdateDocStat().
|
private |
Definition at line 62 of file DocumentStatisticsManager.hxx.
Referenced by GetDocStat(), GetUpdatedDocStat(), IncrementalDocStatCalculate(), SetDocStat(), SetDocStatModified(), and UpdateDocStat().