use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTableViewRowActionStyle(pub NSInteger);
impl NSTableViewRowActionStyle {
#[doc(alias = "NSTableViewRowActionStyleRegular")]
pub const Regular: Self = Self(0);
#[doc(alias = "NSTableViewRowActionStyleDestructive")]
pub const Destructive: Self = Self(1);
}
unsafe impl Encode for NSTableViewRowActionStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTableViewRowActionStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTableViewRowAction;
);
extern_conformance!(
unsafe impl NSCopying for NSTableViewRowAction {}
);
unsafe impl CopyingHelper for NSTableViewRowAction {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSTableViewRowAction {}
);
impl NSTableViewRowAction {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(rowActionWithStyle:title:handler:))]
#[unsafe(method_family = none)]
pub fn rowActionWithStyle_title_handler(
style: NSTableViewRowActionStyle,
title: &NSString,
handler: &block2::DynBlock<dyn Fn(NonNull<NSTableViewRowAction>, NSInteger)>,
) -> Retained<Self>;
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub fn style(&self) -> NSTableViewRowActionStyle;
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub fn title(&self) -> Retained<NSString>;
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub fn setTitle(&self, title: &NSString);
#[cfg(feature = "NSColor")]
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Retained<NSColor>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
#[cfg(feature = "NSImage")]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub fn image(&self) -> Option<Retained<NSImage>>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setImage:))]
#[unsafe(method_family = none)]
pub fn setImage(&self, image: Option<&NSImage>);
);
}
impl NSTableViewRowAction {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSTableViewRowAction {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}