Owns the editor's popup/modal state and renders the corresponding ImGui dialogs.
More...
#include "donner/editor/DialogPresenter.h"
|
| | DialogPresenter (std::string editorNoticeText, std::string editorBuildInfo=std::string()) |
| | Create modal state with the host's notice and build information.
|
| void | requestOpenFile (const std::optional< std::string > ¤tFilePath) |
| | Queue the Open SVG dialog with an initial path.
|
| void | requestSaveFile (const std::optional< std::string > ¤tFilePath, std::string error=std::string()) |
| | Queue the Save SVG dialog with an initial path and optional error.
|
|
void | requestAbout () |
| | Queue the About dialog for the next presentation pass.
|
| void | render (const std::function< bool(std::string_view, std::string *)> &tryOpenFile, const std::function< bool(std::string_view, std::string *)> &trySaveFile) |
| | Draw requested dialogs and invoke host callbacks for accepted paths.
|
| void | setOpenFileError (std::string error) |
| | Replace the error shown by the Open SVG dialog.
|
|
void | clearOpenFileError () |
| | Clear the Open SVG dialog error.
|
| void | setSaveFileError (std::string error) |
| | Replace the error shown by the Save SVG dialog.
|
|
void | clearSaveFileError () |
| | Clear the Save SVG dialog error.
|
|
bool | openFileModalRequested () const |
| | Whether an Open SVG modal has been requested but not yet opened by render().
|
|
bool | saveFileModalRequested () const |
| | Whether a Save SVG modal has been requested but not yet opened by render().
|
|
void | consumeOpenFileModalRequest () |
| | Consume a pending Open SVG request without showing the ImGui modal. Used when a native OS dialog handles the interaction instead.
|
|
void | consumeSaveFileModalRequest () |
| | Consume a pending Save SVG request without showing the ImGui modal. Used when a native OS dialog handles the interaction instead.
|
|
std::string | pendingSaveFilePath () const |
| | The path pre-filled into the pending Save SVG request (the current file path, or the suggested export/save-as name). Empty when none was set.
|
|
bool | aboutPopupRequested () const |
| | Whether the About modal has been requested but not yet opened by render().
|
Owns the editor's popup/modal state and renders the corresponding ImGui dialogs.
◆ DialogPresenter()
| donner::editor::DialogPresenter::DialogPresenter |
( |
std::string | editorNoticeText, |
|
|
std::string | editorBuildInfo = std::string() ) |
|
explicit |
Create modal state with the host's notice and build information.
- Parameters
-
| editorNoticeText | Third-party notices shown in the Licenses dialog. |
| editorBuildInfo | Optional version and commit lines. |
◆ render()
| void donner::editor::DialogPresenter::render |
( |
const std::function< bool(std::string_view, std::string *)> & | tryOpenFile, |
|
|
const std::function< bool(std::string_view, std::string *)> & | trySaveFile ) |
Draw requested dialogs and invoke host callbacks for accepted paths.
- Parameters
-
| tryOpenFile | Attempts an open and returns success; writes a failure message through its string pointer. |
| trySaveFile | Attempts a save and returns success; writes a failure message through its string pointer. |
◆ requestOpenFile()
| void donner::editor::DialogPresenter::requestOpenFile |
( |
const std::optional< std::string > & | currentFilePath | ) |
|
Queue the Open SVG dialog with an initial path.
- Parameters
-
| currentFilePath | Current file path when available. |
◆ requestSaveFile()
| void donner::editor::DialogPresenter::requestSaveFile |
( |
const std::optional< std::string > & | currentFilePath, |
|
|
std::string | error = std::string() ) |
Queue the Save SVG dialog with an initial path and optional error.
- Parameters
-
| currentFilePath | Current or suggested destination path. |
| error | Initial save error to display. |
◆ setOpenFileError()
| void donner::editor::DialogPresenter::setOpenFileError |
( |
std::string | error | ) |
|
Replace the error shown by the Open SVG dialog.
- Parameters
-
| error | New diagnostic text. |
◆ setSaveFileError()
| void donner::editor::DialogPresenter::setSaveFileError |
( |
std::string | error | ) |
|
Replace the error shown by the Save SVG dialog.
- Parameters
-
| error | New diagnostic text. |
The documentation for this class was generated from the following file: