5#ifndef MOLYBDEN_DIALOGS_HPP
6#define MOLYBDEN_DIALOGS_HPP
20enum class MessageDialogType { kNone, kQuestion, kInfo, kWarning, kError };
25enum class MessageDialogButtonType { kNone, kDefault, kCancel };
43 MessageDialogButtonType
type = MessageDialogButtonType::kNone;
78 MessageDialogType
type = MessageDialogType::kNone;
135enum class OpenDialogSelectionPolicy {
222 OpenDialogSelectionPolicy::kFiles;
327 static void show(
const std::shared_ptr<App>& app,
337 static void show(
const std::shared_ptr<App>& app,
347 static void show(
const std::shared_ptr<Browser>& browser,
357 static void show(
const std::shared_ptr<Browser>& browser,
374 static void show(
const std::shared_ptr<App>& app,
385 static void show(
const std::shared_ptr<Browser>& browser,
402 static void show(
const std::shared_ptr<App>& app,
413 static void show(
const std::shared_ptr<Browser>& browser,
Allow displaying the native message dialogs.
Definition dialogs.hpp:319
static void show(const std::shared_ptr< Browser > &browser, const MessageDialogOptions &options, const std::function< void(MessageDialogResult)> &callback)
Shows a browser modal message dialog with the given options.
static void show(const std::shared_ptr< App > &app, const MessageDialogOptions &options, const std::function< void(MessageDialogResult)> &callback)
Shows an application message dialog with the given options.
static void show(const std::shared_ptr< Browser > &browser, const MessageDialogOptions &options)
Shows a browser modal message dialog with the given options.
static void show(const std::shared_ptr< App > &app, const MessageDialogOptions &options)
Shows an application message dialog with the given options.
Allow displaying the native open file/files/folder dialogs.
Definition dialogs.hpp:365
static void show(const std::shared_ptr< Browser > &browser, const OpenDialogOptions &options, const std::function< void(OpenDialogResult)> &callback)
Shows a browser modal open dialog with the given options.
static void show(const std::shared_ptr< App > &app, const OpenDialogOptions &options, const std::function< void(OpenDialogResult)> &callback)
Shows an application open dialog with the given options.
Allow displaying the native save file/folder dialogs.
Definition dialogs.hpp:393
static void show(const std::shared_ptr< App > &app, const SaveDialogOptions &options, const std::function< void(SaveDialogResult)> &callback)
Shows an application save dialog with the given options.
static void show(const std::shared_ptr< Browser > &browser, const SaveDialogOptions &options, const std::function< void(SaveDialogResult)> &callback)
Shows a browser modal save dialog with the given options.
The file filter.
Definition dialogs.hpp:120
std::string name
The name of the filter.
Definition dialogs.hpp:124
std::vector< std::string > extensions
The file extensions to filter by.
Definition dialogs.hpp:129
The message dialog checkbox.
Definition dialogs.hpp:49
std::string label
The label of the checkbox.
Definition dialogs.hpp:53
bool checked
The initial state of the checkbox.
Definition dialogs.hpp:58
The options of a message dialog.
Definition dialogs.hpp:64
MessageDialogType type
The type of the dialog.
Definition dialogs.hpp:78
MessageDialogCheckbox checkbox
The checkbox of the dialog to get additional user input.
Definition dialogs.hpp:99
std::string message
The message text of the dialog.
Definition dialogs.hpp:68
std::string informative_text
The informative text of the dialog.
Definition dialogs.hpp:73
std::vector< MessageDialogButton > buttons
The buttons of the dialog.
Definition dialogs.hpp:93
std::string title
The title of the dialog.
Definition dialogs.hpp:85
The result of a message dialog.
Definition dialogs.hpp:105
bool checkbox_checked
The checkbox state if the dialog had a checkbox.
Definition dialogs.hpp:114
MessageDialogButton button
The button that was clicked.
Definition dialogs.hpp:109
The features of an open dialog.
Definition dialogs.hpp:158
bool treat_packages_as_directories
Whether the dialog treats packages, such as .app folders, as directories instead of a file (macOS).
Definition dialogs.hpp:183
bool show_hidden_files
Whether the dialog shows and allows selecting hidden files.
Definition dialogs.hpp:172
bool can_create_directories
Whether the dialog allows creating new directories (macOS).
Definition dialogs.hpp:167
bool allow_multiple_selections
Whether the dialog allows multiple file selection.
Definition dialogs.hpp:162
bool resolves_symlinks
Whether the dialog resolves symlinks (macOS).
Definition dialogs.hpp:177
The options of an open dialog.
Definition dialogs.hpp:189
OpenDialogFeatures features
The features of the dialog.
Definition dialogs.hpp:227
OpenDialogSelectionPolicy selection_policy
The selection policy of the dialog.
Definition dialogs.hpp:221
std::string message
The message to display above input boxes on macOS.
Definition dialogs.hpp:208
std::string button_label
The custom label of the dialog confirmation button.
Definition dialogs.hpp:198
std::string title
The title of the dialog.
Definition dialogs.hpp:193
std::vector< FileFilter > filters
The filters of the dialog.
Definition dialogs.hpp:213
std::string default_path
The path to the default directory or file to select in the dialog.
Definition dialogs.hpp:203
The result of an open dialog.
Definition dialogs.hpp:233
std::vector< std::string > paths
The paths that were selected.
Definition dialogs.hpp:237
bool canceled
Whether the dialog was canceled.
Definition dialogs.hpp:242
The features of a save dialog.
Definition dialogs.hpp:248
bool treat_packages_as_directories
Whether the dialog treats packages, such as .app folders, as directories instead of a file (macOS).
Definition dialogs.hpp:263
bool show_hidden_files
Whether the dialog shows and allows selecting hidden files.
Definition dialogs.hpp:252
bool can_create_directories
Whether the dialog allows creating new directories (macOS).
Definition dialogs.hpp:257
The options of a save dialog.
Definition dialogs.hpp:269
SaveDialogFeatures features
The features of the dialog.
Definition dialogs.hpp:298
std::vector< FileFilter > filters
The filters of the dialog.
Definition dialogs.hpp:293
std::string title
The title of the dialog.
Definition dialogs.hpp:273
std::string message
The message to display above input boxes on macOS.
Definition dialogs.hpp:288
std::string default_path
The path to the default directory or file to use by default.
Definition dialogs.hpp:278
std::string button_label
The custom label of the dialog confirmation button.
Definition dialogs.hpp:283
The result of a save dialog.
Definition dialogs.hpp:304
std::string path
The path that was selected.
Definition dialogs.hpp:308
bool canceled
Whether the dialog was canceled.
Definition dialogs.hpp:313