LibreOffice Module svx (master) 1
AccessibilityCheckDialog.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 */
10
12
14#include <vcl/svapp.hxx>
15
16namespace svx
17{
19 weld::Container* pParent, std::shared_ptr<sfx::AccessibilityIssue> const& rAccessibilityIssue)
20 : m_xBuilder(Application::CreateBuilder(pParent, "svx/ui/accessibilitycheckentry.ui"))
21 , m_xContainer(m_xBuilder->weld_container("accessibilityCheckEntryBox"))
22 , m_xLabel(m_xBuilder->weld_label("accessibilityCheckEntryLabel"))
23 , m_xGotoButton(m_xBuilder->weld_button("accessibilityCheckEntryGotoButton"))
24 , m_pAccessibilityIssue(rAccessibilityIssue)
25{
26 m_xLabel->set_label(m_pAccessibilityIssue->m_aIssueText);
27 m_xGotoButton->set_visible(m_pAccessibilityIssue->canGotoIssue());
28 m_xGotoButton->connect_clicked(LINK(this, AccessibilityCheckEntry, GotoButtonClicked));
29 m_xContainer->show();
30}
31
33{
34 m_pAccessibilityIssue->gotoIssue();
35}
36
38 weld::Window* pParent, sfx::AccessibilityIssueCollection const& rIssueCollection)
39 : GenericDialogController(pParent, "svx/ui/accessibilitycheckdialog.ui",
40 "AccessibilityCheckDialog")
41 , m_aIssueCollection(rIssueCollection)
42 , m_xAccessibilityCheckBox(m_xBuilder->weld_box("accessibilityCheckBox"))
43{
44 sal_Int32 i = 0;
45
46 for (std::shared_ptr<sfx::AccessibilityIssue> const& pIssue : m_aIssueCollection.getIssues())
47 {
48 auto xEntry
49 = std::make_unique<AccessibilityCheckEntry>(m_xAccessibilityCheckBox.get(), pIssue);
50 m_xAccessibilityCheckBox->reorder_child(xEntry->get_widget(), i++);
51 m_aAccessibilityCheckEntries.push_back(std::move(xEntry));
52 }
53}
54
56
57} // end svx namespace
58
59/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xLabel
std::vector< std::shared_ptr< AccessibilityIssue > > & getIssues()
sfx::AccessibilityIssueCollection m_aIssueCollection
AccessibilityCheckDialog(weld::Window *pParent, sfx::AccessibilityIssueCollection const &rIssueCollection)
std::unique_ptr< weld::Box > m_xAccessibilityCheckBox
std::vector< std::unique_ptr< AccessibilityCheckEntry > > m_aAccessibilityCheckEntries
std::unique_ptr< weld::Button > m_xGotoButton
std::unique_ptr< weld::Container > m_xContainer
std::shared_ptr< sfx::AccessibilityIssue > const & m_pAccessibilityIssue
AccessibilityCheckEntry(weld::Container *pParent, std::shared_ptr< sfx::AccessibilityIssue > const &pAccessibilityIssue)
std::unique_ptr< weld::Label > m_xLabel
int i
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
Reference< XNameAccess > m_xContainer