Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / sidebar / A11yCheckIssuesPanel.hxx
blob54e5ad560bdf5dde958fc1a278199637bfce5b24
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
8 */
10 #pragma once
12 #include <memory>
14 #include <sfx2/AccessibilityIssue.hxx>
15 #include <sfx2/sidebar/ControllerItem.hxx>
16 #include <sfx2/sidebar/PanelLayout.hxx>
17 #include <svl/poolitem.hxx>
18 #include <tools/link.hxx>
19 #include <vcl/weld.hxx>
21 #include <doc.hxx>
23 namespace sw::sidebar
25 class AccessibilityCheckEntry final
27 private:
28 std::unique_ptr<weld::Builder> m_xBuilder;
29 std::unique_ptr<weld::Container> m_xContainer;
30 std::unique_ptr<weld::Label> m_xLabel;
31 std::unique_ptr<weld::LinkButton> m_xGotoButton;
32 std::unique_ptr<weld::Button> m_xFixButton;
34 std::shared_ptr<sfx::AccessibilityIssue> const& m_pAccessibilityIssue;
36 public:
37 AccessibilityCheckEntry(weld::Container* pParent,
38 std::shared_ptr<sfx::AccessibilityIssue> const& pAccessibilityIssue);
40 weld::Widget* get_widget() const { return m_xContainer.get(); }
42 DECL_LINK(GotoButtonClicked, weld::LinkButton&, bool);
43 DECL_LINK(FixButtonClicked, weld::Button&, void);
46 class A11yCheckIssuesPanel : public PanelLayout,
47 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
49 public:
50 static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent, SfxBindings* pBindings);
52 virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState,
53 const SfxPoolItem* pState) override;
55 virtual void GetControlState(const sal_uInt16 /*nSId*/,
56 boost::property_tree::ptree& /*rState*/) override{};
58 A11yCheckIssuesPanel(weld::Widget* pParent, SfxBindings* pBindings);
59 void ImplDestroy();
60 virtual ~A11yCheckIssuesPanel() override;
62 private:
63 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aDocumentEntries;
64 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aStylesEntries;
65 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aNoAltEntries;
66 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aTableEntries;
67 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aFormattingEntries;
68 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aHyperlinkEntries;
69 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aFakesEntries;
70 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aNumberingEntries;
71 std::vector<std::unique_ptr<AccessibilityCheckEntry>> m_aOtherEntries;
72 std::unique_ptr<weld::Expander> m_xExpanderDocument;
73 std::unique_ptr<weld::Expander> m_xExpanderStyles;
74 std::unique_ptr<weld::Expander> m_xExpanderNoAlt;
75 std::unique_ptr<weld::Expander> m_xExpanderTable;
76 std::unique_ptr<weld::Expander> m_xExpanderFormatting;
77 std::unique_ptr<weld::Expander> m_xExpanderHyperlink;
78 std::unique_ptr<weld::Expander> m_xExpanderFakes;
79 std::unique_ptr<weld::Expander> m_xExpanderNumbering;
80 std::unique_ptr<weld::Expander> m_xExpanderOther;
81 std::unique_ptr<weld::Box> m_xBoxDocument;
82 std::unique_ptr<weld::Box> m_xBoxStyles;
83 std::unique_ptr<weld::Box> m_xBoxNoAlt;
84 std::unique_ptr<weld::Box> m_xBoxTable;
85 std::unique_ptr<weld::Box> m_xBoxFormatting;
86 std::unique_ptr<weld::Box> m_xBoxHyperlink;
87 std::unique_ptr<weld::Box> m_xBoxFakes;
88 std::unique_ptr<weld::Box> m_xBoxNumbering;
89 std::unique_ptr<weld::Box> m_xBoxOther;
90 sfx::AccessibilityIssueCollection m_aIssueCollection;
91 std::function<sfx::AccessibilityIssueCollection()> m_getIssueCollection;
92 void removeOldWidgets();
93 void populateIssues();
95 SfxBindings* mpBindings;
96 SwDoc* mpDoc;
97 ::sfx2::sidebar::ControllerItem maA11yCheckController;
98 sal_Int32 mnIssueCount;
99 bool mbAutomaticCheckEnabled;
102 } //end of namespace sw::sidebar
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */