use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static CSSuggestionHighlightAttributeName: &'static NSAttributedStringKey;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CSSuggestionKind(pub NSInteger);
impl CSSuggestionKind {
#[doc(alias = "CSSuggestionKindNone")]
pub const None: Self = Self(0);
#[doc(alias = "CSSuggestionKindCustom")]
pub const Custom: Self = Self(1);
#[doc(alias = "CSSuggestionKindDefault")]
pub const Default: Self = Self(2);
}
unsafe impl Encode for CSSuggestionKind {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CSSuggestionKind {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CSSuggestion;
);
extern_conformance!(
unsafe impl NSCoding for CSSuggestion {}
);
extern_conformance!(
unsafe impl NSCopying for CSSuggestion {}
);
unsafe impl CopyingHelper for CSSuggestion {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CSSuggestion {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CSSuggestion {}
);
impl CSSuggestion {
extern_methods!(
#[unsafe(method(localizedAttributedSuggestion))]
#[unsafe(method_family = none)]
pub unsafe fn localizedAttributedSuggestion(&self) -> Retained<NSAttributedString>;
#[unsafe(method(suggestionKind))]
#[unsafe(method_family = none)]
pub unsafe fn suggestionKind(&self) -> CSSuggestionKind;
#[unsafe(method(compareByRank:))]
#[unsafe(method_family = none)]
pub unsafe fn compareByRank(&self, other: &CSSuggestion) -> NSComparisonResult;
#[unsafe(method(compare:))]
#[unsafe(method_family = none)]
pub unsafe fn compare(&self, other: &CSSuggestion) -> NSComparisonResult;
);
}
impl CSSuggestion {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}