use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
pub struct AMWorkflowController;
#[cfg(feature = "objc2-app-kit")]
unsafe impl ClassType for AMWorkflowController {
#[inherits(NSObject)]
type Super = NSController;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "objc2-app-kit")]
unsafe impl NSCoding for AMWorkflowController {}
#[cfg(feature = "objc2-app-kit")]
unsafe impl NSEditor for AMWorkflowController {}
#[cfg(feature = "objc2-app-kit")]
unsafe impl NSEditorRegistration for AMWorkflowController {}
#[cfg(feature = "objc2-app-kit")]
unsafe impl NSObjectProtocol for AMWorkflowController {}
extern_methods!(
#[cfg(feature = "objc2-app-kit")]
unsafe impl AMWorkflowController {
#[cfg(feature = "AMWorkflow")]
#[method_id(@__retain_semantics Other workflow)]
pub unsafe fn workflow(&self) -> Option<Id<AMWorkflow>>;
#[cfg(feature = "AMWorkflow")]
#[method(setWorkflow:)]
pub unsafe fn setWorkflow(&self, workflow: Option<&AMWorkflow>);
#[cfg(feature = "AMWorkflowView")]
#[method_id(@__retain_semantics Other workflowView)]
pub unsafe fn workflowView(&self) -> Option<Id<AMWorkflowView>>;
#[cfg(feature = "AMWorkflowView")]
#[method(setWorkflowView:)]
pub unsafe fn setWorkflowView(&self, workflow_view: Option<&AMWorkflowView>);
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Id<ProtocolObject<dyn AMWorkflowControllerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn AMWorkflowControllerDelegate>>,
);
#[method(canRun)]
pub unsafe fn canRun(&self) -> bool;
#[method(isRunning)]
pub unsafe fn isRunning(&self) -> bool;
#[method(isPaused)]
pub unsafe fn isPaused(&self) -> bool;
#[method(run:)]
pub unsafe fn run(&self, sender: &AnyObject);
#[method(stop:)]
pub unsafe fn stop(&self, sender: &AnyObject);
#[method(pause:)]
pub unsafe fn pause(&self, sender: &AnyObject);
#[method(step:)]
pub unsafe fn step(&self, sender: &AnyObject);
#[method(reset:)]
pub unsafe fn reset(&self, sender: &AnyObject);
}
);
extern_methods!(
#[cfg(feature = "objc2-app-kit")]
unsafe impl AMWorkflowController {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
}
);
extern_methods!(
#[cfg(feature = "objc2-app-kit")]
unsafe impl AMWorkflowController {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
}
);
extern_protocol!(
pub unsafe trait AMWorkflowControllerDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method(workflowControllerWillRun:)]
unsafe fn workflowControllerWillRun(&self, controller: &AMWorkflowController);
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method(workflowControllerWillStop:)]
unsafe fn workflowControllerWillStop(&self, controller: &AMWorkflowController);
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method(workflowControllerDidRun:)]
unsafe fn workflowControllerDidRun(&self, controller: &AMWorkflowController);
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method(workflowControllerDidStop:)]
unsafe fn workflowControllerDidStop(&self, controller: &AMWorkflowController);
#[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
#[optional]
#[method(workflowController:willRunAction:)]
unsafe fn workflowController_willRunAction(
&self,
controller: &AMWorkflowController,
action: &AMAction,
);
#[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
#[optional]
#[method(workflowController:didRunAction:)]
unsafe fn workflowController_didRunAction(
&self,
controller: &AMWorkflowController,
action: &AMAction,
);
#[cfg(feature = "objc2-app-kit")]
#[optional]
#[method(workflowController:didError:)]
unsafe fn workflowController_didError(
&self,
controller: &AMWorkflowController,
error: &NSError,
);
}
unsafe impl ProtocolType for dyn AMWorkflowControllerDelegate {}
);