1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// An object that describes a piece of data and its associated name and uniform type identifier.
/// This data can either be stored in a file on disk, or in memory.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/intents/infile?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct INFile;
);
extern_conformance!(
unsafe impl NSCoding for INFile {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for INFile {}
);
extern_conformance!(
unsafe impl NSSecureCoding for INFile {}
);
impl INFile {
extern_methods!(
#[unsafe(method(fileWithData:filename:typeIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn fileWithData_filename_typeIdentifier(
data: &NSData,
filename: &NSString,
type_identifier: Option<&NSString>,
) -> Retained<INFile>;
#[unsafe(method(fileWithFileURL:filename:typeIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn fileWithFileURL_filename_typeIdentifier(
file_url: &NSURL,
filename: Option<&NSString>,
type_identifier: Option<&NSString>,
) -> Retained<INFile>;
/// The contents of the file.
/// If the file was created with a URL, accessing this property will memory map the file contents.
#[unsafe(method(data))]
#[unsafe(method_family = none)]
pub unsafe fn data(&self) -> Retained<NSData>;
/// The human-readable name of the file, which will be displayed to the user.
#[unsafe(method(filename))]
#[unsafe(method_family = none)]
pub unsafe fn filename(&self) -> Retained<NSString>;
/// Setter for [`filename`][Self::filename].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setFilename:))]
#[unsafe(method_family = none)]
pub unsafe fn setFilename(&self, filename: &NSString);
/// The uniform type identifier of the file. (i.e. "public.json", "public.png", or any custom type)
/// More information about uniform type identifiers can be found in
/// <CoreServices
/// /UTCoreTypes.h>
#[unsafe(method(typeIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn typeIdentifier(&self) -> Option<Retained<NSString>>;
/// URL to the file on disk, if any.
/// If the file isn't stored on disk, access the contents using the `data` property.
///
/// If the file was created elsewhere on the system, make sure to surround access to file contents
/// with `-[NSURL startAccessingSecurityScopedResource]` and `-[NSURL stopAccessingSecurityScopedResource]`.
#[unsafe(method(fileURL))]
#[unsafe(method_family = none)]
pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>;
/// Indicates whether the file should be automatically deleted from disk when the Shortcut is done running. `false` by default.
#[unsafe(method(removedOnCompletion))]
#[unsafe(method_family = none)]
pub unsafe fn removedOnCompletion(&self) -> bool;
/// Setter for [`removedOnCompletion`][Self::removedOnCompletion].
#[unsafe(method(setRemovedOnCompletion:))]
#[unsafe(method_family = none)]
pub unsafe fn setRemovedOnCompletion(&self, removed_on_completion: bool);
);
}
/// Methods declared on superclass `NSObject`.
impl INFile {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}