use crate::common::*;
use crate::Foundation::*;
pub type NSUserScriptTaskCompletionHandler = *mut Block<(*mut NSError,), ()>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSUserScriptTask;
unsafe impl ClassType for NSUserScriptTask {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSUserScriptTask {
#[method_id(@__retain_semantics Init initWithURL:error:)]
pub unsafe fn initWithURL_error(
this: Option<Allocated<Self>>,
url: &NSURL,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other scriptURL)]
pub unsafe fn scriptURL(&self) -> Id<NSURL, Shared>;
#[method(executeWithCompletionHandler:)]
pub unsafe fn executeWithCompletionHandler(
&self,
handler: NSUserScriptTaskCompletionHandler,
);
}
);
pub type NSUserUnixTaskCompletionHandler = *mut Block<(*mut NSError,), ()>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSUserUnixTask;
unsafe impl ClassType for NSUserUnixTask {
#[inherits(NSObject)]
type Super = NSUserScriptTask;
}
);
extern_methods!(
unsafe impl NSUserUnixTask {
#[method_id(@__retain_semantics Other standardInput)]
pub unsafe fn standardInput(&self) -> Option<Id<NSFileHandle, Shared>>;
#[method(setStandardInput:)]
pub unsafe fn setStandardInput(&self, standardInput: Option<&NSFileHandle>);
#[method_id(@__retain_semantics Other standardOutput)]
pub unsafe fn standardOutput(&self) -> Option<Id<NSFileHandle, Shared>>;
#[method(setStandardOutput:)]
pub unsafe fn setStandardOutput(&self, standardOutput: Option<&NSFileHandle>);
#[method_id(@__retain_semantics Other standardError)]
pub unsafe fn standardError(&self) -> Option<Id<NSFileHandle, Shared>>;
#[method(setStandardError:)]
pub unsafe fn setStandardError(&self, standardError: Option<&NSFileHandle>);
#[method(executeWithArguments:completionHandler:)]
pub unsafe fn executeWithArguments_completionHandler(
&self,
arguments: Option<&NSArray<NSString>>,
handler: NSUserUnixTaskCompletionHandler,
);
}
);
pub type NSUserAppleScriptTaskCompletionHandler =
*mut Block<(*mut NSAppleEventDescriptor, *mut NSError), ()>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSUserAppleScriptTask;
unsafe impl ClassType for NSUserAppleScriptTask {
#[inherits(NSObject)]
type Super = NSUserScriptTask;
}
);
extern_methods!(
unsafe impl NSUserAppleScriptTask {
#[method(executeWithAppleEvent:completionHandler:)]
pub unsafe fn executeWithAppleEvent_completionHandler(
&self,
event: Option<&NSAppleEventDescriptor>,
handler: NSUserAppleScriptTaskCompletionHandler,
);
}
);
pub type NSUserAutomatorTaskCompletionHandler = *mut Block<(*mut Object, *mut NSError), ()>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSUserAutomatorTask;
unsafe impl ClassType for NSUserAutomatorTask {
#[inherits(NSObject)]
type Super = NSUserScriptTask;
}
);
extern_methods!(
unsafe impl NSUserAutomatorTask {
#[method_id(@__retain_semantics Other variables)]
pub unsafe fn variables(&self) -> Option<Id<NSDictionary<NSString, Object>, Shared>>;
#[method(setVariables:)]
pub unsafe fn setVariables(&self, variables: Option<&NSDictionary<NSString, Object>>);
#[method(executeWithInput:completionHandler:)]
pub unsafe fn executeWithInput_completionHandler(
&self,
input: Option<&NSSecureCoding>,
handler: NSUserAutomatorTaskCompletionHandler,
);
}
);
extern_methods!(
unsafe impl NSUserUnixTask {
#[method_id(@__retain_semantics Init initWithURL:error:)]
pub unsafe fn initWithURL_error(
this: Option<Allocated<Self>>,
url: &NSURL,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
}
);
extern_methods!(
unsafe impl NSUserAppleScriptTask {
#[method_id(@__retain_semantics Init initWithURL:error:)]
pub unsafe fn initWithURL_error(
this: Option<Allocated<Self>>,
url: &NSURL,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
}
);
extern_methods!(
unsafe impl NSUserAutomatorTask {
#[method_id(@__retain_semantics Init initWithURL:error:)]
pub unsafe fn initWithURL_error(
this: Option<Allocated<Self>>,
url: &NSURL,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
}
);