1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
13 #include <svx/svxdllapi.h>
14 #include <tools/link.hxx>
15 #include <vcl/weld.hxx>
22 virtual ~CheckData() {}
24 virtual OUString
getText() = 0;
26 virtual bool canMarkObject() = 0;
27 virtual void markObject() = 0;
29 virtual bool hasProperties() = 0;
30 virtual void runProperties() = 0;
33 class CheckDataCollection
36 std::vector
<std::unique_ptr
<CheckData
>> m_aCollection
;
39 virtual ~CheckDataCollection() {}
41 std::vector
<std::unique_ptr
<CheckData
>>& getCollection() { return m_aCollection
; }
43 virtual OUString
getTitle() = 0;
46 class GenericCheckEntry final
49 std::unique_ptr
<weld::Builder
> m_xBuilder
;
50 std::unique_ptr
<weld::Container
> m_xContainer
;
51 std::unique_ptr
<weld::Label
> m_xLabel
;
52 std::unique_ptr
<weld::Button
> m_xMarkButton
;
53 std::unique_ptr
<weld::Button
> m_xPropertiesButton
;
55 std::unique_ptr
<CheckData
>& m_pCheckData
;
58 GenericCheckEntry(weld::Container
* pParent
, std::unique_ptr
<CheckData
>& rCheckData
);
60 weld::Widget
* get_widget() const { return m_xContainer
.get(); }
62 DECL_LINK(MarkButtonClicked
, weld::Button
&, void);
63 DECL_LINK(PropertiesButtonClicked
, weld::Button
&, void);
66 class SVX_DLLPUBLIC GenericCheckDialog final
: public weld::GenericDialogController
69 std::vector
<std::unique_ptr
<GenericCheckEntry
>> m_aCheckEntries
;
70 CheckDataCollection
& m_rCheckDataCollection
;
73 std::unique_ptr
<weld::Box
> m_xCheckBox
;
76 GenericCheckDialog(weld::Window
* pParent
, CheckDataCollection
& rCheckDataCollection
);
77 virtual ~GenericCheckDialog() override
;
78 virtual short run() override
;
81 } // end svx namespace
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */