Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
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 native dialogs are available on this platform. When false, callers should fall back to 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.
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: