Dialogs

API for obtaining file capabilities through open/save dialogs.

Types

oc_file_open_with_dialog_elt

typedef struct oc_file_open_with_dialog_elt
{
    oc_list_elt listElt;
    oc_file file;
} oc_file_open_with_dialog_elt;

An element of a list of file handles acquired through a file dialog.


oc_file_open_with_dialog_result

typedef struct oc_file_open_with_dialog_result
{
    oc_file_dialog_button button;
    oc_file file;
    oc_list selection;
} oc_file_open_with_dialog_result;

A structure describing the result of a call to oc_file_open_with_dialog().

Fields

  • button The button of the file dialog clicked by the user.
  • file The file that was opened through the dialog. If the dialog had the OC_FILE_DIALOG_MULTIPLE flag set, this is equal to the first handle in the selection list.
  • selection If the dialog had the OC_FILE_DIALOG_MULTIPLE flag set, this list of oc_file_open_with_dialog_elt contains the handles of the opened files.

Functions

oc_file_open_with_dialog

oc_file_open_with_dialog_result oc_file_open_with_dialog(oc_arena* arena, oc_file_access rights, oc_file_open_flags flags, oc_file_dialog_desc* desc);

Open files through a file dialog. This allows the user to select files outside the root directories currently accessible to the applications, giving them a way to provide new file capabilities to the application.

Parameters

  • arena A memory arena on which to allocate elements of the result.
  • rights The access rights requested on the files to open.
  • flags Flags controlling various options of the open operation. See oc_file_open_flags.
  • desc A structure controlling the options of the file dialog window.

Return

The result of the open operation.