Bump version to 21.06.18.1
[LibreOffice.git] / include / svx / GenericCheckDialog.hxx
blobef2a41159737d9f9364544ba77b1c7588b11e824
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 */
11 #pragma once
13 #include <svx/svxdllapi.h>
14 #include <tools/link.hxx>
15 #include <vcl/weld.hxx>
17 namespace svx
19 class CheckData
21 public:
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
35 protected:
36 std::vector<std::unique_ptr<CheckData>> m_aCollection;
38 public:
39 virtual ~CheckDataCollection() {}
41 std::vector<std::unique_ptr<CheckData>>& getCollection() { return m_aCollection; }
43 virtual OUString getTitle() = 0;
46 class GenericCheckEntry final
48 private:
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;
57 public:
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
68 private:
69 std::vector<std::unique_ptr<GenericCheckEntry>> m_aCheckEntries;
70 CheckDataCollection& m_rCheckDataCollection;
72 // Controls
73 std::unique_ptr<weld::Box> m_xCheckBox;
75 public:
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: */