fw4spl
IMessageDialog.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 "fwGui/config.hpp"
10 #include "fwGui/GuiBaseObject.hpp"
11 
12 #include <string>
13 
14 namespace fwGui
15 {
16 namespace dialog
17 {
21 class FWGUI_CLASS_API IMessageDialog : public ::fwGui::GuiBaseObject
22 {
23 
24 public:
25 
27 
28 
29  typedef enum
30  {
31  CRITICAL,
32  WARNING,
33  INFO,
34  QUESTION,
35  NONE
36  } Icons;
37 
39  typedef enum
40  {
41  NOBUTTON = 0, // invalid
42 
43  OK = 1 << 1,
44  YES = 1 << 2,
45  NO = 1 << 3,
46  CANCEL = 1 << 4,
47 
48  YES_NO = YES | NO
49  } Buttons;
50 
52  FWGUI_API IMessageDialog();
54  FWGUI_API virtual ~IMessageDialog();
55 
56  typedef std::string FactoryRegistryKeyType;
57  FWGUI_API static const FactoryRegistryKeyType REGISTRY_KEY;
58 
60  FWGUI_API virtual void setTitle(const std::string& title) = 0;
61 
63  FWGUI_API virtual void setMessage(const std::string& msg) = 0;
64 
66  FWGUI_API virtual void setIcon( Icons icon) = 0;
67 
69  FWGUI_API virtual void addButton(Buttons button ) = 0;
70 
72  FWGUI_API virtual void setDefaultButton(Buttons button) = 0;
73 
75  FWGUI_API virtual void addCustomButton(const std::string& label, std::function<void()> clickedFn) = 0;
76 
78  FWGUI_API virtual Buttons show() = 0;
79 
80 };
81 
82 } //namespace dialog
83 } // namespace fwGui
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Defines the generic message box for IHM.
Base class for all fwGui&#39;s classes.