NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
Loading...
Searching...
No Matches
nvdialog_file_dialog.h File Reference

Go to the source code of this file.

Typedefs

typedef struct _NvdFileDialog NvdFileDialog
 An opaque file dialog type, representing either a file dialog that can be used to open a file or save a file, and since v0.9.0, opening a directory instead.

Functions

NVD_API NvdFileDialognvd_open_file_dialog_new (const char *title, const char *file_extensions)
NVD_API NvdFileDialognvd_save_file_dialog_new (const char *title, const char *default_filename)
 Creates a new, empty NvdFileDialog object that will be used to save a file in the selected (from the user) location.
NVD_API NvdFileDialognvd_open_folder_dialog_new (const char *title, const char *default_folder)
 Creates a new, empty NvdFileDialog object that will be used to request a directory or folder in the filesystem.
NVD_API NvdDynamicStringnvd_get_file_location (NvdFileDialog *dialog)
 Returns the filesystem path chosen through the NvdFileDialog passed.
NVD_API void * nvd_open_file_dialog_get_raw (NvdFileDialog *dialog)
 Returns the raw object behind the dialog.

Typedef Documentation

◆ NvdFileDialog

typedef struct _NvdFileDialog NvdFileDialog

An opaque file dialog type, representing either a file dialog that can be used to open a file or save a file, and since v0.9.0, opening a directory instead.

Since
v0.1.0
Examples
/home/acs/Projects/nvdialog/include/dialogs/nvdialog_file_dialog.h.

Function Documentation

◆ nvd_get_file_location()

NVD_API NvdDynamicString * nvd_get_file_location ( NvdFileDialog * dialog)

Returns the filesystem path chosen through the NvdFileDialog passed.

This function will return the path on the filesystem from the dialog chosen, that you can then use to either open or save the file given. It works with both save and open file dialog types.

See also
nvd_open_file_dialog_new
Parameters
dialogThe file dialog to take the filename from.
Returns
A NvdDynamicString if a file/folder was selected, or NULL if no path was selected by the user.
Examples
/home/acs/Projects/nvdialog/include/dialogs/nvdialog_file_dialog.h.

◆ nvd_open_file_dialog_get_raw()

NVD_API void * nvd_open_file_dialog_get_raw ( NvdFileDialog * dialog)

Returns the raw object behind the dialog.

Parameters
dialogThe dialog to retrieve the object from.
Returns
void* The raw toolkit-created object.
Examples
/home/acs/Projects/nvdialog/include/dialogs/nvdialog_file_dialog.h.

◆ nvd_open_file_dialog_new()

NVD_API NvdFileDialog * nvd_open_file_dialog_new ( const char * title,
const char * file_extensions )

◆ nvd_open_folder_dialog_new()

NVD_API NvdFileDialog * nvd_open_folder_dialog_new ( const char * title,
const char * default_folder )

Creates a new, empty NvdFileDialog object that will be used to request a directory or folder in the filesystem.

Parameters
titleThe title of the dialog, default is "Open directory"
default_folderPath to the default folder to open. May be ignored in some platforms.
Returns
An NvdFileDialog on success or NULL otherwise. nvd_get_error should be called for further information about the error occurring.
Since
v0.9.0
Examples
/home/acs/Projects/nvdialog/include/dialogs/nvdialog_file_dialog.h.

◆ nvd_save_file_dialog_new()

NVD_API NvdFileDialog * nvd_save_file_dialog_new ( const char * title,
const char * default_filename )

Creates a new, empty NvdFileDialog object that will be used to save a file in the selected (from the user) location.

Parameters
titleThe title of the dialog, default is "Save file"
default_filenameThe default filename to use for saving.
Returns
An NvdFileDialog on success, otherwise NULL and nvd_get_error should be called to get the failure reason.
Examples
/home/acs/Projects/nvdialog/include/dialogs/nvdialog_file_dialog.h.