objc2-social 0.3.2

Bindings to the Social 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::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/social/slcomposeserviceviewcontroller?language=objc)
    #[unsafe(super(NSViewController, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    pub struct SLComposeServiceViewController;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSEditor for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSeguePerforming for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSTextDelegate for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSTextViewDelegate for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for SLComposeServiceViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SLComposeServiceViewController {
    extern_methods!(
        #[unsafe(method(presentationAnimationDidFinish))]
        #[unsafe(method_family = none)]
        pub unsafe fn presentationAnimationDidFinish(&self);

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

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

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

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

        #[unsafe(method(didSelectPost))]
        #[unsafe(method_family = none)]
        pub unsafe fn didSelectPost(&self);

        #[unsafe(method(didSelectCancel))]
        #[unsafe(method_family = none)]
        pub unsafe fn didSelectCancel(&self);

        #[unsafe(method(cancel))]
        #[unsafe(method_family = none)]
        pub unsafe fn cancel(&self);

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

        #[unsafe(method(validateContent))]
        #[unsafe(method_family = none)]
        pub unsafe fn validateContent(&self);

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

        /// Setter for [`charactersRemaining`][Self::charactersRemaining].
        ///
        /// # Safety
        ///
        /// `characters_remaining` might not allow `None`.
        #[unsafe(method(setCharactersRemaining:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCharactersRemaining(&self, characters_remaining: Option<&NSNumber>);
    );
}

/// Methods declared on superclass `NSViewController`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SLComposeServiceViewController {
    extern_methods!(
        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSNibName>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> 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 `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SLComposeServiceViewController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SLComposeServiceViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}