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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    pub static NSFileProviderErrorDomain: &'static NSErrorDomain;
}

extern "C" {
    pub static NSFileProviderErrorCollidingItemKey: &'static NSErrorUserInfoKey;
}

extern "C" {
    pub static NSFileProviderErrorItemKey: &'static NSErrorUserInfoKey;
}

extern "C" {
    pub static NSFileProviderErrorNonExistentItemIdentifierKey: &'static NSErrorUserInfoKey;
}

// NS_ERROR_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSFileProviderErrorCode(pub NSInteger);
impl NSFileProviderErrorCode {
    pub const NSFileProviderErrorNotAuthenticated: Self = Self(-1000);
    pub const NSFileProviderErrorFilenameCollision: Self = Self(-1001);
    pub const NSFileProviderErrorSyncAnchorExpired: Self = Self(-1002);
    pub const NSFileProviderErrorPageExpired: Self =
        Self(NSFileProviderErrorCode::NSFileProviderErrorSyncAnchorExpired.0);
    pub const NSFileProviderErrorInsufficientQuota: Self = Self(-1003);
    pub const NSFileProviderErrorServerUnreachable: Self = Self(-1004);
    pub const NSFileProviderErrorNoSuchItem: Self = Self(-1005);
    pub const NSFileProviderErrorDeletionRejected: Self = Self(-1006);
    pub const NSFileProviderErrorDirectoryNotEmpty: Self = Self(-1007);
    pub const NSFileProviderErrorProviderNotFound: Self = Self(-2001);
    pub const NSFileProviderErrorProviderTranslocated: Self = Self(-2002);
    pub const NSFileProviderErrorOlderExtensionVersionRunning: Self = Self(-2003);
    pub const NSFileProviderErrorNewerExtensionVersionFound: Self = Self(-2004);
    pub const NSFileProviderErrorCannotSynchronize: Self = Self(-2005);
    pub const NSFileProviderErrorNonEvictableChildren: Self = Self(-2006);
    pub const NSFileProviderErrorUnsyncedEdits: Self = Self(-2007);
    pub const NSFileProviderErrorNonEvictable: Self = Self(-2008);
    pub const NSFileProviderErrorVersionNoLongerAvailable: Self = Self(-2009);
    pub const NSFileProviderErrorExcludedFromSync: Self = Self(-2010);
    pub const NSFileProviderErrorDomainDisabled: Self = Self(-2011);
    pub const NSFileProviderErrorProviderDomainTemporarilyUnavailable: Self = Self(-2012);
    pub const NSFileProviderErrorProviderDomainNotFound: Self = Self(-2013);
    pub const NSFileProviderErrorApplicationExtensionNotFound: Self = Self(-2014);
}

unsafe impl Encode for NSFileProviderErrorCode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSFileProviderErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_category!(
    /// Category "NSFileProviderError" on [`NSError`].
    #[doc(alias = "NSFileProviderError")]
    pub unsafe trait NSErrorNSFileProviderError {
        #[cfg(feature = "NSFileProviderItem")]
        #[method_id(@__retain_semantics Other fileProviderErrorForCollisionWithItem:)]
        unsafe fn fileProviderErrorForCollisionWithItem(
            existing_item: &NSFileProviderItem,
        ) -> Id<Self>;

        #[cfg(feature = "NSFileProviderItem")]
        #[method_id(@__retain_semantics Other fileProviderErrorForNonExistentItemWithIdentifier:)]
        unsafe fn fileProviderErrorForNonExistentItemWithIdentifier(
            item_identifier: &NSFileProviderItemIdentifier,
        ) -> Id<Self>;

        #[cfg(feature = "NSFileProviderItem")]
        #[method_id(@__retain_semantics Other fileProviderErrorForRejectedDeletionOfItem:)]
        unsafe fn fileProviderErrorForRejectedDeletionOfItem(
            updated_version: &NSFileProviderItem,
        ) -> Id<Self>;
    }

    unsafe impl NSErrorNSFileProviderError for NSError {}
);