Interface for components that want the root shell to present a confirm/cancel dialog on their behalf.
More...
#include <Malena/Traits/Communication/DialogRequest.h>
Interface for components that want the root shell to present a confirm/cancel dialog on their behalf.
Inherit DialogRequest alongside Hookable and call sendHook(ml::DialogRequest::Hook::SHOW) to ask whatever shell is listening to display a modal with your message and labels.
The shell subscribes with:
_modal.setContent(_text);
if (
auto cb = d.
getOnConfirm()) _modal.onConfirm(std::move(cb));
if (
auto cb = d.
getOnReject()) _modal.onDismiss(std::move(cb));
_modal.show();
});
Interface for components that want the root shell to present a confirm/cancel dialog on their behalf.
virtual const std::string & getMessage()=0
virtual const std::string & getCancelLabel()=0
virtual std::function< void()> getOnConfirm()=0
virtual std::function< void()> getOnReject()=0
virtual const std::string & getConfirmLabel()=0
- See also
- Hookable, Modal
Definition at line 40 of file DialogRequest.h.
◆ Hook
◆ ~DialogRequest()
| virtual ml::DialogRequest::~DialogRequest |
( |
| ) |
|
|
virtualdefault |
◆ getCancelLabel()
| virtual const std::string & ml::DialogRequest::getCancelLabel |
( |
| ) |
|
|
pure virtual |
◆ getConfirmLabel()
| virtual const std::string & ml::DialogRequest::getConfirmLabel |
( |
| ) |
|
|
pure virtual |
◆ getContent()
| virtual ml::Core * ml::DialogRequest::getContent |
( |
| ) |
|
|
inlinevirtual |
◆ getMessage()
| virtual const std::string & ml::DialogRequest::getMessage |
( |
| ) |
|
|
pure virtual |
◆ getOnConfirm()
| virtual std::function< void()> ml::DialogRequest::getOnConfirm |
( |
| ) |
|
|
pure virtual |
◆ getOnReject()
| virtual std::function< void()> ml::DialogRequest::getOnReject |
( |
| ) |
|
|
pure virtual |
◆ getTitle()
| virtual std::string ml::DialogRequest::getTitle |
( |
| ) |
|
|
inlinevirtual |
The documentation for this struct was generated from the following file: