Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::editor::NativeDialogCoordinator Class Reference

Presents native open/save dialogs and tracks directory/recents state. More...

#include "donner/editor/NativeDialogCoordinator.h"

Public Member Functions

bool available () const
 Whether desktop native dialogs are available. BrowserFileDialog handles browser hosts; other platforms can use the in-editor ImGui modal.
std::optional< std::string > openFile (GLFWwindow *window, const std::optional< std::string > &currentFilePath)
 Present a native "Open SVG" dialog.
std::optional< std::string > saveFile (GLFWwindow *window, const std::optional< std::string > &suggestedPath)
 Present a native "Save SVG" dialog.
void showSaveError (GLFWwindow *window, const std::string &message) const
 Present a native alert when a save fails after its panel has closed.
const std::vector< std::string > & recentFiles () const
 In-process recent-files list, newest first.

Detailed Description

Presents native open/save dialogs and tracks directory/recents state.

Member Function Documentation

◆ openFile()

std::optional< std::string > donner::editor::NativeDialogCoordinator::openFile ( GLFWwindow * window,
const std::optional< std::string > & currentFilePath )
nodiscard

Present a native "Open SVG" dialog.

Parameters
windowOwning editor window.
currentFilePathPath of the open document, used to seed the start directory when nothing better is remembered.
Returns
Chosen absolute path (already recorded into directory memory and recents), or std::nullopt if cancelled/unavailable.

◆ saveFile()

std::optional< std::string > donner::editor::NativeDialogCoordinator::saveFile ( GLFWwindow * window,
const std::optional< std::string > & suggestedPath )
nodiscard

Present a native "Save SVG" dialog.

Parameters
windowOwning editor window.
suggestedPathPath or name to pre-fill; its directory seeds the start directory and its filename seeds the name field. When empty, defaults to "untitled.svg".
Returns
Chosen absolute path (already recorded), or std::nullopt if cancelled/unavailable.

The documentation for this class was generated from the following file: