LibreOffice Module svx (master) 1
GenericCheckDialog.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#include <vcl/svapp.hxx>
13
14namespace svx
15{
17 std::unique_ptr<CheckData>& pCheckData)
18 : m_xBuilder(Application::CreateBuilder(pParent, "svx/ui/genericcheckentry.ui"))
19 , m_xContainer(m_xBuilder->weld_container("checkEntryBox"))
20 , m_xLabel(m_xBuilder->weld_label("label"))
21 , m_xMarkButton(m_xBuilder->weld_button("markButton"))
22 , m_xPropertiesButton(m_xBuilder->weld_button("propertiesButton"))
23 , m_pCheckData(pCheckData)
24{
25 m_xLabel->set_label(m_pCheckData->getText());
26 m_xMarkButton->set_visible(m_pCheckData->canMarkObject());
27 m_xMarkButton->connect_clicked(LINK(this, GenericCheckEntry, MarkButtonClicked));
28 m_xPropertiesButton->set_visible(m_pCheckData->hasProperties());
29 m_xPropertiesButton->connect_clicked(LINK(this, GenericCheckEntry, PropertiesButtonClicked));
30
31 m_xContainer->show();
32}
33
35{
36 m_pCheckData->markObject();
37}
38
39IMPL_LINK_NOARG(GenericCheckEntry, PropertiesButtonClicked, weld::Button&, void)
40{
41 m_pCheckData->runProperties();
42}
43
45 CheckDataCollection& rCheckDataCollection)
46 : GenericDialogController(pParent, "svx/ui/genericcheckdialog.ui", "GenericCheckDialog")
47 , m_rCheckDataCollection(rCheckDataCollection)
48 , m_xCheckBox(m_xBuilder->weld_box("checkBox"))
49{
51}
52
54
56{
57 sal_Int32 i = 0;
58
59 for (std::unique_ptr<CheckData>& pCheckData : m_rCheckDataCollection.getCollection())
60 {
61 auto xEntry = std::make_unique<GenericCheckEntry>(m_xCheckBox.get(), pCheckData);
62 m_xCheckBox->reorder_child(xEntry->get_widget(), i++);
63 m_aCheckEntries.push_back(std::move(xEntry));
64 }
65 return GenericDialogController::run();
66}
67
68} // end svx namespace
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xLabel
Check data collection contains all the checks in one data structure, and also serves to define additi...
virtual OUString getTitle()=0
std::vector< std::unique_ptr< CheckData > > & getCollection()
CheckDataCollection & m_rCheckDataCollection
std::unique_ptr< weld::Box > m_xCheckBox
std::vector< std::unique_ptr< GenericCheckEntry > > m_aCheckEntries
virtual ~GenericCheckDialog() override
GenericCheckDialog(weld::Window *pParent, CheckDataCollection &rCheckDataCollection)
virtual short run() override
A UI piece to show check result text and other widgets, which are relevant for the check (various but...
GenericCheckEntry(weld::Container *pParent, std::unique_ptr< CheckData > &rCheckData)
std::unique_ptr< CheckData > & m_pCheckData
std::unique_ptr< weld::Button > m_xMarkButton
std::unique_ptr< weld::Button > m_xPropertiesButton
std::unique_ptr< weld::Container > m_xContainer
std::unique_ptr< weld::Label > m_xLabel
void set_title(const OUString &rTitle)
int i
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
Reference< XNameAccess > m_xContainer