objc2_fs_kit/generated/
FSTaskOptions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A class that passes command options to a task, optionally providing security-scoped URLs.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/fskit/fstaskoptions?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct FSTaskOptions;
16);
17
18extern_conformance!(
19    unsafe impl NSObjectProtocol for FSTaskOptions {}
20);
21
22impl FSTaskOptions {
23    extern_methods!(
24        #[unsafe(method(init))]
25        #[unsafe(method_family = init)]
26        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28        /// An array of strings that represent command-line options for the task.
29        ///
30        /// This property is equivalent to the `argv` array of C strings passed to a command-line tool.
31        #[unsafe(method(taskOptions))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn taskOptions(&self) -> Retained<NSArray<NSString>>;
34
35        /// Retrieves a URL for a given option.
36        ///
37        /// Some command-line options refer to paths that indicate a location in which the module needs access to a file outside of its container.
38        /// FSKit passes these paths as a URL tagged by the option name.
39        ///
40        /// For example, `"-B" "./someFile"` returns the URL for `./someFile` when passed an option `"B"`.
41        /// To indicate that your module treats a given option as a path, include it in the `pathOptions` dictionary within a command options dictionary (`FSActivatOptionSyntax`, `FSCheckOptionSyntax`, or `FSFormatOptionSyntax`).
42        /// This dictionary uses the command option name as a key, and each entry has a value indicating what kind of entry to create.
43        ///
44        /// - Parameter option: The option for which to retrieve the URL. This value doesn't include leading dashes.
45        #[unsafe(method(urlForOption:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn urlForOption(&self, option: &NSString) -> Option<Retained<NSURL>>;
48    );
49}
50
51/// Methods declared on superclass `NSObject`.
52impl FSTaskOptions {
53    extern_methods!(
54        #[unsafe(method(new))]
55        #[unsafe(method_family = new)]
56        pub unsafe fn new() -> Retained<Self>;
57    );
58}