Debian Codegraph @

src/Gui/TaskView/TaskSolverMessages.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /****************************************************************************
3 * *
4 * Copyright (c) 2011 Jürgen Riegel <[email protected]> *
5 * *
6 * This file is part of FreeCAD. *
7 * *
8 * FreeCAD is free software: you can redistribute it and/or modify it *
9 * under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation, either version 2.1 of the *
11 * License, or (at your option) any later version. *
12 * *
13 * FreeCAD is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with FreeCAD. If not, see *
20 * <https://www.gnu.org/licenses/>. *
21 * *
22 ***************************************************************************/
23
24 #ifndef GUI_TASKVIEW_TaskSolverMessages_H
25 #define GUI_TASKVIEW_TaskSolverMessages_H
26
27 #include <boost/signals2.hpp>
28
29 #include <Gui/TaskView/TaskView.h>
30
31 class Ui_TaskSolverMessages;
32 using Connection = boost::signals2::connection;
33
34 namespace App
35 {
36 class Property;
37 }
38
39 namespace Gui
40 {
41
42 class GuiExport TaskSolverMessages: public Gui::TaskView::TaskBox
43 {
44 Q_OBJECT
45
46 public:
47 explicit TaskSolverMessages(const QPixmap& icon, const QString& title);
48 ~TaskSolverMessages() override;
49 FC_DISABLE_COPY_MOVE(TaskSolverMessages)
50
51 void slotSetUp(const QString& state, const QString& msg, const QString& link, const QString& linkText);
52
53 private:
54 void setupConnections();
55 virtual void createSettingsButtonActions();
56 virtual void onLabelStatusLinkClicked(const QString&) = 0;
57 void onManualUpdateClicked(bool checked);
58
59 virtual void updateToolTip(const QString&) = 0;
60
61 protected:
62 void setLinkTooltip(const QString& tooltip);
63 QToolButton* getSettingsButton();
64
65 Connection connectionSetUp;
66
67 private:
68 std::unique_ptr<Ui_TaskSolverMessages> ui;
69 };
70
71 } // namespace Gui
72
73 #endif // GUI_TASKVIEW_TaskSolverMessages_H