/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include #include #include #include #include #include namespace sw::sidebar { class AccessibilityCheckEntry final { private: std::unique_ptr m_xBuilder; std::unique_ptr m_xContainer; std::unique_ptr m_xLabel; std::unique_ptr m_xGotoButton; std::unique_ptr m_xFixButton; std::shared_ptr m_pAccessibilityIssue; public: AccessibilityCheckEntry(weld::Container* pParent, std::shared_ptr const& pAccessibilityIssue); weld::Widget* get_widget() const { return m_xContainer.get(); } DECL_LINK(GotoButtonClicked, weld::LinkButton&, bool); DECL_LINK(FixButtonClicked, weld::Button&, void); }; enum class AccessibilityCheckGroups : size_t { Document = 0, Styles = 1, Linked = 2, NoAlt = 3, Table = 4, Formatting = 5, DirectFormatting = 6, Hyperlink = 7, Fakes = 8, Numbering = 9, Other = 10, LAST = Other }; class A11yCheckIssuesPanel : public PanelLayout, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: static std::unique_ptr Create(weld::Widget* pParent, SfxBindings* pBindings); virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem* pState) override; virtual void GetControlState(const sal_uInt16 /*nSId*/, boost::property_tree::ptree& /*rState*/) override{}; A11yCheckIssuesPanel(weld::Widget* pParent, SfxBindings* pBindings); void ImplDestroy(); virtual ~A11yCheckIssuesPanel() override; private: std::array>, 11> m_aEntries; std::array, 11> m_xExpanders; std::array, 11> m_xBoxes; std::unique_ptr m_xOptionsButton; std::unique_ptr mxAccessibilityBox; std::unique_ptr mxUpdateBox; std::unique_ptr mxUpdateLinkButton; sfx::AccessibilityIssueCollection m_aIssueCollection; void removeAllEntries(); void populateIssues(); DECL_LINK(OptionsButtonClicked, weld::Button&, void); DECL_LINK(UpdateLinkButtonClicked, weld::LinkButton&, bool); DECL_LINK(PopulateIssuesHdl, void*, void); void addEntryForGroup(AccessibilityCheckGroups eGroup, std::vector& rIndices, std::shared_ptr const& pIssue); SfxBindings* GetBindings() { return mpBindings; } SfxBindings* mpBindings; SwDoc* mpDoc; ::sfx2::sidebar::ControllerItem maA11yCheckController; sal_Int32 mnIssueCount; bool mbAutomaticCheckEnabled; }; } //end of namespace sw::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */