fw4spl
t/include/fwGuiQt/dialog/MessageDialog.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "fwGuiQt/config.hpp"
10 
11 #include <fwGui/dialog/IMessageDialog.hpp>
12 
13 #include <QVector>
14 
15 #include <string>
16 
17 class QPushButton;
18 
19 namespace fwGuiQt
20 {
21 namespace dialog
22 {
23 
27 class FWGUIQT_CLASS_API MessageDialog : public ::fwGui::dialog::IMessageDialog
28 {
29 
30 public:
31 
33  (()),
34  ::fwGui::factory::New< MessageDialog > )
35 
36  FWGUIQT_API MessageDialog(::fwGui::GuiBaseObject::Key key);
37 
38  FWGUIQT_API virtual ~MessageDialog() override;
39 
41  FWGUIQT_API virtual void setTitle( const std::string& title ) override;
42 
44  FWGUIQT_API virtual void setMessage( const std::string& msg ) override;
45 
47  FWGUIQT_API virtual void setIcon( IMessageDialog::Icons icon) override;
48 
50  FWGUIQT_API virtual void addButton( IMessageDialog::Buttons button ) override;
51 
53  FWGUIQT_API virtual void addCustomButton(const std::string& label, std::function<void()> clickedFn) override;
54 
56  FWGUIQT_API virtual void setDefaultButton( IMessageDialog::Buttons button ) override;
57 
59  FWGUIQT_API virtual Buttons show() override;
60 
61 protected:
62 
64  std::string m_title;
65 
67  std::string m_message;
68 
70  ::fwGui::dialog::IMessageDialog::Buttons m_buttons;
71 
73  ::fwGui::dialog::IMessageDialog::Buttons m_defaultButton;
74 
76  ::fwGui::dialog::IMessageDialog::Icons m_icon;
77 
79  QVector< QPushButton* > m_customButtons;
80 };
81 
82 } // namespace dialog
83 } // namespace fwGuiQt
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
STL namespace.
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32
Defines the generic message box for IHM.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Defines the generic message box for IHM.