objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! 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 objc2_foundation::*;

use crate::*;

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

extern_conformance!(
    unsafe impl NSObjectProtocol for NSDictionaryControllerKeyValuePair {}
);

impl NSDictionaryControllerKeyValuePair {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(key))]
        #[unsafe(method_family = none)]
        pub fn key(&self) -> Option<Retained<NSString>>;

        /// Setter for [`key`][Self::key].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKey:))]
        #[unsafe(method_family = none)]
        pub fn setKey(&self, key: Option<&NSString>);

        #[unsafe(method(value))]
        #[unsafe(method_family = none)]
        pub fn value(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`value`][Self::value].
        ///
        /// # Safety
        ///
        /// `value` should be of the correct type.
        #[unsafe(method(setValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValue(&self, value: Option<&AnyObject>);

        #[unsafe(method(localizedKey))]
        #[unsafe(method_family = none)]
        pub fn localizedKey(&self) -> Option<Retained<NSString>>;

        /// Setter for [`localizedKey`][Self::localizedKey].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocalizedKey:))]
        #[unsafe(method_family = none)]
        pub fn setLocalizedKey(&self, localized_key: Option<&NSString>);

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

/// Methods declared on superclass `NSObject`.
impl NSDictionaryControllerKeyValuePair {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdictionarycontroller?language=objc)
    #[unsafe(super(NSArrayController, NSObjectController, NSController, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "NSArrayController",
        feature = "NSController",
        feature = "NSObjectController"
    ))]
    pub struct NSDictionaryController;
);

#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
extern_conformance!(
    unsafe impl NSCoding for NSDictionaryController {}
);

#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
extern_conformance!(
    unsafe impl NSEditor for NSDictionaryController {}
);

#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
extern_conformance!(
    unsafe impl NSEditorRegistration for NSDictionaryController {}
);

#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSDictionaryController {}
);

#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
impl NSDictionaryController {
    extern_methods!(
        #[unsafe(method(newObject))]
        #[unsafe(method_family = new)]
        pub fn newObject(&self) -> Retained<NSDictionaryControllerKeyValuePair>;

        #[unsafe(method(initialKey))]
        #[unsafe(method_family = none)]
        pub fn initialKey(&self) -> Retained<NSString>;

        /// Setter for [`initialKey`][Self::initialKey].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setInitialKey:))]
        #[unsafe(method_family = none)]
        pub fn setInitialKey(&self, initial_key: &NSString);

        #[unsafe(method(initialValue))]
        #[unsafe(method_family = none)]
        pub fn initialValue(&self) -> Retained<AnyObject>;

        /// Setter for [`initialValue`][Self::initialValue].
        ///
        /// # Safety
        ///
        /// `initial_value` should be of the correct type.
        #[unsafe(method(setInitialValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInitialValue(&self, initial_value: &AnyObject);

        #[unsafe(method(includedKeys))]
        #[unsafe(method_family = none)]
        pub fn includedKeys(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`includedKeys`][Self::includedKeys].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setIncludedKeys:))]
        #[unsafe(method_family = none)]
        pub fn setIncludedKeys(&self, included_keys: &NSArray<NSString>);

        #[unsafe(method(excludedKeys))]
        #[unsafe(method_family = none)]
        pub fn excludedKeys(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`excludedKeys`][Self::excludedKeys].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setExcludedKeys:))]
        #[unsafe(method_family = none)]
        pub fn setExcludedKeys(&self, excluded_keys: &NSArray<NSString>);

        #[unsafe(method(localizedKeyDictionary))]
        #[unsafe(method_family = none)]
        pub fn localizedKeyDictionary(&self) -> Retained<NSDictionary<NSString, NSString>>;

        /// Setter for [`localizedKeyDictionary`][Self::localizedKeyDictionary].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocalizedKeyDictionary:))]
        #[unsafe(method_family = none)]
        pub fn setLocalizedKeyDictionary(
            &self,
            localized_key_dictionary: &NSDictionary<NSString, NSString>,
        );

        #[unsafe(method(localizedKeyTable))]
        #[unsafe(method_family = none)]
        pub fn localizedKeyTable(&self) -> Option<Retained<NSString>>;

        /// Setter for [`localizedKeyTable`][Self::localizedKeyTable].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocalizedKeyTable:))]
        #[unsafe(method_family = none)]
        pub fn setLocalizedKeyTable(&self, localized_key_table: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSObjectController`.
#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
impl NSDictionaryController {
    extern_methods!(
        /// # Safety
        ///
        /// `content` should be of the correct type.
        #[unsafe(method(initWithContent:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContent(
            this: Allocated<Self>,
            content: Option<&AnyObject>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSController`.
#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
impl NSDictionaryController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(
    feature = "NSArrayController",
    feature = "NSController",
    feature = "NSObjectController"
))]
impl NSDictionaryController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}