Avoid potential negative array index access to cached text.
[LibreOffice.git] / include / sfx2 / AccessibilityIssue.hxx
blob92bef3d7d6a2bdbc15eed9cabe9183f649a3a7c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 */
11 #pragma once
13 #include <sfx2/dllapi.h>
15 #include <vcl/weld.hxx>
16 #include <rtl/ustring.hxx>
18 #include <vector>
19 #include <memory>
21 namespace sfx
23 enum class AccessibilityIssueID
25 UNSPECIFIED, // TODO: remove - temporary
26 DOCUMENT_TITLE,
27 DOCUMENT_LANGUAGE,
28 DOCUMENT_BACKGROUND,
29 STYLE_LANGUAGE,
30 LINKED_GRAPHIC,
31 NO_ALT_OLE,
32 NO_ALT_GRAPHIC,
33 NO_ALT_SHAPE,
34 TABLE_MERGE_SPLIT,
35 TEXT_FORMATTING,
36 TABLE_FORMATTING,
37 HYPERLINK_IS_TEXT,
38 HYPERLINK_SHORT,
39 FAKE_FOOTNOTE,
40 FAKE_CAPTION,
41 MANUAL_NUMBERING
44 class SFX2_DLLPUBLIC AccessibilityIssue
46 public:
47 AccessibilityIssue(AccessibilityIssueID eIssueID = AccessibilityIssueID::UNSPECIFIED);
48 AccessibilityIssue(AccessibilityIssue const&) = default;
49 virtual ~AccessibilityIssue();
51 virtual bool canGotoIssue() const = 0;
52 virtual void gotoIssue() const = 0;
54 virtual bool canQuickFixIssue() const = 0;
55 virtual void quickFixIssue() const = 0;
57 void setParent(weld::Window* pParent) { m_pParent = pParent; }
59 AccessibilityIssue& operator=(const AccessibilityIssue&) = default;
61 AccessibilityIssueID m_eIssueID;
62 OUString m_aIssueText;
64 weld::Window* m_pParent;
67 class SFX2_DLLPUBLIC AccessibilityIssueCollection
69 private:
70 std::vector<std::shared_ptr<AccessibilityIssue>> m_aIssues;
72 public:
73 AccessibilityIssueCollection() = default;
75 std::vector<std::shared_ptr<AccessibilityIssue>>& getIssues();
77 void clear();
80 } // end sfx namespace
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */