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/nstextalternatives?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSTextAlternatives;
);

extern_conformance!(
    unsafe impl NSCoding for NSTextAlternatives {}
);

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

extern_conformance!(
    unsafe impl NSSecureCoding for NSTextAlternatives {}
);

impl NSTextAlternatives {
    extern_methods!(
        #[unsafe(method(initWithPrimaryString:alternativeStrings:))]
        #[unsafe(method_family = init)]
        pub fn initWithPrimaryString_alternativeStrings(
            this: Allocated<Self>,
            primary_string: &NSString,
            alternative_strings: &NSArray<NSString>,
        ) -> Retained<Self>;

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

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

        #[unsafe(method(noteSelectedAlternativeString:))]
        #[unsafe(method_family = none)]
        pub fn noteSelectedAlternativeString(&self, alternative_string: &NSString);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSTextAlternatives {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSTextAlternatives {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextalternativesselectedalternativestringnotification?language=objc)
    pub static NSTextAlternativesSelectedAlternativeStringNotification: &'static NSNotificationName;
}