objc2-game-kit 0.3.2

Bindings to the GameKit 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!(
    /// Standard view controller for sending friend requests to other players. Present modally from the top view controller.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkfriendrequestcomposeviewcontroller?language=objc)
    #[unsafe(super(NSViewController, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    #[deprecated = "No longer supported."]
    pub struct GKFriendRequestComposeViewController;
);

#[cfg(all(feature = "GKDialogController", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl GKViewController for GKFriendRequestComposeViewController {}
);

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

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

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

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

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

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKFriendRequestComposeViewController {
    extern_methods!();
}

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

#[deprecated = "No longer supported."]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKFriendRequestComposeViewController {
    extern_methods!(
        /// Get the maximum number of recipients permitted
        #[deprecated = "No longer supported."]
        #[unsafe(method(maxNumberOfRecipients))]
        #[unsafe(method_family = none)]
        pub unsafe fn maxNumberOfRecipients(mtm: MainThreadMarker) -> NSUInteger;

        /// Specify the message sent to the invitee. A default message will be used if you don't specify one.
        #[deprecated = "No longer supported."]
        #[unsafe(method(setMessage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMessage(&self, message: Option<&NSString>);

        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
        /// Add recipients to the request.
        /// If you don't specify at least one recipient before presenting the view, the recipients field will be made firstResponder, to encourage the user to add some.
        /// If you add more than maxNumberOfRecipients recipients, these methods will throw an exception.
        #[unsafe(method(addRecipientPlayers:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addRecipientPlayers(&self, players: &NSArray<GKPlayer>);

        #[deprecated]
        #[unsafe(method(addRecipientsWithPlayerIDs:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addRecipientsWithPlayerIDs(&self, player_i_ds: &NSArray<NSString>);

        #[deprecated = "No longer supported."]
        #[unsafe(method(addRecipientsWithEmailAddresses:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addRecipientsWithEmailAddresses(&self, email_addresses: &NSArray<NSString>);

        #[deprecated = "No longer supported."]
        #[unsafe(method(composeViewDelegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn composeViewDelegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn GKFriendRequestComposeViewControllerDelegate>>>;

        /// Setter for [`composeViewDelegate`][Self::composeViewDelegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "No longer supported."]
        #[unsafe(method(setComposeViewDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setComposeViewDelegate(
            &self,
            compose_view_delegate: Option<
                &ProtocolObject<dyn GKFriendRequestComposeViewControllerDelegate>,
            >,
        );
    );
}

extern_protocol!(
    /// Optional delegate
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkfriendrequestcomposeviewcontrollerdelegate?language=objc)
    #[deprecated = "No longer supported."]
    pub unsafe trait GKFriendRequestComposeViewControllerDelegate {
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// The compose view has finished
        #[deprecated = "No longer supported."]
        #[unsafe(method(friendRequestComposeViewControllerDidFinish:))]
        #[unsafe(method_family = none)]
        unsafe fn friendRequestComposeViewControllerDidFinish(
            &self,
            view_controller: &GKFriendRequestComposeViewController,
        );
    }
);