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 
16 namespace 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 }
45 
47 
49 {
50  sal_Int32 i = 0;
51 
52  for (std::shared_ptr<sfx::AccessibilityIssue> const& pIssue : m_aIssueCollection.getIssues())
53  {
54  auto xEntry
55  = std::make_unique<AccessibilityCheckEntry>(m_xAccessibilityCheckBox.get(), pIssue);
56  m_xAccessibilityCheckBox->reorder_child(xEntry->get_widget(), i++);
57  m_aAccessibilityCheckEntries.push_back(std::move(xEntry));
58  }
59  return GenericDialogController::run();
60 }
61 
62 } // end svx namespace
63 
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xLabel
AccessibilityCheckDialog(weld::Window *pParent, sfx::AccessibilityIssueCollection const &rIssueCollection)
std::unique_ptr< weld::Label > m_xLabel
Reference< XNameAccess > m_xContainer
sfx::AccessibilityIssueCollection m_aIssueCollection
std::unique_ptr< weld::Container > m_xContainer
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
int i
std::vector< std::shared_ptr< AccessibilityIssue > > & getIssues()
std::unique_ptr< weld::Box > m_xAccessibilityCheckBox
std::vector< std::unique_ptr< AccessibilityCheckEntry > > m_aAccessibilityCheckEntries
std::unique_ptr< weld::Button > m_xGotoButton
AccessibilityCheckEntry(weld::Container *pParent, std::shared_ptr< sfx::AccessibilityIssue > const &pAccessibilityIssue)
std::shared_ptr< sfx::AccessibilityIssue > const & m_pAccessibilityIssue