objc2_core_spotlight/generated/
CSSuggestion.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10    /// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cssuggestionhighlightattributename?language=objc)
11    pub static CSSuggestionHighlightAttributeName: &'static NSAttributedStringKey;
12}
13
14/// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cssuggestionkind?language=objc)
15// NS_ENUM
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct CSSuggestionKind(pub NSInteger);
19impl CSSuggestionKind {
20    #[doc(alias = "CSSuggestionKindNone")]
21    pub const None: Self = Self(0);
22    #[doc(alias = "CSSuggestionKindCustom")]
23    pub const Custom: Self = Self(1);
24    #[doc(alias = "CSSuggestionKindDefault")]
25    pub const Default: Self = Self(2);
26}
27
28unsafe impl Encode for CSSuggestionKind {
29    const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for CSSuggestionKind {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37    /// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cssuggestion?language=objc)
38    #[unsafe(super(NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    pub struct CSSuggestion;
41);
42
43extern_conformance!(
44    unsafe impl NSCoding for CSSuggestion {}
45);
46
47extern_conformance!(
48    unsafe impl NSCopying for CSSuggestion {}
49);
50
51unsafe impl CopyingHelper for CSSuggestion {
52    type Result = Self;
53}
54
55extern_conformance!(
56    unsafe impl NSObjectProtocol for CSSuggestion {}
57);
58
59extern_conformance!(
60    unsafe impl NSSecureCoding for CSSuggestion {}
61);
62
63impl CSSuggestion {
64    extern_methods!(
65        #[unsafe(method(localizedAttributedSuggestion))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn localizedAttributedSuggestion(&self) -> Retained<NSAttributedString>;
68
69        #[unsafe(method(suggestionKind))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn suggestionKind(&self) -> CSSuggestionKind;
72
73        #[unsafe(method(compareByRank:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn compareByRank(&self, other: &CSSuggestion) -> NSComparisonResult;
76
77        #[unsafe(method(compare:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn compare(&self, other: &CSSuggestion) -> NSComparisonResult;
80    );
81}
82
83/// Methods declared on superclass `NSObject`.
84impl CSSuggestion {
85    extern_methods!(
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[unsafe(method(new))]
91        #[unsafe(method_family = new)]
92        pub unsafe fn new() -> Retained<Self>;
93    );
94}