FileDialogOptions.swift 884 B

12345678910111213141516171819202122
  1. import Foundation
  2. /// Options for file dialogs.
  3. public struct FileDialogOptions {
  4. /// The dialog title.
  5. public var title: String
  6. /// The label of the primary button.
  7. public var defaultButtonLabel: String
  8. /// The content types allowed by the dialog.
  9. public var allowedContentTypes: [ContentType]
  10. /// Whether to show hidden files.
  11. ///
  12. /// The definition of "hidden" is platform-specific, but typically involves
  13. /// a special metadata flag and/or a leading period in the file name.
  14. public var showHiddenFiles: Bool
  15. /// Whether to allow the user to provide a custom extension not specified in
  16. /// ``allowedContentTypes`` when saving files.
  17. public var allowOtherContentTypes: Bool
  18. /// The directory the file dialog starts in. If `nil`, the starting
  19. /// directory is backend-specific.
  20. public var initialDirectory: URL?
  21. }