//! 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 crate::*; /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssaveoptions?language=objc) // NS_ENUM #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSSaveOptions(pub NSUInteger); impl NSSaveOptions { #[doc(alias = "NSSaveOptionsYes")] pub const Yes: Self = Self(0); #[doc(alias = "NSSaveOptionsNo")] pub const No: Self = Self(1); #[doc(alias = "NSSaveOptionsAsk")] pub const Ask: Self = Self(2); } unsafe impl Encode for NSSaveOptions { const ENCODING: Encoding = NSUInteger::ENCODING; } unsafe impl RefEncode for NSSaveOptions { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsclonecommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSCloneCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSCloneCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSCloneCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSCloneCommand { extern_methods!( #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(setReceiversSpecifier:))] #[unsafe(method_family = none)] pub fn setReceiversSpecifier(&self, receivers_ref: Option<&NSScriptObjectSpecifier>); #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(keySpecifier))] #[unsafe(method_family = none)] pub fn keySpecifier(&self) -> Retained; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSCloneCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSCloneCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSCloneCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsclosecommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSCloseCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSCloseCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSCloseCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSCloseCommand { extern_methods!( #[unsafe(method(saveOptions))] #[unsafe(method_family = none)] pub fn saveOptions(&self) -> NSSaveOptions; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSCloseCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSCloseCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSCloseCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscountcommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSCountCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSCountCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSCountCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSCountCommand { extern_methods!(); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSCountCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSCountCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSCountCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscreatecommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSCreateCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSCreateCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSCreateCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSCreateCommand { extern_methods!( #[cfg(all(feature = "NSClassDescription", feature = "NSScriptClassDescription"))] #[unsafe(method(createClassDescription))] #[unsafe(method_family = none)] pub fn createClassDescription(&self) -> Retained; #[cfg(all(feature = "NSDictionary", feature = "NSString"))] #[unsafe(method(resolvedKeyDictionary))] #[unsafe(method_family = none)] pub fn resolvedKeyDictionary(&self) -> Retained>; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSCreateCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSCreateCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSCreateCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdeletecommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSDeleteCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSDeleteCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSDeleteCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSDeleteCommand { extern_methods!( #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(setReceiversSpecifier:))] #[unsafe(method_family = none)] pub fn setReceiversSpecifier(&self, receivers_ref: Option<&NSScriptObjectSpecifier>); #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(keySpecifier))] #[unsafe(method_family = none)] pub fn keySpecifier(&self) -> Retained; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSDeleteCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSDeleteCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSDeleteCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsexistscommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSExistsCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSExistsCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSExistsCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSExistsCommand { extern_methods!(); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSExistsCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSExistsCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSExistsCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsgetcommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSGetCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSGetCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSGetCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSGetCommand { extern_methods!(); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSGetCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSGetCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSGetCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmovecommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSMoveCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSMoveCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSMoveCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSMoveCommand { extern_methods!( #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(setReceiversSpecifier:))] #[unsafe(method_family = none)] pub fn setReceiversSpecifier(&self, receivers_ref: Option<&NSScriptObjectSpecifier>); #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(keySpecifier))] #[unsafe(method_family = none)] pub fn keySpecifier(&self) -> Retained; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSMoveCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSMoveCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSMoveCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsquitcommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSQuitCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSQuitCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSQuitCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSQuitCommand { extern_methods!( #[unsafe(method(saveOptions))] #[unsafe(method_family = none)] pub fn saveOptions(&self) -> NSSaveOptions; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSQuitCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSQuitCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSQuitCommand { #[inline] fn default_retained() -> Retained { Self::new() } } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssetcommand?language=objc) #[unsafe(super(NSScriptCommand, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSScriptCommand")] pub struct NSSetCommand; ); #[cfg(all(feature = "NSObject", feature = "NSScriptCommand"))] extern_conformance!( unsafe impl NSCoding for NSSetCommand {} ); #[cfg(feature = "NSScriptCommand")] extern_conformance!( unsafe impl NSObjectProtocol for NSSetCommand {} ); #[cfg(feature = "NSScriptCommand")] impl NSSetCommand { extern_methods!( #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(setReceiversSpecifier:))] #[unsafe(method_family = none)] pub fn setReceiversSpecifier(&self, receivers_ref: Option<&NSScriptObjectSpecifier>); #[cfg(feature = "NSScriptObjectSpecifiers")] #[unsafe(method(keySpecifier))] #[unsafe(method_family = none)] pub fn keySpecifier(&self) -> Retained; ); } /// Methods declared on superclass `NSScriptCommand`. #[cfg(feature = "NSScriptCommand")] impl NSSetCommand { extern_methods!( #[cfg(feature = "NSScriptCommandDescription")] #[unsafe(method(initWithCommandDescription:))] #[unsafe(method_family = init)] pub fn initWithCommandDescription( this: Allocated, command_def: &NSScriptCommandDescription, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `in_coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, in_coder: &NSCoder, ) -> Option>; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSScriptCommand")] impl NSSetCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } #[cfg(feature = "NSScriptCommand")] impl DefaultRetained for NSSetCommand { #[inline] fn default_retained() -> Retained { Self::new() } }