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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use crate::*;
/// Options for modifying items.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidermodifyitemoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSFileProviderModifyItemOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSFileProviderModifyItemOptions: NSUInteger {
/// An option that indicates the changes may already exist in your remote storage.
///
/// This option applies when moving the item to a location where it may refer to an item that already exists.
/// This situation may occur when merging two directories together.
#[doc(alias = "NSFileProviderModifyItemMayAlreadyExist")]
const MayAlreadyExist = 1<<0;
/// An option to fail an upload in the event of a version conflict.
///
/// If you adopt this option, and an uploaded item's base version doesn't match the version on the server, fail and return ``NSFileProviderError/localVersionConflictingWithServer`` (Swift) or ``NSFileProviderErrorCode/NSFileProviderErrorLocalVersionConflictingWithServer`` (Objective-C) in your implementation of `modifyItem`.
///
/// To support the fail-on-conflict behavior in your file provider, indicate the support by adding the following key/value pair to the extension's Info pane.
///
/// ```text
/// <key
/// >NSExtension
/// </key
/// >
/// <dict
/// >
/// <key
/// >NSExtensionFileProviderSupportsFailingUploadOnConflict
/// </key
/// >
/// <true
/// />
/// </dict
/// >
/// ```
#[doc(alias = "NSFileProviderModifyItemFailOnConflict")]
const FailOnConflict = 1<<1;
/// An option to require the upload to complete before calling the completion handler.
///
/// This option allows the calling application to know when the uploaded version of the file is on the server.
#[doc(alias = "NSFileProviderModifyItemIsImmediateUploadRequestByPresentingApplication")]
const IsImmediateUploadRequestByPresentingApplication = 1<<2;
}
}
unsafe impl Encode for NSFileProviderModifyItemOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSFileProviderModifyItemOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}