//! 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 crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSUbiquitousKeyValueStore;
);

unsafe impl NSObjectProtocol for NSUbiquitousKeyValueStore {}

impl NSUbiquitousKeyValueStore {
    extern_methods!(
        #[unsafe(method(defaultStore))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultStore() -> Retained<NSUbiquitousKeyValueStore>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(objectForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn objectForKey(&self, a_key: &NSString) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(setObject:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setObject_forKey(&self, an_object: Option<&AnyObject>, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[unsafe(method(removeObjectForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeObjectForKey(&self, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[unsafe(method(stringForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stringForKey(&self, a_key: &NSString) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(arrayForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn arrayForKey(&self, a_key: &NSString) -> Option<Retained<NSArray>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(dictionaryForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn dictionaryForKey(
            &self,
            a_key: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[unsafe(method(dataForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataForKey(&self, a_key: &NSString) -> Option<Retained<NSData>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(longLongForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn longLongForKey(&self, a_key: &NSString) -> c_longlong;

        #[cfg(feature = "NSString")]
        #[unsafe(method(doubleForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn doubleForKey(&self, a_key: &NSString) -> c_double;

        #[cfg(feature = "NSString")]
        #[unsafe(method(boolForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn boolForKey(&self, a_key: &NSString) -> bool;

        #[cfg(feature = "NSString")]
        #[unsafe(method(setString:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setString_forKey(&self, a_string: Option<&NSString>, a_key: &NSString);

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[unsafe(method(setData:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setData_forKey(&self, a_data: Option<&NSData>, a_key: &NSString);

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(setArray:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setArray_forKey(&self, an_array: Option<&NSArray>, a_key: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(setDictionary:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDictionary_forKey(
            &self,
            a_dictionary: Option<&NSDictionary<NSString, AnyObject>>,
            a_key: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[unsafe(method(setLongLong:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLongLong_forKey(&self, value: c_longlong, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[unsafe(method(setDouble:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDouble_forKey(&self, value: c_double, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[unsafe(method(setBool:forKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBool_forKey(&self, value: bool, a_key: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[unsafe(method(dictionaryRepresentation))]
        #[unsafe(method_family = none)]
        pub unsafe fn dictionaryRepresentation(
            &self,
        ) -> Retained<NSDictionary<NSString, AnyObject>>;

        #[unsafe(method(synchronize))]
        #[unsafe(method_family = none)]
        pub unsafe fn synchronize(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSUbiquitousKeyValueStore {
    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>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoredidchangeexternallynotification?language=objc)
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUbiquitousKeyValueStoreDidChangeExternallyNotification:
        &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorechangereasonkey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSUbiquitousKeyValueStoreChangeReasonKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorechangedkeyskey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSUbiquitousKeyValueStoreChangedKeysKey: &'static NSString;
}

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreserverchange?language=objc)
pub const NSUbiquitousKeyValueStoreServerChange: NSInteger = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreinitialsyncchange?language=objc)
pub const NSUbiquitousKeyValueStoreInitialSyncChange: NSInteger = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorequotaviolationchange?language=objc)
pub const NSUbiquitousKeyValueStoreQuotaViolationChange: NSInteger = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreaccountchange?language=objc)
pub const NSUbiquitousKeyValueStoreAccountChange: NSInteger = 3;
