1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 #include "ndindex.hxx"
15 #include <svl/listener.hxx>
16 #include <vcl/timer.hxx>
17 #include <AccessibilityCheck.hxx>
25 /// Contains the node and tracks if the node gets deleted.
26 /// Note: the node needs to extend sw::BroadcastingModify.
27 class WeakNodeContainer final
: public SvtListener
33 WeakNodeContainer(SwNode
* pNode
);
36 /// Is the node still alive or it was deleted?
39 /// Returns the pointer of the node or nullptr if the node
44 class OnlineAccessibilityCheck
47 std::map
<SwNode
*, std::unique_ptr
<WeakNodeContainer
>> m_aNodes
;
50 sw::AccessibilityCheck m_aAccessibilityCheck
;
51 std::unique_ptr
<WeakNodeContainer
> m_pPreviousNode
;
52 SwNodeOffset m_nPreviousNodeIndex
;
53 sal_Int32 m_nAccessibilityIssues
;
55 bool m_bOnlineCheckStatus
;
56 std::unique_ptr
<sfx::AccessibilityIssueCollection
> m_pDocumentAccessibilityIssues
;
58 void runAccessibilityCheck(SwNode
* pNode
);
59 void updateStatusbar();
60 void updateNodeStatus(SwNode
* pContentNode
, bool bIssueObjectNameChanged
= false);
62 void lookForPreviousNodeAndUpdate(SwPosition
const& rNewPos
);
63 void clearAccessibilityIssuesFromAllNodes();
64 void runDocumentLevelAccessibilityCheck();
67 OnlineAccessibilityCheck(SwDoc
& rDocument
);
68 void update(SwPosition
const& rNewPos
);
69 void resetAndQueue(SwNode
* pNode
, bool bIssueObjectNameChanged
= false);
70 void resetAndQueueDocumentLevel();
71 void updateCheckerActivity();
72 sal_Int32
getNumberOfAccessibilityIssues() { return m_nAccessibilityIssues
; }
73 sal_Int32
getNumberOfDocumentLevelAccessibilityIssues()
75 return m_pDocumentAccessibilityIssues
? m_pDocumentAccessibilityIssues
->getIssues().size()
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */