LibreOffice Module svx (master) 1
GenericCheckDialog.hxx
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
11#pragma once
12
13#include <svx/svxdllapi.h>
14#include <tools/link.hxx>
15#include <vcl/weld.hxx>
16
17namespace svx
18{
24{
25public:
26 virtual ~CheckData() {}
27
29 virtual OUString getText() = 0;
30
32 virtual bool canMarkObject() = 0;
34 virtual void markObject() = 0;
35
37 virtual bool hasProperties() = 0;
39 virtual void runProperties() = 0;
40};
41
48{
49protected:
50 std::vector<std::unique_ptr<CheckData>> m_aCollection;
51
52public:
54
55 std::vector<std::unique_ptr<CheckData>>& getCollection() { return m_aCollection; }
56
57 virtual OUString getTitle() = 0;
58};
59
65{
66private:
67 std::unique_ptr<weld::Builder> m_xBuilder;
68 std::unique_ptr<weld::Container> m_xContainer;
69 std::unique_ptr<weld::Label> m_xLabel;
70 std::unique_ptr<weld::Button> m_xMarkButton;
71 std::unique_ptr<weld::Button> m_xPropertiesButton;
72
73 std::unique_ptr<CheckData>& m_pCheckData;
74
75public:
76 GenericCheckEntry(weld::Container* pParent, std::unique_ptr<CheckData>& rCheckData);
77
78 weld::Widget* get_widget() const { return m_xContainer.get(); }
79
80 DECL_LINK(MarkButtonClicked, weld::Button&, void);
81 DECL_LINK(PropertiesButtonClicked, weld::Button&, void);
82};
83
89{
90private:
91 std::vector<std::unique_ptr<GenericCheckEntry>> m_aCheckEntries;
93
94 std::unique_ptr<weld::Box> m_xCheckBox;
95
96public:
97 GenericCheckDialog(weld::Window* pParent, CheckDataCollection& rCheckDataCollection);
98 virtual ~GenericCheckDialog() override;
99 virtual short run() override;
100};
101
102} // end svx namespace
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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()
std::vector< std::unique_ptr< CheckData > > m_aCollection
Interface for the data of a check, which must be extended by the check itself, to show the data in th...
virtual bool hasProperties()=0
true, if we can show the "Properties" button
virtual void markObject()=0
executed, when the "Mark" button is hit
virtual bool canMarkObject()=0
true, if we can show the "Mark" button
virtual void runProperties()=0
executed, when the "Properties" button is hit
virtual OUString getText()=0
check entry text
This is a generic dialog, which is used to display results of a document checks, like for example ima...
CheckDataCollection & m_rCheckDataCollection
std::unique_ptr< weld::Box > m_xCheckBox
std::vector< std::unique_ptr< GenericCheckEntry > > m_aCheckEntries
A UI piece to show check result text and other widgets, which are relevant for the check (various but...
DECL_LINK(PropertiesButtonClicked, weld::Button &, void)
weld::Widget * get_widget() const
std::unique_ptr< weld::Builder > m_xBuilder
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
DECL_LINK(MarkButtonClicked, weld::Button &, void)
def run(arg=None, arg2=-1)
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28