objc2_file_provider/generated/
NSFileProviderModifyItemOptions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// Options for modifying items.
8///
9/// See also [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovidermodifyitemoptions?language=objc)
10// NS_OPTIONS
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSFileProviderModifyItemOptions(pub NSUInteger);
14bitflags::bitflags! {
15    impl NSFileProviderModifyItemOptions: NSUInteger {
16/// An option that indicates the changes may already exist in your remote storage.
17///
18/// This option applies when moving the item to a location where it may refer to an item that already exists.
19/// This situation may occur when merging two directories together.
20        #[doc(alias = "NSFileProviderModifyItemMayAlreadyExist")]
21        const MayAlreadyExist = 1<<0;
22/// An option to fail an upload in the event of a version conflict.
23///
24/// 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`.
25///
26/// 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.
27///
28/// ```text
29/// <key
30/// >NSExtension
31/// </key
32/// >
33/// <dict
34/// >
35/// <key
36/// >NSExtensionFileProviderSupportsFailingUploadOnConflict
37/// </key
38/// >
39/// <true
40/// />
41/// </dict
42/// >
43/// ```
44        #[doc(alias = "NSFileProviderModifyItemFailOnConflict")]
45        const FailOnConflict = 1<<1;
46/// An option to require the upload to complete before calling the completion handler.
47///
48/// This option allows the calling application to know when the uploaded version of the file is on the server.
49        #[doc(alias = "NSFileProviderModifyItemIsImmediateUploadRequestByPresentingApplication")]
50        const IsImmediateUploadRequestByPresentingApplication = 1<<2;
51    }
52}
53
54unsafe impl Encode for NSFileProviderModifyItemOptions {
55    const ENCODING: Encoding = NSUInteger::ENCODING;
56}
57
58unsafe impl RefEncode for NSFileProviderModifyItemOptions {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}