Enigma 3.2.2
A Simple, Reliable and Efficient Encryption Tool
Loading...
Searching...
No Matches
MessageBox.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef ENIGMA_MESSAGE_BOX_H
3#define ENIGMA_MESSAGE_BOX_H
4
5#include <Core/Core.hpp>
6
8#if defined(ENIGMA_PLATFORM_WINDOWS)
9#undef MessageBox
10#undef ERROR
11#undef IGNORE
12#endif
13
15
17public: /* Enums */
21 enum class Icon : std::uint8_t {
22 Info = 0,
23 Warning,
24 Error,
26 };
27 static constexpr std::string_view Icon2Str[4] = {
28 "info",
29 "warning",
30 "error",
31 "question"};
35 enum class Choice : std::uint8_t {
36 Ok = 0,
38 Yes_No,
40 };
41 static constexpr std::string_view Choice2Str[4] = {
42 "ok",
43 "okcancel",
44 "yesno",
45 "yesnocancel"};
46
50 enum class Action : std::int8_t {
51 Cancel = 0,
52 No = Cancel,
53 Ok = 1,
54 Yes = Ok
55 };
56
57public: /* Constructors / Destructor */
65 MessageBox(const std::string& title, const std::string& message,
66 Icon icon = Icon::Info,
67 Choice choice = Choice::Ok_Cancel);
68 ~MessageBox() noexcept = default;
69
70public: /* Accessors */
74 [[nodiscard]] MessageBox::Action Show() const;
75
76private:
77 std::string m_title; /*< MessageBox title */
78 std::string m_message; /*< MessageBox message */
79 Icon m_icon; /*< MessageBox icon */
80 Choice m_choice; /*< MessageBox choice/button template */
81};
82
84
85#endif // !ENIGMA_MESSAGE_BOX_H
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition Macros.hpp:13
#define NS_ENIGMA_END
Definition Macros.hpp:14
static constexpr std::string_view Choice2Str[4]
static constexpr std::string_view Icon2Str[4]
~MessageBox() noexcept=default
MessageBox::Action Show() const
MessageBox(const std::string &title, const std::string &message, Icon icon=Icon::Info, Choice choice=Choice::Ok_Cancel)