objc2-file-provider 0.3.2

Bindings to the FileProvider framework
Documentation
//! 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);
}