icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSAppleEventSendOptions {
        NSAppleEventSendNoReply = 1,
        NSAppleEventSendQueueReply = 2,
        NSAppleEventSendWaitForReply = 3,
        NSAppleEventSendNeverInteract = 16,
        NSAppleEventSendCanInteract = 32,
        NSAppleEventSendAlwaysInteract = 48,
        NSAppleEventSendCanSwitchLayer = 64,
        NSAppleEventSendDontRecord = 4096,
        NSAppleEventSendDontExecute = 8192,
        NSAppleEventSendDontAnnotate = 65536,
        NSAppleEventSendDefaultOptions = 35,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSAppleEventDescriptor")]
    pub struct NSAppleEventDescriptor;

    #[cfg(feature = "Foundation_NSAppleEventDescriptor")]
    unsafe impl ClassType for NSAppleEventDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSAppleEventDescriptor")]
unsafe impl NSCoding for NSAppleEventDescriptor {}

#[cfg(feature = "Foundation_NSAppleEventDescriptor")]
unsafe impl NSCopying for NSAppleEventDescriptor {}

#[cfg(feature = "Foundation_NSAppleEventDescriptor")]
unsafe impl NSObjectProtocol for NSAppleEventDescriptor {}

#[cfg(feature = "Foundation_NSAppleEventDescriptor")]
unsafe impl NSSecureCoding for NSAppleEventDescriptor {}

extern_methods!(
    #[cfg(feature = "Foundation_NSAppleEventDescriptor")]
    unsafe impl NSAppleEventDescriptor {
        #[method_id(@__retain_semantics Other nullDescriptor)]
        pub unsafe fn nullDescriptor() -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other descriptorWithBoolean:)]
        pub unsafe fn descriptorWithBoolean(boolean: Boolean) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other descriptorWithEnumCode:)]
        pub unsafe fn descriptorWithEnumCode(enumerator: OSType) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other descriptorWithInt32:)]
        pub unsafe fn descriptorWithInt32(signed_int: i32) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other descriptorWithDouble:)]
        pub unsafe fn descriptorWithDouble(double_value: c_double) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other descriptorWithTypeCode:)]
        pub unsafe fn descriptorWithTypeCode(type_code: OSType) -> Id<NSAppleEventDescriptor>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other descriptorWithString:)]
        pub unsafe fn descriptorWithString(string: &NSString) -> Id<NSAppleEventDescriptor>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other descriptorWithDate:)]
        pub unsafe fn descriptorWithDate(date: &NSDate) -> Id<NSAppleEventDescriptor>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other descriptorWithFileURL:)]
        pub unsafe fn descriptorWithFileURL(file_url: &NSURL) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other listDescriptor)]
        pub unsafe fn listDescriptor() -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other recordDescriptor)]
        pub unsafe fn recordDescriptor() -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Other currentProcessDescriptor)]
        pub unsafe fn currentProcessDescriptor() -> Id<NSAppleEventDescriptor>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other descriptorWithBundleIdentifier:)]
        pub unsafe fn descriptorWithBundleIdentifier(
            bundle_identifier: &NSString,
        ) -> Id<NSAppleEventDescriptor>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other descriptorWithApplicationURL:)]
        pub unsafe fn descriptorWithApplicationURL(
            application_url: &NSURL,
        ) -> Id<NSAppleEventDescriptor>;

        #[method_id(@__retain_semantics Init initListDescriptor)]
        pub unsafe fn initListDescriptor(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics Init initRecordDescriptor)]
        pub unsafe fn initRecordDescriptor(this: Allocated<Self>) -> Id<Self>;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other data)]
        pub unsafe fn data(&self) -> Id<NSData>;

        #[method(booleanValue)]
        pub unsafe fn booleanValue(&self) -> Boolean;

        #[method(enumCodeValue)]
        pub unsafe fn enumCodeValue(&self) -> OSType;

        #[method(int32Value)]
        pub unsafe fn int32Value(&self) -> i32;

        #[method(doubleValue)]
        pub unsafe fn doubleValue(&self) -> c_double;

        #[method(typeCodeValue)]
        pub unsafe fn typeCodeValue(&self) -> OSType;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other stringValue)]
        pub unsafe fn stringValue(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other dateValue)]
        pub unsafe fn dateValue(&self) -> Option<Id<NSDate>>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other fileURLValue)]
        pub unsafe fn fileURLValue(&self) -> Option<Id<NSURL>>;

        #[method(isRecordDescriptor)]
        pub unsafe fn isRecordDescriptor(&self) -> bool;

        #[method(numberOfItems)]
        pub unsafe fn numberOfItems(&self) -> NSInteger;

        #[method(insertDescriptor:atIndex:)]
        pub unsafe fn insertDescriptor_atIndex(
            &self,
            descriptor: &NSAppleEventDescriptor,
            index: NSInteger,
        );

        #[method_id(@__retain_semantics Other descriptorAtIndex:)]
        pub unsafe fn descriptorAtIndex(
            &self,
            index: NSInteger,
        ) -> Option<Id<NSAppleEventDescriptor>>;

        #[method(removeDescriptorAtIndex:)]
        pub unsafe fn removeDescriptorAtIndex(&self, index: NSInteger);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSAppleEventDescriptor")]
    unsafe impl NSAppleEventDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

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