objc2-ui-kit 0.2.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityType = NSString;

extern "C" {
    pub static UIActivityTypePostToFacebook: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePostToTwitter: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePostToWeibo: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeMessage: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeMail: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePrint: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeCopyToPasteboard: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeAssignToContact: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeSaveToCameraRoll: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeAddToReadingList: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePostToFlickr: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePostToVimeo: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypePostToTencentWeibo: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeAirDrop: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeOpenInIBooks: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeMarkupAsPDF: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeSharePlay: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeCollaborationInviteWithLink: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeCollaborationCopyLink: &'static UIActivityType;
}

extern "C" {
    pub static UIActivityTypeAddToHomeScreen: &'static UIActivityType;
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActivityCategory(pub NSInteger);
impl UIActivityCategory {
    #[doc(alias = "UIActivityCategoryAction")]
    pub const Action: Self = Self(0);
    #[doc(alias = "UIActivityCategoryShare")]
    pub const Share: Self = Self(1);
}

unsafe impl Encode for UIActivityCategory {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIActivityCategory {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIActivity;

    unsafe impl ClassType for UIActivity {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for UIActivity {}

extern_methods!(
    unsafe impl UIActivity {
        #[method(activityCategory)]
        pub unsafe fn activityCategory() -> UIActivityCategory;

        #[method_id(@__retain_semantics Other activityType)]
        pub unsafe fn activityType(&self) -> Option<Retained<UIActivityType>>;

        #[method_id(@__retain_semantics Other activityTitle)]
        pub unsafe fn activityTitle(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other activityImage)]
        pub unsafe fn activityImage(&self) -> Option<Retained<UIImage>>;

        #[method(canPerformWithActivityItems:)]
        pub unsafe fn canPerformWithActivityItems(&self, activity_items: &NSArray) -> bool;

        #[method(prepareWithActivityItems:)]
        pub unsafe fn prepareWithActivityItems(&self, activity_items: &NSArray);

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[method_id(@__retain_semantics Other activityViewController)]
        pub unsafe fn activityViewController(
            &self,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UIViewController>>;

        #[method(performActivity)]
        pub unsafe fn performActivity(&self);

        #[method(activityDidFinish:)]
        pub unsafe fn activityDidFinish(&self, completed: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIActivity {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);