| 92 | }; |
| 93 | |
| 94 | struct MessageBoxOptions { |
| 95 | //! @name Chain-call style initializers |
| 96 | //! @{ |
| 97 | |
| 98 | MessageBoxOptions &&Parent(WindowPlacement *parent_) && |
| 99 | { parent = parent_; return std::move(*this); } |
| 100 | |
| 101 | MessageBoxOptions &&Caption(TranslatableString caption_) && |
| 102 | { caption = std::move(caption_); return std::move(*this); } |
| 103 | |
| 104 | MessageBoxOptions &&IconStyle(Icon style) && |
| 105 | { iconStyle = style; return std::move(*this); } |
| 106 | |
| 107 | MessageBoxOptions &&ButtonStyle(Button style) && |
| 108 | { buttonStyle = style; return std::move(*this); } |
| 109 | |
| 110 | //! Override the usual defaulting to Yes; affects only the YesNo case |
| 111 | MessageBoxOptions &&DefaultIsNo() && |
| 112 | { yesOrOkDefaultButton = false; return std::move(*this); } |
| 113 | |
| 114 | MessageBoxOptions &&CancelButton() && |
| 115 | { cancelButton = true; return std::move(*this); } |
| 116 | |
| 117 | //! Center the dialog on its parent window, if any |
| 118 | MessageBoxOptions &&Centered() && |
| 119 | { centered = true; return std::move(*this); } |
| 120 | |
| 121 | //! @} |
| 122 | |
| 123 | WindowPlacement *parent{ nullptr }; |
| 124 | TranslatableString caption{ DefaultCaption() }; |
| 125 | Icon iconStyle{ Icon::None }; |
| 126 | Button buttonStyle{ Button::Default }; |
| 127 | bool yesOrOkDefaultButton{ true }; |
| 128 | bool cancelButton{ false }; |
| 129 | bool centered{ false }; |
| 130 | }; |
| 131 | |
| 132 | enum class MessageBoxResult : int { |
| 133 | None, //!< May be returned if no Services are installed |
no test coverage detected